24 Jan, 2020

1 commit

  • On AXP288 and newer PMICs, bit 7 of AXP20X_VBUS_IPSOUT_MGMT can be set
    to prevent using the VBUS input. However, when the VBUS unplugged and
    plugged back in, the bit automatically resets to zero.

    We need to set the register as volatile to prevent regmap from caching
    that bit. Otherwise, regcache will think the bit is already set and not
    write the register.

    Fixes: cd53216625a0 ("mfd: axp20x: Fix axp288 volatile ranges")
    Cc: stable@vger.kernel.org
    Signed-off-by: Samuel Holland
    Reviewed-by: Chen-Yu Tsai
    Signed-off-by: Lee Jones

    Samuel Holland
     

19 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

14 May, 2019

2 commits


15 Jan, 2019

1 commit

  • Pull MFD updates from Lee Jones:
    "New Device Support
    - Add support for Power Supply to AXP813
    - Add support for GPIO, ADC, AC and Battery Power Supply to AXP803
    - Add support for UART to Exynos LPASS

    Fix-ups:
    - Use supplied MACROS; ti_am335x_tscadc
    - Trivial spelling/whitespace/alignment; tmio, axp20x, rave-sp
    - Regmap changes; bd9571mwv, wm5110-tables
    - Kconfig dependencies; MFD_AT91_USART
    - Supply shared data for child-devices; madera-core
    - Use new of_node_name_eq() API call; max77620, stmpe
    - Use managed resources (devm_*); tps65218
    - Comment descriptions; ingenic-tcu
    - Coding style; madera-core

    Bug Fixes:
    - Fix section mismatches; twl-core, db8500-prcmu
    - Correct error path related issues; mt6397-core, ab8500-core, mc13xxx-core
    - IRQ related fixes; tps6586x
    - Ensure proper initialisation sequence; qcom_rpm
    - Repair potential memory leak; cros_ec_dev"

    * tag 'mfd-next-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (25 commits)
    mfd: exynos-lpass: Enable UART module support
    mfd: mc13xxx: Fix a missing check of a register-read failure
    mfd: cros_ec: Add commands to control codec
    mfd: madera: Remove spurious semicolon in while loop
    mfd: rave-sp: Fix typo in rave_sp_checksum comment
    mfd: ingenic-tcu: Fix bit field description in header
    mfd: tps65218: Use devm_regmap_add_irq_chip and clean up error path in probe()
    mfd: Use of_node_name_eq() for node name comparisons
    mfd: cros_ec_dev: Add missing mfd_remove_devices() call in remove
    mfd: axp20x: Add supported cells for AXP803
    mfd: axp20x: Re-align MFD cell entries
    mfd: axp20x: Add AC power supply cell for AXP813
    mfd: wm5110: Add missing ASRC rate register
    mfd: qcom_rpm: write fw_version to CTRL_REG
    mfd: tps6586x: Handle interrupts on suspend
    mfd: madera: Add shared data for accessory detection
    mfd: at91-usart: Add platform dependency
    mfd: bd9571mwv: Add volatile register to make DVFS work
    mfd: ab8500-core: Return zero in get_register_interruptible()
    mfd: tmio: Typo s/use use/use/
    ...

    Linus Torvalds
     

03 Jan, 2019

3 commits

  • Parts of the AXP803 are compatible with their counterparts on the AXP813.
    These include the GPIO, ADC, AC and battery power supplies.

    Signed-off-by: Oskari Lemmela
    Reviewed-by: Chen-Yu Tsai
    Tested-by: Vasily Khoruzhick
    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Lee Jones

    Oskari Lemmela
     
  • In the axp20x driver, the various mfd_cell lists had varying amounts
    of indentation, sometimes even within the same list. For the axp288,
    there's no alignment at all.

    Re-align the right hand side of the assignments with the least amount
    of tabs possible. Also collapse the closing bracket and the opening
    bracket of the next entry onto the same line for the axp288, to be
    consistent with all the other mfd_cell lists.

    This patch is whitespace change only. No functionality is modified.

    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Oskari Lemmela
    Signed-off-by: Lee Jones

    Chen-Yu Tsai
     
  • As axp20x-ac-power-supply now supports AXP813, add a cell for it.

    Signed-off-by: Oskari Lemmela
    Reviewed-by: Quentin Schulz
    Reviewed-by: Chen-Yu Tsai
    Tested-by: Vasily Khoruzhick
    Signed-off-by: Lee Jones

    Oskari Lemmela
     

14 Dec, 2018

2 commits


27 Jul, 2018

1 commit

  • The AXP806 can operate in a standalone "self-working" mode, in which it
    is also responsible for power control of the overall system. This mode
    is similar to the master mode, but the EN/PWRON pin functions as a power
    button, instead of a level-triggered enable switch.

    This patch adds code checking for the new "x-powers,self-working-mode"
    property, and a separate mfd_cell list that includes the power button
    (PEK) sub-device.

    Signed-off-by: Chen-Yu Tsai
    Reviewed-by: Icenowy Zheng
    Tested-by: Icenowy Zheng
    Acked-by: Maxime Ripard
    Signed-off-by: Lee Jones

    Chen-Yu Tsai
     

