Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1539274
| From | Quentin Schulz <quentin.schulz@free-electrons.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 05/11] power: supply: axp20x_usb_power: add 100mA max current limit for AXP223 |
| Date | 2016-12-09 12:10 +0100 |
| Message-ID | <sMrdT-2wK-37@gated-at.bofh.it> (permalink) |
| References | <sMrdT-2wK-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
The X-Powers AXP223 shares most of its behaviour with the AXP221 PMIC
but allows the VBUS power supply max current to be set to 100mA (like
the AXP209 PMIC).
This basically adds a new compatible to the VBUS power supply driver and
adds a check on the compatible when setting current max limit.
Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
---
drivers/power/supply/axp20x_usb_power.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_power.c
index 9e3f4ae..1bcb025 100644
--- a/drivers/power/supply/axp20x_usb_power.c
+++ b/drivers/power/supply/axp20x_usb_power.c
@@ -90,11 +90,10 @@ static int axp20x_usb_power_get_property(struct power_supply *psy,
switch (v & AXP20X_VBUS_CLIMIT_MASK) {
case AXP20X_VBUC_CLIMIT_100mA:
- if (power->axp20x_id == AXP202_ID) {
- val->intval = 100000;
- } else {
+ if (power->axp20x_id == AXP221_ID)
val->intval = -1; /* No 100mA limit */
- }
+ else
+ val->intval = 100000;
break;
case AXP20X_VBUC_CLIMIT_500mA:
val->intval = 500000;
@@ -317,7 +316,8 @@ static int axp20x_usb_power_probe(struct platform_device *pdev)
usb_power_desc = &axp20x_usb_power_desc;
irq_names = axp20x_irq_names;
- } else if (power->axp20x_id == AXP221_ID) {
+ } else if (power->axp20x_id == AXP221_ID ||
+ power->axp20x_id == AXP223_ID) {
usb_power_desc = &axp22x_usb_power_desc;
irq_names = axp22x_irq_names;
} else {
@@ -360,6 +360,9 @@ static const struct of_device_id axp20x_usb_power_match[] = {
}, {
.compatible = "x-powers,axp221-usb-power-supply",
.data = (void *)AXP221_ID,
+ }, {
+ .compatible = "x-powers,axp223-usb-power-supply",
+ .data = (void *)AXP223_ID,
}, { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, axp20x_usb_power_match);
--
2.9.3
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 00/11] add support for VBUS max current and min voltage limits AXP20X and AXP22X PMICs Quentin Schulz <quentin.schulz@free-electrons.com> - 2016-12-09 12:10 +0100 [PATCH v2 06/11] mfd: axp20x: add separate MFD cell for AXP223 Quentin Schulz <quentin.schulz@free-electrons.com> - 2016-12-09 12:10 +0100 [PATCH v2 03/11] power: supply: axp20x_usb_power: set min voltage and max current from sysfs Quentin Schulz <quentin.schulz@free-electrons.com> - 2016-12-09 12:10 +0100 [PATCH v2 04/11] Documentation: DT: binding: axp20x_usb_power: add axp223 compatible Quentin Schulz <quentin.schulz@free-electrons.com> - 2016-12-09 12:10 +0100 [PATCH v2 05/11] power: supply: axp20x_usb_power: add 100mA max current limit for AXP223 Quentin Schulz <quentin.schulz@free-electrons.com> - 2016-12-09 12:10 +0100 [PATCH v2 10/11] ARM: dts: sun8i-r16-parrot: use AXP223 DTSI Quentin Schulz <quentin.schulz@free-electrons.com> - 2016-12-09 12:10 +0100 [PATCH v2 08/11] ARM: dts: sun8i-a33-olinuxino: use AXP223 DTSI Quentin Schulz <quentin.schulz@free-electrons.com> - 2016-12-09 12:10 +0100 [PATCH v2 11/11] ARM: dtsi: sun8i-reference-design-tablet: use AXP223 DTSI Quentin Schulz <quentin.schulz@free-electrons.com> - 2016-12-09 12:10 +0100 [PATCH v2 01/11] power: supply: axp20x_usb_power: use of_device_id data field instead of device_is_compatible Quentin Schulz <quentin.schulz@free-electrons.com> - 2016-12-09 12:10 +0100 [PATCH v2 07/11] ARM: dtsi: add DTSI for AXP223 Quentin Schulz <quentin.schulz@free-electrons.com> - 2016-12-09 12:10 +0100
csiph-web