summaryrefslogtreecommitdiff
path: root/drivers/mfd/axp20x.c
AgeCommit message (Collapse)Author
2017-11-01mfd: axp20x: Add axp20x-regulator cell for AXP813Chen-Yu Tsai
Now that axp20x-regulator supports AXP813, we can add a cell for it to enable it. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Tested-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-09-05mfd: axp20x: Use correct platform device ID for many PEKQuentin Schulz
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 <quentin.schulz@free-electrons.com> Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-09-05mfd: axp20x: Add support for AXP813 PMICChen-Yu Tsai
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 <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-07-06mfd: axp20x: Add axp20x-regulator cell for AXP803Icenowy Zheng
As axp20x-regulator now supports AXP803, add a cell for it. Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-04-27mfd: axp20x: Support AXP803 variantIcenowy Zheng
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 <icenowy@aosc.io> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-04-27mfd: axp20x: Add MFD cells for AXP20X and AXP22X battery driverQuentin Schulz
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 <quentin.schulz@free-electrons.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-04-27mfd: axp20x: Add CHRG_CTRL1/2/3 to writeable regs for AXP20X/AXP22XQuentin 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 <quentin.schulz@free-electrons.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-04-27mfd: axp20x: Add AC power supply cells for AXP22X PMICsQuentin 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 <quentin.schulz@free-electrons.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-By: Sebastian Reichel <sre@kernel.org> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-04-27mfd: axp20x: Add ADC cells for AXP20X and AXP22X PMICsQuentin Schulz
This adds the AXP20X/AXP22x ADCs driver to the mfd cells of the AXP209, AXP221 and AXP223 MFD. Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-04-27mfd: axp20x: Correct name of temperature data ADC registersQuentin 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 <quentin.schulz@free-electrons.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-04-27mfd: axp20x: Add support for dts property "xpowers,master-mode"Rask Ingemann Lambertsen
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 <rask@formelder.dk> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-02-13mfd: axp20x: Fix AXP806 access errors on cold bootChen-Yu Tsai
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 <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-02-13mfd: axp20x: Add separate MFD cell for AXP223Quentin Schulz
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 <quentin.schulz@free-electrons.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-02-13mfd: axp20x: Fix axp288 volatile rangesHans de Goede
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 <hdegoede@redhat.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-02-13mfd: axp20x: Fix axp288 PEK_DBR and PEK_DBF irqs being swappedHans 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 <hdegoede@redhat.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-02-13mfd: axp20x: Add missing axp288 irqsHans 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 <hdegoede@redhat.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-02-13mfd: axp20x: Use IRQF_TRIGGER_LOW on the axp288Hans 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 <hdegoede@redhat.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29mfd: axp20x: Add address extension registers for AXP806 regmapChen-Yu Tsai
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 <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-21mfd: axp20x: Add adc volatile ranges for axp22xIcenowy Zheng
AXP22x has also some different register map than axp20x, they're also added here. Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-10-04mfd: axp20x: Add AXP209 GPIO supportMaxime Ripard
Now that we have a GPIO driver for the AXP209, we can add it to our MFD. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-09-13mfd: axp20x: Add support for AXP806 PMICChen-Yu Tsai
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 <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-06-29mfd: axp20x: Add axp20x-usb-power-supply for axp22x pmicsHans de Goede
Add axp20x-usb-power-supply for axp22x pmics. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-06-29mfd: axp20x: Add a 500ms delay at the end of axp20x_power_offHans de Goede
The kernel expects the power_off function to not return, and if it does it panics. Add a slight delay after the i2c write which turns off power through the PMIC, to give capacitors etc. some time to drain. Without this the kernel lives on long enough after the poweroff to print the following on the serial console on my Mele A1000G quad: [ 248.583588] reboot: Power down [ 248.600490] Kernel pa With the delay the start of printing "Kernel panic" is gone. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-06-29mfd: axp20x: Extend axp22x_volatile_rangesHans de Goede
The axp22x pmic has a bunch of volatile registers besides the interrupt ones, extend axp22x_volatile_ranges with these. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09mfd: axp20x: Add a cell for the ac power_supply part of the axp20x PMICsMichael Haas
As a counterpart to the usb power_supply cell, this commit adds an AC power_supply cell to the axp20x driver. Still missing are the RTC backup battery and the main battery charger cells. Signed-off-by: Michael Haas <haas@computerlinguist.org> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19mfd: axp20x: Add support for AXP809 PMICChen-Yu Tsai
The X-Powers AXP809 is a new PMIC that is paired with Allwinner's A80 SoC, along with a slave AXP806 PMIC. This PMIC is quite similar to the earlier AXP223, though the interrupts and regulator have changed a bit. This patch adds support for the interrupts and power button of the PMIC. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-12mfd: axp20x: Add support for RSB based AXP223 PMICChen-Yu Tsai
The AXP223 is a new PMIC commonly paired with Allwinner A23/A33 SoCs. It is functionally identical to AXP221; only the regulator default voltage/status and the external host interface are different. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-12mfd: axp20x: Whitespace, open parenthesis alignment code style fixesChen-Yu Tsai
This fixes some leftover code style issues in the axp20x core. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-12mfd: axp20x: Split the driver into core and i2c bitsChen-Yu Tsai
The axp20x driver assumes the device is i2c based. This is not the case with later chips, which use a proprietary 2 wire serial bus by Allwinner called "Reduced Serial Bus". This patch follows the example of mfd/wm831x and splits it into an interface independent core, and an i2c specific glue layer. MFD_AXP20X and the new MFD_AXP20X_I2C are changed to tristate symbols, allowing the driver to be built as modules. Whitespace and other style errors in the moved i2c specific code have been fixed. Included but unused header files are removed as well. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-12mfd: axp20x: Add missing copyright noticeChen-Yu Tsai
Supply a backdated copyright notice. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Carlo Caione <carlo@caione.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-12mfd: axp20x: Use dev->driver->of_match_table in axp20x_match_device()Chen-Yu Tsai
In axp20x_match_device(), match the of_device_id table bound to the device driver instead of pointing to axp20x_of_match directly. This will allow us to keep axp20x_match_device() unmodified when we expand the axp20x driver into multiple ones covering different interface types. of_device_get_match_data() cannot be used here as we need to know if it failed to get a match, or if the match data value just happened to be 0, as it is for the AXP152. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-12mfd: axp20x: Remove second struct device * parameter for axp20x_match_device()Chen-Yu Tsai
The first argument passed to axp20x_match_device(), struct axp20x_dev *, already contains a pointer to the device. By rearranging some code, moving the assignment of the pointer before axp20x_match_device() is called, we can eliminate the second parameter. Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30mfd: axp20x: Add a cell for the power button part of the, axp288 PMICsBorun Fu
This patch adds the mfd cell info for axp288 power key device. Signed-off-by: Borun Fu <borun.fu@linux.intel.com> Signed-off-by: Fei Yang <fei.yang@intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-08-12mfd: axp20x: Add a cell for the usb power_supply part of the axp20x PMICsHans de Goede
Add a cell for the usb power_supply part of the axp20x PMICs. Note that this cell is only for the usb power_supply part and not the ac-power / battery-charger / rtc-backup-bat-charger bits. Depending on the board each of those must be enabled / disabled separately in devicetree as most boards do not use all 4. So in dt each one needs its own child-node of the axp20x node. Another reason for using separate child nodes for each is so that other devicetree nodes can have a power-supply property with a phandle referencing a node representing a single power-supply. The decision to use a separate devicetree node for each is reflected on the kernel side by each getting its own mfd-cell / platform_device and platform-driver. Note this commit also makes some whitespace changes to the intialization of existing cells in axp20x_cells, these are pure whitespace changes, functionally nothing changes. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-08-12mfd: axp20x: Add missing registers, and mark more registers volatileBruno Prémont
Add an extra set of registers which is necessary tu support the PMICs battery charger function, and mark registers which contain status bits, gpio status, and adc readings as volatile. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-08-11mfd: axp20x: Add axp152 supportMichal Suchanek
The axp152 is a stripped down version of the axp202 pmic with the battery charging function removed as it is intended for top-set boxes. Signed-off-by: Michal Suchanek <hramrach@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-08-11mfd: Drop owner assignment from i2c_driversKrzysztof Kozlowski
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-05-13mfd: axp20x: Enable AXP22X regulatorsChen-Yu Tsai
Now that the axp20x-regulators driver supports different variants of the AXP family, we can enable regulator support for AXP22X without the risk of incorrectly configuring regulators. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-05-13mfd: axp20x: Add AXP22x PMIC supportBoris BREZILLON
Add support for the AXP22x PMIC devices to the existing AXP20x driver. This includes the AXP221 and AXP223, which are identical except for the external data bus. Only AXP221 is added for now. AXP223 will be added after it's Reduced Serial Bus (RSB) interface is supported. AXP22x defines a new set of registers, power supplies and regulators, but most of the API is similar to the AXP20x ones. A new irq chip definition is used, even though the available interrupts on AXP22x is a subset of those on AXP20x. This is done so the interrupt numbers match those on the datasheet. This patch only enables the interrupts, system power-off function, and PEK sub-device. The regulator driver must first support different variants before we enable it from the mfd driver. Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com> [wens@csie.org: fix interrupts and move regulators to separate patch] Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-04-09mfd: axp20x: Add support for extcon cellRamakrishna Pallala
This patch adds the mfd cell info for axp288 extcon device. Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-03-30mfd: axp20x: Fix duplicate const for model namesKrzysztof Kozlowski
Replace duplicated const keyword for 'axp20x_model_names' with proper array of const pointers to const strings. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-03-03mfd: axp20x: Change battery cell name to fuel gaugeTodd Brandt
Name changes to the battery cell structure to a more generic cell type: fuel gauge. Signed-off-by: Todd Brandt <todd.e.brandt@linux.intel.com> Acked-By: Sebastian Reichel <sre@kernel.org> Acked-by: Jacob Pan <jacob.jun.pan@linux.intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-12-10Merge tag 'pm+acpi-3.19-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI and power management updates from Rafael Wysocki: "This time we have some more new material than we used to have during the last couple of development cycles. The most important part of it to me is the introduction of a unified interface for accessing device properties provided by platform firmware. It works with Device Trees and ACPI in a uniform way and drivers using it need not worry about where the properties come from as long as the platform firmware (either DT or ACPI) makes them available. It covers both devices and "bare" device node objects without struct device representation as that turns out to be necessary in some cases. This has been in the works for quite a few months (and development cycles) and has been approved by all of the relevant maintainers. On top of that, some drivers are switched over to the new interface (at25, leds-gpio, gpio_keys_polled) and some additional changes are made to the core GPIO subsystem to allow device drivers to manipulate GPIOs in the "canonical" way on platforms that provide GPIO information in their ACPI tables, but don't assign names to GPIO lines (in which case the driver needs to do that on the basis of what it knows about the device in question). That also has been approved by the GPIO core maintainers and the rfkill driver is now going to use it. Second is support for hardware P-states in the intel_pstate driver. It uses CPUID to detect whether or not the feature is supported by the processor in which case it will be enabled by default. However, it can be disabled entirely from the kernel command line if necessary. Next is support for a platform firmware interface based on ACPI operation regions used by the PMIC (Power Management Integrated Circuit) chips on the Intel Baytrail-T and Baytrail-T-CR platforms. That interface is used for manipulating power resources and for thermal management: sensor temperature reporting, trip point setting and so on. Also the ACPI core is now going to support the _DEP configuration information in a limited way. Basically, _DEP it supposed to reflect off-the-hierarchy dependencies between devices which may be very indirect, like when AML for one device accesses locations in an operation region handled by another device's driver (usually, the device depended on this way is a serial bus or GPIO controller). The support added this time is sufficient to make the ACPI battery driver work on Asus T100A, but it is general enough to be able to cover some other use cases in the future. Finally, we have a new cpufreq driver for the Loongson1B processor. In addition to the above, there are fixes and cleanups all over the place as usual and a traditional ACPICA update to a recent upstream release. As far as the fixes go, the ACPI LPSS (Low-power Subsystem) driver for Intel platforms should be able to handle power management of the DMA engine correctly, the cpufreq-dt driver should interact with the thermal subsystem in a better way and the ACPI backlight driver should handle some more corner cases, among other things. On top of the ACPICA update there are fixes for race conditions in the ACPICA's interrupt handling code which might lead to some random and strange looking failures on some systems. In the cleanups department the most visible part is the series of commits targeted at getting rid of the CONFIG_PM_RUNTIME configuration option. That was triggered by a discussion regarding the generic power domains code during which we realized that trying to support certain combinations of PM config options was painful and not really worth it, because nobody would use them in production anyway. For this reason, we decided to make CONFIG_PM_SLEEP select CONFIG_PM_RUNTIME and that lead to the conclusion that the latter became redundant and CONFIG_PM could be used instead of it. The material here makes that replacement in a major part of the tree, but there will be at least one more batch of that in the second part of the merge window. Specifics: - Support for retrieving device properties information from ACPI _DSD device configuration objects and a unified device properties interface for device drivers (and subsystems) on top of that. As stated above, this works with Device Trees and ACPI and allows device drivers to be written in a platform firmware (DT or ACPI) agnostic way. The at25, leds-gpio and gpio_keys_polled drivers are now going to use this new interface and the GPIO subsystem is additionally modified to allow device drivers to assign names to GPIO resources returned by ACPI _CRS objects (in case _DSD is not present or does not provide the expected data). The changes in this set are mostly from Mika Westerberg, Rafael J Wysocki, Aaron Lu, and Darren Hart with some fixes from others (Fabio Estevam, Geert Uytterhoeven). - Support for Hardware Managed Performance States (HWP) as described in Volume 3, section 14.4, of the Intel SDM in the intel_pstate driver. CPUID is used to detect whether or not the feature is supported by the processor. If supported, it will be enabled automatically unless the intel_pstate=no_hwp switch is present in the kernel command line. From Dirk Brandewie. - New Intel Broadwell-H ID for intel_pstate (Dirk Brandewie). - Support for firmware interface based on ACPI operation regions used by the PMIC chips on the Intel Baytrail-T and Baytrail-T-CR platforms for power resource control and thermal management (Aaron Lu). - Limited support for retrieving off-the-hierarchy dependencies between devices from ACPI _DEP device configuration objects and deferred probing support for the ACPI battery driver based on the _DEP information to make that driver work on Asus T100A (Lan Tianyu). - New cpufreq driver for the Loongson1B processor (Kelvin Cheung). - ACPICA update to upstream revision 20141107 which only affects tools (Bob Moore). - Fixes for race conditions in the ACPICA's interrupt handling code and in the ACPI code related to system suspend and resume (Lv Zheng and Rafael J Wysocki). - ACPI core fix for an RCU-related issue in the ioremap() regions management code that slowed down significantly after CPUs had been allowed to enter idle states even if they'd had RCU callbakcs queued and triggered some problems in certain proprietary graphics driver (and elsewhere). The fix replaces synchronize_rcu() in that code with synchronize_rcu_expedited() which makes the issue go away. From Konstantin Khlebnikov. - ACPI LPSS (Low-Power Subsystem) driver fix to handle power management of the DMA engine included into the LPSS correctly. The problem is that the DMA engine doesn't have ACPI PM support of its own and it simply is turned off when the last LPSS device having ACPI PM support goes into D3cold. To work around that, the PM domain used by the ACPI LPSS driver is redesigned so at least one device with ACPI PM support will be on as long as the DMA engine is in use. From Andy Shevchenko. - ACPI backlight driver fix to avoid using it on "Win8-compatible" systems where it doesn't work and where it was used by default by mistake (Aaron Lu). - Assorted minor ACPI core fixes and cleanups from Tomasz Nowicki, Sudeep Holla, Huang Rui, Hanjun Guo, Fabian Frederick, and Ashwin Chaugule (mostly related to the upcoming ARM64 support). - Intel RAPL (Running Average Power Limit) power capping driver fixes and improvements including new processor IDs (Jacob Pan). - Generic power domains modification to power up domains after attaching devices to them to meet the expectations of device drivers and bus types assuming devices to be accessible at probe time (Ulf Hansson). - Preliminary support for controlling device clocks from the generic power domains core code and modifications of the ARM/shmobile platform to use that feature (Ulf Hansson). - Assorted minor fixes and cleanups of the generic power domains core code (Ulf Hansson, Geert Uytterhoeven). - Assorted minor fixes and cleanups of the device clocks control code in the PM core (Geert Uytterhoeven, Grygorii Strashko). - Consolidation of device power management Kconfig options by making CONFIG_PM_SLEEP select CONFIG_PM_RUNTIME and removing the latter which is now redundant (Rafael J Wysocki and Kevin Hilman). That is the first batch of the changes needed for this purpose. - Core device runtime power management support code cleanup related to the execution of callbacks (Andrzej Hajda). - cpuidle ARM support improvements (Lorenzo Pieralisi). - cpuidle cleanup related to the CPUIDLE_FLAG_TIME_VALID flag and a new MAINTAINERS entry for ARM Exynos cpuidle (Daniel Lezcano and Bartlomiej Zolnierkiewicz). - New cpufreq driver callback (->ready) to be executed when the cpufreq core is ready to use a given policy object and cpufreq-dt driver modification to use that callback for cooling device registration (Viresh Kumar). - cpufreq core fixes and cleanups (Viresh Kumar, Vince Hsu, James Geboski, Tomeu Vizoso). - Assorted fixes and cleanups in the cpufreq-pcc, intel_pstate, cpufreq-dt, pxa2xx cpufreq drivers (Lenny Szubowicz, Ethan Zhao, Stefan Wahren, Petr Cvek). - OPP (Operating Performance Points) framework modification to allow OPPs to be removed too and update of a few cpufreq drivers (cpufreq-dt, exynos5440, imx6q, cpufreq) to remove OPPs (added during initialization) on driver removal (Viresh Kumar). - Hibernation core fixes and cleanups (Tina Ruchandani and Markus Elfring). - PM Kconfig fix related to CPU power management (Pankaj Dubey). - cpupower tool fix (Prarit Bhargava)" * tag 'pm+acpi-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (120 commits) i2c-omap / PM: Drop CONFIG_PM_RUNTIME from i2c-omap.c dmaengine / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM tools: cpupower: fix return checks for sysfs_get_idlestate_count() drivers: sh / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM e1000e / igb / PM: Eliminate CONFIG_PM_RUNTIME MMC / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM MFD / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM misc / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM media / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM input / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM leds: leds-gpio: Fix multiple instances registration without 'label' property iio / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM hsi / OMAP / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM i2c-hid / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM drm / exynos / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM gpio / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM hwrandom / exynos / PM: Use CONFIG_PM in #ifdef block / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM USB / PM: Drop CONFIG_PM_RUNTIME from the USB core PM: Merge the SET*_RUNTIME_PM_OPS() macros ...
2014-11-26ACPI / PMIC: support PMIC operation region for XPower AXP288Aaron Lu
The Baytrail-T-CR platform firmware has defined two customized operation regions for PMIC chip Dollar Cove XPower - one is for power resource handling and one is for thermal just like the CrystalCove one. This patch adds support for them on top of the common PMIC opregion region code. Signed-off-by: Aaron Lu <aaron.lu@intel.com> Acked-by: Lee Jones <lee.jones@linaro.org> for the MFD part Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-11-25mfd: axp20x: Constify axp20x_acpi_match and rid unused warningLee Jones
axp20x.c:239:30: warning: ‘axp20x_acpi_match’ defined but not used [-Wunused-variable] Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-11-25Merge branches 'ib-mfd-gpio-i2c-3.19', 'ib-mfd-iio-3.19' and ↵Lee Jones
'ib-mfd-regulator-v3.19', tag 'ib-mfd-regulator-clk-v3.19' into ibs-for-mfd-merged Immutable branch between MFD, Regulator and Clk, due for v3.19
2014-11-25Merge branch 'ib-mfd-iio-3.19' of ↵Rafael J. Wysocki
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into acpi-pmic Pull MFD changes that the ACPI PMIC changes depend on from Lee Jones.
2014-11-18mfd/axp20x: avoid irq numbering collisionJacob Pan
IRQ numbers in axp20x devices are defined with high-order bit first in each IRQ enable/status registers. On Intel platforms it is more common to number IRQs with least significant bit first. Therefore, sharing IRQ# between the two is very difficult. Since AXP288 is a customized PMIC for Intel platform and the amount of shared IRQs are very small, we use separate IRQ numbering. This also fixes collision and a duplicate in WBTO interrupt. e.g. For the 16 interrupts controlled in IRQ enabled registers 1 & 2, on axp20x for ARM, the PMIC local IRQ numbers and register bits are mapped as: IRQ#: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 --------------------------------------------------------- ARM: 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Intel: 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 Signed-off-by: Todd Brandt <todd.e.brandt@linux.intel.com> Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-10-07mfd: axp20x: Extend axp20x to support axp288 pmicJacob Pan
X-Powers AXP288 is a customized PMIC for Intel Baytrail-CR platforms. Similar to AXP202/209, AXP288 comes with USB charger, more LDO and BUCK channels, and AD converters. It also provides extended status and interrupt reporting capabilities than the devices currently supported in axp20x.c. In addition to feature extension, this patch also adds ACPI binding for enumeration. This consolidated driver should support more X-Powers' PMICs in both device tree and ACPI enumerated platforms. Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com> Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26mfd: axp209x: Drop the parent supplies fieldMaxime Ripard
Now that the regulator code get its parent supplies purely from the DT, we can drop the parent supplies resources in the MFD driver. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>