16 May, 2018

6 commits


08 Jan, 2018

2 commits


01 Nov, 2017

1 commit


05 Sep, 2017

2 commits

  • According to their datasheets, the AXP221, AXP223, AXP288, AXP803,
    AXP809 and AXP813 PEK have different values for startup time bits from
    the AXP20X, let's use the platform device id with the correct values.

    Signed-off-by: Quentin Schulz
    Signed-off-by: Chen-Yu Tsai
    Acked-by: Maxime Ripard
    Signed-off-by: Lee Jones

    Quentin Schulz
     
  • The X-Powers AXP813 PMIC is normally used with Allwinner's A83T SoC.
    It has the same range of functions as other X-Powers PMICs, such as
    DC-DC buck converter and linear regulator outputs, AC-IN and VBUS
    power supplies, power button trigger, GPIOs, ADCs, and a battery
    charger.

    Note that the IRQ table given in the datasheet is incorrect: in IRQ
    enable/status registers 1, there are separate IRQs for ACIN and VBUS,
    instead of bits [7:5] being the same as bits [4:2]. So it shares the
    same IRQs as the AXP803, rather than the AXP288.

    This patch adds basic mfd support for it, with only the power button
    enabled.

    Signed-off-by: Chen-Yu Tsai
    Acked-by: Maxime Ripard
    Signed-off-by: Lee Jones

    Chen-Yu Tsai
     

06 Jul, 2017

1 commit


27 Apr, 2017

7 commits

  • AXP803 is a new PMIC chip produced by X-Powers, usually paired with A64
    via RSB bus. The PMIC itself is like AXP288, but with RSB support and
    dedicated VBUS and ACIN.

    Add support for it in the axp20x mfd driver.

    Currently only power key function is supported.

    Signed-off-by: Icenowy Zheng
    Signed-off-by: Lee Jones

    Icenowy Zheng
     
  • The X-Powers AXP20X and AXP22X PMICs can have a battery as power supply.

    This patch adds the AXP20X/AXP22X battery driver to the MFD cells of the
    AXP209, AXP221 and AXP223 MFD.

    Signed-off-by: Quentin Schulz
    Acked-by: Chen-Yu Tsai
    Signed-off-by: Lee Jones

    Quentin Schulz
     
  • The CHRG_CTRL1 and CHRG_CTRL2 registers are made for controlling
    different battery charging settings such as the constant current charge
    value.

    The AXP22X also have a third register CHRG_CTRL3 which has settings for
    battery charging too.

    This adds the CHRG_CTRL1, CHRG_CTRL2 and CHRG_CTRL3 registers to the
    list of writeable registers for AXP20X and AXP22X PMICs.

    Signed-off-by: Quentin Schulz
    Acked-by: Maxime Ripard
    Acked-by: Chen-Yu Tsai
    Signed-off-by: Lee Jones

    Quentin Schulz
     
  • The X-Powers AXP20X and AXP22X PMICs expose the status of AC power
    supply.

    This adds the AC power supply driver to the MFD cells of the AXP22X
    PMICs.

    Signed-off-by: Quentin Schulz
    Acked-by: Maxime Ripard
    Acked-By: Sebastian Reichel
    Acked-by: Chen-Yu Tsai
    Signed-off-by: Lee Jones

    Quentin Schulz
     
  • This adds the AXP20X/AXP22x ADCs driver to the mfd cells of the AXP209,
    AXP221 and AXP223 MFD.

    Signed-off-by: Quentin Schulz
    Acked-by: Maxime Ripard
    Acked-by: Chen-Yu Tsai
    Signed-off-by: Lee Jones

    Quentin Schulz
     
  • The registers 0x56 and 0x57 of AXP22X PMIC store the value of the
    internal temperature of the PMIC.

    This patch modifies the name of these registers from AXP22X_PMIC_ADC_H/L
    to AXP22X_PMIC_TEMP_H/L so their purpose is clearer.

    Signed-off-by: Quentin Schulz
    Acked-by: Chen-Yu Tsai
    Acked-by: Maxime Ripard
    Signed-off-by: Lee Jones

    Quentin Schulz
     
  • commit b101829a029a ("mfd: axp20x: Fix AXP806 access errors on cold boot")
    was intended to fix the case where a board uses an AXP806 in slave mode,
    but the boot loader leaves it in master mode for lack of AXP806 support.
    But now the driver breaks on boards where the PMIC is operating in master
    mode. This patch lets the driver use the new device tree property
    "xpowers,master-mode" to set the correct operating mode for the board.

    Fixes: 8824ee857348 ("mfd: axp20x: Add support for AXP806 PMIC")
    Signed-off-by: Rask Ingemann Lambertsen
    Signed-off-by: Lee Jones

    Rask Ingemann Lambertsen
     

13 Feb, 2017

