The driver core ignores the return value of struct device_driver::remove
because there is only little that can be done. To simplify the quest to
make this function return void, let struct sunxi_rsb_driver::remove
return void, too. All users already unconditionally return 0, this
commit makes this obvious and ensures future users don't behave
differently. To simplify even further, make axp20x_device_remove()
return void instead of returning 0 unconditionally, too.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
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 <tglx@linutronix.de>
Reviewed-by: Enrico Weigelt <info@metux.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* New core support
- battery internal resistance
- battery OCV capacity lookup table
- support for custom sysfs attributes
* Convert all drivers to use power-supply core support for custom sysfs attributes
* bq24190-charger: bq24196 support
* axp20x-charger: AXP813 support
* sc27xx-battery: new fuel gauge driver
* gpio-poweroff: support for specific active and inactive delays
* Misc fixes
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAlwlThQACgkQ2O7X88g7
+pqmHg/+PPPeJVIfAAdxFe4KPvP/sAUnAGxqgJc7yeaKOq03eIWnm0JFbEsQLazM
XDyk+8N7PQ254n2hU/DQln/OKrkVMo/QaOsn3HbbxaDbUiM5Mj8WjKOzgjWtgUy0
OZOEk6n4SQNx6Ib7Wp/e+H6b/K+EglO5CVZDXmTBJfFKiKp5g4A3ZaUe8bCa1xuG
4AB3QWQPomtI8o/nD37c4lpegojabUGN8hHI6r9TFT1PaYEzAmOQsb0NnGqEKAUw
ECPBeH4jVoLN9Bie4u5Fgdr0lqukG+EAEHlHhPRea92oDLFfXEjPOI9JDM4XWBg/
P47KNuvsVrIAUQ3rnCHUP4aC2ElL0G9bcEyADiLOuw9FIjMMjBm65pyRDORwkH+L
TAu/28fL2Rzwenk+N8OLZ5lpvYlrqpDFISJkwO7gSGq4wyNW8I62GXJPFAYuSZsf
dvlEOTgUCwNUnnF2ehx1AkvOBE+eh1CHvtcbKUMLwtBgWOhVi664Gm2znaLy6PwN
XPkcRCNFIr/FZRuAo1x9GyxYv483Nk+27LcKfwz+HtmHHMRRDHDWtJ/K0KqK/y7a
7HE7tBhCMpWikIXT1pAz7A0XYlMqfaMsyHlOqmeFgsNUBuDvJAArDz3Gff935PL3
KGIr4lp+YeTHv6nJT/EMtGIG2dsJZUHh/NAtWZ07usI2fOgE3J4=
=59iw
-----END PGP SIGNATURE-----
Merge tag 'for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply
Pull power supply and reset updates from Sebastian Reichel:
- New core support:
- battery internal resistance
- battery OCV capacity lookup table
- support for custom sysfs attributes
- Convert all drivers to use power-supply core support for custom sysfs
attributes
- bq24190-charger: bq24196 support
- axp20x-charger: AXP813 support
- sc27xx-battery: new fuel gauge driver
- gpio-poweroff: support for specific active and inactive delays
- Misc fixes
* tag 'for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (53 commits)
power: supply: bq25890: fix BAT_COMP field definition
power: supply: gpio-charger: Do not use deprecated POWER_SUPPLY_TYPE_USB_*
power: supply: ds2781: switch to devm_power_supply_register
power: supply: ds2780: switch to devm_power_supply_register
power: supply: ds2781: fix race-condition in bin attribute registration
power: supply: ds2780: fix race-condition in bin attribute registration
power: supply: pcf50633: fix race-condition in sysfs registration
power: supply: charger-manager: fix race-condition in sysfs registration
power: supply: charger-manager: simplify generation of sysfs attribute group name
power: supply: bq24257: fix race-condition in sysfs registration
power: supply: bq24190_charger: fix race-condition in sysfs registration
power: supply: lp8788: fix race-condition in sysfs registration
power: supply: ds2781: fix race-condition in sysfs registration
power: supply: ds2780: fix race-condition in sysfs registration
power: supply: bq2415x: fix race-condition in sysfs registration
power: supply: core: add support for custom sysfs attributes
power: supply: sc27xx: Save last battery capacity
power: reset: at91-poweroff: move shdwc related data to one structure
power: supply: sc27xx: Add suspend/resume interfaces
power: supply: sc27xx: Add fuel gauge low voltage alarm
...
The current axp20x names the ramping register 'scal' which probably
means scaling. Since the register really has nothing to do with
scaling, but really is the voltage ramp we rename it appropriately.
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Priit Laes <plaes@plaes.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
AXP813 and AXP803 PMICs can control input current and minimum voltage.
Both of these values are configurable.
Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
Reviewed-by: Quentin Schulz <quentin.schulz@bootlin.com>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
When AXP806 support was added, POK was incorrectly expanded to PWROK.
However, the datasheet lists them as POK[LSNP], which is the same as
on the AXP288. Furthermore, the registers associated with POK functions
are the same as the PEK on the other AXP PMICs. This suggests that
"POK" means "Power On Key", much like "PEK" means "Power Enable Key",
instead of "Power OK".
This patch changes the "PWROK" prefix to "POK" for these interrupts.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
The axp20x driver has lots of mfd_cell and resource structs.
These can all be const-ified.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Outside of IIO
* Strongly typed 64bit int_sqrt function needed by the mlx90632
New device support
* adc081s
- New driver supporting adc081s, adc101s and adc121s TI ADCs.
* ad5272
- New driver supproting the ad5272 and ad5274 ADI digital potentiometers
with DT bindings.
* axp20x_adc
- support the AXP813 ADC - includes rework patches to prepare for this.
* mlx90632
- New driver with dt bindings for this IR temperature sensor.
Features
* axp20x_adc
- Add DT bindings and probing.
* dht11
- The sensor has a wider range than advertised in the datasheet - support it.
* st_lsm6dsx
- Add hardware timestamp su9pport.
Cleanups
* ABI docs
- Update email contact for Matt Ranostay
* SPDX changes
- Matt Ranostay has moved his drivers over to SPDX. Currently we are making
this an author choice in IIO.
* ad7192
- Disable burnout current on misconfiguration. No actually effect as
they simply won't work otherwise.
* ad7476
- Drop a license definition that was replicating information in SPDX tag.
* ade7758
- Expand buf_lock to cover both buffer and state protection allowing
unintented uses of mlock in the core to be removed.
* ade7759
- Align parameters to opening parenthesis.
* at91_adc
- Depend on sysfs instead of selecting it - for try wide consistency.
* ccs811
- trivial naming type for a define.
* ep93xx
- Drop a redundant return as a result checking platform_get_resource.
* hts221
- Regmap conversion which simplifies the driver somewhat.
- Clean up some restricted endian cast warnings.
- Drop a trailing whitespace from a comment
- Drop an unnecessary get_unaligned by changing to the right 16bit data type.
* ms5611
- Fix coding style in the probe function (whitespace)
* st_accel
- Use strlcpy instead of strncpy to avoid potentially truncating a string.
-----BEGIN PGP SIGNATURE-----
iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAlqL3RIRHGppYzIzQGtl
cm5lbC5vcmcACgkQVIU0mcT0Foiq7w//eKBOgTy0osSkLjSXACsJ0oizUoEGDV3t
NxQ3D3el+1ATUd2tJL33gDvCzYw5DPcNcy3Hh/tl5svnwdV0WvBwIDIgdPfPBJQu
LpBjT6bI2MwYdi1WLHZJBeoIXxg0PMF4GNZ2DIk0GL0WJg87n6SkZCmslW8Rv8BD
NE8m9Qv72vhhZ9QjcBPoQYzRAY16moaX+9a36TBgtgGs7c5vHYNGNxoMn6sZ3sQk
VbUtqWv9By3gp0mUg7T2Qb+62d04MbDk3Sa/K2B0COBOCSP7kWjg9h7KP902R6rU
WNsTK+rVRHxV5Jm6PBPcit4HeSK3/9308EKkv2axQrPqCLM50GoxoqAhNq7UpAEu
YXLi4f0te7sEQdt2QFDCdDMk1HjI3eCA7a8enBpex3gt7bdGTMQH9qDKdsWE+z4G
Gm9xbZn+z7wNfowf5wAE16Y+yUS4UvVXawWD8FSIpKi3HvvyYS1I0nTnzvTvS/C3
EhubRf+nguYsFjHB+LpA3II6b/NlrkKGO8PDzCr3kvfPUVErTWPgVzx6+5vPG2Gd
6qhoFVanV7SuHD0lSq9tKQfsh0DFjAh6DQYdLpoFaxgIJi6cLCGbwOMY49ihYfSO
mTMz5c52mJACOpq7W5e9xzvLwx6pxiQobeun3fq7kDdq5vUweKSGK4iggEZ+sr2N
luFxzN7VLNA=
=CH1K
-----END PGP SIGNATURE-----
Merge tag 'iio-for-4.17a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
First round of new devices, features and cleanups for IIO in the 4.17 cycle.
Outside of IIO
* Strongly typed 64bit int_sqrt function needed by the mlx90632
New device support
* adc081s
- New driver supporting adc081s, adc101s and adc121s TI ADCs.
* ad5272
- New driver supproting the ad5272 and ad5274 ADI digital potentiometers
with DT bindings.
* axp20x_adc
- support the AXP813 ADC - includes rework patches to prepare for this.
* mlx90632
- New driver with dt bindings for this IR temperature sensor.
Features
* axp20x_adc
- Add DT bindings and probing.
* dht11
- The sensor has a wider range than advertised in the datasheet - support it.
* st_lsm6dsx
- Add hardware timestamp su9pport.
Cleanups
* ABI docs
- Update email contact for Matt Ranostay
* SPDX changes
- Matt Ranostay has moved his drivers over to SPDX. Currently we are making
this an author choice in IIO.
* ad7192
- Disable burnout current on misconfiguration. No actually effect as
they simply won't work otherwise.
* ad7476
- Drop a license definition that was replicating information in SPDX tag.
* ade7758
- Expand buf_lock to cover both buffer and state protection allowing
unintented uses of mlock in the core to be removed.
* ade7759
- Align parameters to opening parenthesis.
* at91_adc
- Depend on sysfs instead of selecting it - for try wide consistency.
* ccs811
- trivial naming type for a define.
* ep93xx
- Drop a redundant return as a result checking platform_get_resource.
* hts221
- Regmap conversion which simplifies the driver somewhat.
- Clean up some restricted endian cast warnings.
- Drop a trailing whitespace from a comment
- Drop an unnecessary get_unaligned by changing to the right 16bit data type.
* ms5611
- Fix coding style in the probe function (whitespace)
* st_accel
- Use strlcpy instead of strncpy to avoid potentially truncating a string.
The X-Powers AXP813 PMIC is really close to what is already done for
AXP20X/AXP22X.
There are two pairs of bits to set the rate (one for Voltage and Current
measurements and one for TS/GPIO0 voltage measurements) instead of one.
The register to set the ADC rates is different from the one for
AXP20X/AXP22X.
GPIO0 can be used as an ADC (measuring Volts) unlike for AXP22X.
The scales to apply to the different inputs are unlike the ones from
AXP20X and AXP22X.
Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This is not used / set anywhere in the tree.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
The AXP813 PMIC has 7 DC-DC buck regulators, 16 LDOs (including the
fixed RTC LDO and 2 GPIO LDOs), and 1 switchable. The drive-vbus
feature is also supported. All the hardware details are very similar
to the AXP803, with the following exceptions:
- Extra DCDC7 buck regulator, with the same range as DCDC6
- SWitch now has a separate supply pin, instead of being chained
internaly from DCDC1
- RTC LDO output voltage is now 1.8V
- FLDO3 is an LDO with switchable supplies, but unconfigurable output
voltage. The voltage is always half that of its supply.
Support for FLDO3 is currently unimplemented, as it requires runtime
switching of its supplies, something the regulator subsystem does not
support. It is not used in either the reference designs nor actually
produced boards available.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Tested-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
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>
AXP803 PMIC also have a series of regulators (DCDCs and LDOs)
controllable via I2C/RSB bus.
Add support for them.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
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>
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>
- Add new !TOUCHSCREEN_SUN4I dependency for SUN4I_GPADC
- List include/dt-bindings/mfd/* to files supported in MAINTAINERS
- New Drivers
- Intel Apollo Lake SPI NOR
- ST STM32 Timers (Advanced, Basic and PWM)
- Motorola 6556002 CPCAP (PMIC)
- New Device Support
- Add support for AXP221 to axp20x
- Add support for Intel Gemini Lake to intel-lpss-pci
- Add support for MT6323 LED to mt6397-core
- Add support for COMe-bBD#, COMe-bSL6, COMe-bKL6,
COMe-cAL6 and COMe-cKL6 to kempld-core
- New Functionality
- Add support for Analog CODAC to sun6i-prcm
- Add support for Watchdog to lpc_ich
- Fix-ups
- Error handling improvements; axp288_charger, axp20x, ab8500-sysctrl
- Adapt platform data handling; axp20x
- IRQ handling improvements; arizona, axp20x
- Remove superfluous code; arizona, axp20x, lpc_ich
- Trivial coding style/spelling fixes; axp20x, abx500, mfd.txt
- Regmap fix-ups; axp20x
- DT changes; mfd.txt, aspeed-lpc, aspeed-gfx, ab8500-core, tps65912, mt6397
- Use new I2C probing mechanism; max77686
- Constification; rk808
- Bug Fixes
- Stop data transfer whilst suspended; cros_ec
-----BEGIN PGP SIGNATURE-----
iQIcBAABCAAGBQJYrYwQAAoJEFGvii+H/HdhVMMP/3Y5/S1y7bCRhsta3PQVHT/2
+nxu833451qTTUKNqR5rTQrjdjVLr6+rfhMmMxIDhHMrn3EvwT0bQDQmncLLYgc2
u5n2j93Y/nfyJvy76W3aTlisBaKfxhFBuLBEkewXNwPaZk97tbgf9IbyNq6eirHo
afv5Z54q9RN+OlT5ZfM8mJcOQAdyE6CXzq/GKZI6LjSqPb5vQhasqoD/yb9pMMga
jYseI47KlIVLhUnnAjxRdxt16rjtee2JHZmGCGJaeo+nWiTwDOZ5l5eZDHKwD6ng
3CW4xWDPbzeLD22oi6Uzvhx+8Eqt9S/K1AY+kn3W6WLk/CTi5yamMHw0DjBUcS9a
hqdqGZrCSveRQrSCt/9N5uzSMkiUHFMGdj5LtX3yB4fDp0R42WJGMxkvidKb7otB
wJIT0i5T5M5G3IT3xPkdEtfEAK3xoAus+IF0faFNaD7GqsEs97KD+740nTgulSKz
g28Lo6NLpZhl+uQ74fx76Wll+Onj1voWABZW8Z//kjRWkAwKU8OhbXrX8kccGY6m
C980wWtj0979jYFstwUuSXspjuvk9L1nfSuLBmtawm9S58TUIS/WLe2A8kU9/XEY
e3PLpO4AxvCJvBBa80yVFG15JoaTX5TOg/F3NqKYaHqA2cusOVOEFAeOAdwav2rL
SR2Y8s8ceIL4n9ccmr0b
=P5Dp
-----END PGP SIGNATURE-----
Merge tag 'mfd-for-linus-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
Pull MFD updates from Lee Jones:
"Core Frameworks:
- Add new !TOUCHSCREEN_SUN4I dependency for SUN4I_GPADC
- List include/dt-bindings/mfd/* to files supported in MAINTAINERS
New Drivers:
- Intel Apollo Lake SPI NOR
- ST STM32 Timers (Advanced, Basic and PWM)
- Motorola 6556002 CPCAP (PMIC)
New Device Support:
- Add support for AXP221 to axp20x
- Add support for Intel Gemini Lake to intel-lpss-pci
- Add support for MT6323 LED to mt6397-core
- Add support for COMe-bBD#, COMe-bSL6, COMe-bKL6, COMe-cAL6 and
COMe-cKL6 to kempld-core
New Functionality:
- Add support for Analog CODAC to sun6i-prcm
- Add support for Watchdog to lpc_ich
Fix-ups:
- Error handling improvements; axp288_charger, axp20x, ab8500-sysctrl
- Adapt platform data handling; axp20x
- IRQ handling improvements; arizona, axp20x
- Remove superfluous code; arizona, axp20x, lpc_ich
- Trivial coding style/spelling fixes; axp20x, abx500, mfd.txt
- Regmap fix-ups; axp20x
- DT changes; mfd.txt, aspeed-lpc, aspeed-gfx, ab8500-core, tps65912,
mt6397
- Use new I2C probing mechanism; max77686
- Constification; rk808
Bug Fixes:
- Stop data transfer whilst suspended; cros_ec"
* tag 'mfd-for-linus-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (43 commits)
mfd: lpc_ich: Enable watchdog on Intel Apollo Lake PCH
mfd: lpc_ich: Remove useless comments in core part
mfd: Add support for several boards to Kontron PLD driver
mfd: constify regmap_irq_chip structures
MAINTAINERS: Add include/dt-bindings/mfd to MFD entry
mfd: cpcap: Add minimal support
mfd: mt6397: Add MT6323 LED support into MT6397 driver
Documentation: devicetree: Add LED subnode binding for MT6323 PMIC
mfd: tps65912: Export OF device ID table as module aliases
mfd: ab8500-core: Rename clock device and compatible
mfd: cros_ec: Send correct suspend/resume event to EC
mfd: max77686: Remove I2C device ID table
mfd: max77686: Use the struct i2c_driver .probe_new instead of .probe
mfd: max77686: Use of_device_get_match_data() helper
mfd: max77686: Don't attempt to get i2c_device_id .data
mfd: ab8500-sysctrl: Handle probe deferral
mfd: intel-lpss: Add Intel Gemini Lake PCI IDs
mfd: axp20x: Fix AXP806 access errors on cold boot
mfd: cros_ec: Send suspend state notification to EC
mfd: cros_ec: Prevent data transfer while device is suspended
...
Add defines for the AXP288_POWER_REASON and AXP288_RT_BATT_V_H and
AXP288_RT_BATT_V_L and AXP288_BC_* registers. While at it also move the
AXP288_TS_ADC_H-AXP288_GP_ADC_L defines, which for some reason where
in a different place, together with the rest of the AXP288 specific
defines.
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>
The adc-enable register for the axp288 is 0x82, not 0x84.
0x82 is already defined as AXP20X_ADC_EN1 and that is what the
axp288_adc driver is actually using, so simply drop the wrong
AXP288_PMIC_ADC_EN define.
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>
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>
The documentation of axp20x_device_remove() have a typo and use
axp20x_device_probe() as name. This patch fix this typo.
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Casting of_device_get_match_data return value to int causes warning on 64bit
architectures.
../drivers/power/supply/axp20x_usb_power.c: In function
'axp20x_usb_power_probe':
../drivers/power/supply/axp20x_usb_power.c:297:21: warning: cast from
pointer to integer of different size [-Wpointer-to-int-cast]
Fixes: 0dcc70ca86 ("power: supply: axp20x_usb_power: use of_device_id
data field instead of device_is_compatible")
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
When the axp288_faul_gauge driver was originally merged, it was
merged with a dependency on some other driver providing platform
data for it.
However the battery-data-framework which should provide that data
never got merged, resulting in x86 tablets / laptops with an axp288
having no working battery monitor, as before this commit the driver
would simply return -ENODEV if there is no platform data.
This commit removes the dependency on the platform_data instead
checking that the firmware has initialized the fuel-gauge and
reading the info back from the pmic.
What is missing from the read-back info is the table to map raw adc
values to temperature, so this commit drops the temperature and
temperature limits properties. The min voltage, charge design and
model name info is also missing. Note that none of these are really
important for userspace to have.
All other functionality is preserved and actually made available
by this commit.
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=88471
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
When the axp288_charger driver was originally merged, it was merged with
a dependency on some other driver providing platform data for it.
However the battery-data-framework which should provide that data never
got merged, so the axp288_charger as merged upstream has never worked,
its probe method simply always returns -ENODEV.
This commit removes the dependency on the platform_data instead reading
back the charging current and charging voltage that the firmware has set
and using those values as the maximum values the user may set.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
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>
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>
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>
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>
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>
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>
This adds a driver for the usb power_supply bits of the axp20x PMICs.
I initially started writing my own driver, before coming aware of
Bruno Prémont's excellent earlier RFC with a driver for this.
My driver was lacking CURRENT_MAX and VOLTAGE_MIN support Bruno's
drvier has, so I've copied the code for those from his driver.
Note that the AC-power-supply and battery charger bits will need separate
drivers. Each one needs its own devictree child-node so that other
devicetree nodes can reference the right power-supply, and thus each one
will get its own mfd-cell / platform_device and platform-driver.
Cc: Bruno Prémont <bonbons@linux-vserver.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
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>
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>
Here's the big char/misc driver pull request for 4.2-rc1.
Lots of mei, extcon, coresight, uio, mic, and other driver updates in
here. Full details in the shortlog. All of these have been in
linux-next for some time with no reported problems.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iEYEABECAAYFAlWNn0gACgkQMUfUDdst+ykCCQCgvdF4F2+Hy9+RATdk22ak1uq1
JDMAoJTf4oyaIEdaiOKfEIWg9MasS42B
=H5wD
-----END PGP SIGNATURE-----
Merge tag 'char-misc-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver updates from Greg KH:
"Here's the big char/misc driver pull request for 4.2-rc1.
Lots of mei, extcon, coresight, uio, mic, and other driver updates in
here. Full details in the shortlog. All of these have been in
linux-next for some time with no reported problems"
* tag 'char-misc-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (176 commits)
mei: me: wait for power gating exit confirmation
mei: reset flow control on the last client disconnection
MAINTAINERS: mei: add mei_cl_bus.h to maintained file list
misc: sram: sort and clean up included headers
misc: sram: move reserved block logic out of probe function
misc: sram: add private struct device and virt_base members
misc: sram: report correct SRAM pool size
misc: sram: bump error message level on unclean driver unbinding
misc: sram: fix device node reference leak on error
misc: sram: fix enabled clock leak on error path
misc: mic: Fix reported static checker warning
misc: mic: Fix randconfig build error by including errno.h
uio: pruss: Drop depends on ARCH_DAVINCI_DA850 from config
uio: pruss: Add CONFIG_HAS_IOMEM dependence
uio: pruss: Include <linux/sizes.h>
extcon: Redefine the unique id of supported external connectors without 'enum extcon' type
char:xilinx_hwicap:buffer_icap - change 1/0 to true/false for bool type variable in function buffer_icap_set_configuration().
Drivers: hv: vmbus: Allocate ring buffer memory in NUMA aware fashion
parport: check exclusive access before register
w1: use correct lock on error in w1_seq_show()
...
This patch adds new power supply charger driver support
for X-Power AXP288 PMIC integrated charger.
This driver interfaces with the axp20x mfd driver as a cell
and listens to extcon cable events for setting up charging.
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
This patch adds the extcon support for AXP288 PMIC which
has the BC1.2 charger detection capability. Additionally
it also adds the USB mux switching support b/w SOC and PMIC
based on GPIO control.
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
[cw00.choi: Modify the log message to keep the consistent log message pattern]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
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>
mfd/axp20x: add support for fuel gauge cell
Register definitions and platform data structure
for fuel gauge cell devices.
Signed-off-by: Todd Brandt <todd.e.brandt@intel.com>
Acked-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
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>
This patch introduces the preliminary support for PMICs X-Powers AXP202
and AXP209. The AXP209 and AXP202 are the PMUs (Power Management Unit)
used by A10, A13 and A20 SoCs and developed by X-Powers, a sister company
of Allwinner.
The core enables support for two subsystems:
- PEK (Power Enable Key)
- Regulators
Signed-off-by: Carlo Caione <carlo@caione.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>