6 commits

  • The AXP806 supports either master/standalone or slave mode.
    Slave mode allows sharing the serial bus, even with multiple
    AXP806 which all have the same hardware address.

    This is done with extra "serial interface address extension",
    or AXP806_BUS_ADDR_EXT, and "register address extension", or
    AXP806_REG_ADDR_EXT, registers. The former is read-only, with
    1 bit customizable at the factory, and 1 bit depending on the
    state of an external pin. The latter is writable. Only when
    the these device addressing bits (in the upper 4 bits of the
    registers) match, will the device respond to operations on
    its other registers.

    The AXP806_REG_ADDR_EXT was previously configured by Allwinner's
    bootloader. Work on U-boot SPL support now allows us to switch
    to mainline U-boot, which doesn't do this for us. There might
    be other bare minimum bootloaders out there which don't to this
    either. It's best to handle this in the kernel.

    This patch sets AXP806_REG_ADDR_EXT to 0x10, which is what we
    know to be the proper value for a standard AXP806 in slave mode.
    Afterwards it will reinitialize the regmap cache, to purge any
    invalid stale values.

    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Lee Jones

    Chen-Yu Tsai
     
  • The AXP223 shares most of its logic with the AXP221 but has some
    differences for the VBUS power supply driver. Thus, to probe the driver
    with the correct compatible, the AXP221 and the AXP223 now have separate
    MFD cells.

    AXP221 MFD cells are renamed from axp22x_cells to axp221_cells to avoid
    confusion.

    Signed-off-by: Quentin Schulz
    Acked-by: Chen-Yu Tsai
    Acked-by: Maxime Ripard
    Signed-off-by: Lee Jones

    Quentin Schulz
     
  • The axp288 pmic has a lot more volatile registers then we were
    listing in axp288_volatile_ranges, fix this.

    Signed-off-by: Hans de Goede
    Acked-by: Chen-Yu Tsai
    Signed-off-by: Lee Jones

    Hans de Goede
     
  • The R in PEK_DBR stands for rising, so it should be mapped to
    AXP288_IRQ_POKP where the last P stands for positive edge.

    Likewise PEK_DBF should be mapped to the falling edge, aka the
    _N_egative edge, so it should be mapped to AXP288_IRQ_POKN.

    This fixes the inverted powerbutton status reporting by the
    axp20x-pek driver.

    Signed-off-by: Hans de Goede
    Acked-by: Chen-Yu Tsai
    Signed-off-by: Lee Jones

    Hans de Goede
     
  • The axp288 has the following irqs 2 times: VBUS_FALL, VBUS_RISE,
    VBUS_OV. On boot / reset the enable flags for both the normal and alt
    version of these irqs is set.

    Since we were only listing the normal version in the axp288 regmap_irq
    struct, we were never disabling the alt versions of these irqs.

    Add the alt versions to the axp288 regmap_irq struct, so that these
    get properly disabled.

    Together with the other axp288 fixes in this series, this fixes the axp288
    irq contineously triggering.

    Signed-off-by: Hans de Goede
    Acked-by: Chen-Yu Tsai
    Signed-off-by: Lee Jones

    Hans de Goede
     
  • The interrupt line of the entire family of axp2xx pmics is active-low,
    for devicetree enumerated irqs, this is dealt with in the devicetree.

    ACPI irq resources have a flag field for this too, I tried using this
    on my CUBE iwork8 Air tablet, but it does not contain the right data.

    The dstd shows the irq listed as either ActiveLow or ActiveHigh,
    depending on the OSID variable, which seems to be set by the
    "OS IMAGE ID" in the BIOS/EFI setup screen.

    Since the acpi-resource info is no good, simply pass in IRQF_TRIGGER_LOW
    on the axp288.

    Together with the other axp288 fixes in this series, this fixes the axp288
    irq contineously triggering.

    Signed-off-by: Hans de Goede
    Acked-by: Chen-Yu Tsai
    Signed-off-by: Lee Jones

    Hans de Goede
     

29 Nov, 2016

1 commit

  • The AXP806 supports either master/standalone or slave mode.
    Slave mode allows sharing the serial bus, even with multiple
    AXP806 which all have the same hardware address.

    This is done with extra "serial interface address extension",
    or AXP806_BUS_ADDR_EXT, and "register address extension", or
    AXP806_REG_ADDR_EXT, registers. The former is read-only, with
    1 bit customizable at the factory, and 1 bit depending on the
    state of an external pin. The latter is writable. Only when
    the these device addressing bits (in the upper 4 bits of the
    registers) match, will the device respond to operations on
    its other registers.

    Add these 2 registers to the regmap so we can access them.

    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Lee Jones

    Chen-Yu Tsai
     

21 Nov, 2016

1 commit


04 Oct, 2016

1 commit


13 Sep, 2016

1 commit

  • The X-Powers AXP806 is a new PMIC that is paired with Allwinner's A80
    SoC, along with a master AXP809 PMIC.

    This PMIC has a new register layout, and supports some functions not
    seen in other X-Powers PMICs, such as master-slave mode, or having
    multiple AXP806 PMICs on the same bus with address space extension,
    or supporting both I2C and RSB mode. I2C has not been tested.

    This patch adds support for the interrupts of the PMIC. A regulator
    sub-device is enabled, but actual regulator support will come in a
    later patch.

    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Lee Jones

    Chen-Yu Tsai