Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1539270

[PATCH v2 06/11] mfd: axp20x: add separate MFD cell for AXP223

From Quentin Schulz <quentin.schulz@free-electrons.com>
Newsgroups linux.kernel
Subject [PATCH v2 06/11] mfd: axp20x: add separate MFD cell for AXP223
Date 2016-12-09 12:10 +0100
Message-ID <sMrdT-2wK-9@gated-at.bofh.it> (permalink)
References <sMrdT-2wK-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---

v2:
 - correct indentation,
 - renaming axp22x_cells to axp221_cells to avoid confusion between axp22x,
axp221 and axp223

 drivers/mfd/axp20x.c | 28 ++++++++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index 6ee2cc6..b31f123 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -591,7 +591,22 @@ static struct mfd_cell axp20x_cells[] = {
 	},
 };
 
-static struct mfd_cell axp22x_cells[] = {
+static struct mfd_cell axp221_cells[] = {
+	{
+		.name		= "axp20x-pek",
+		.num_resources	= ARRAY_SIZE(axp22x_pek_resources),
+		.resources	= axp22x_pek_resources,
+	}, {
+		.name		= "axp20x-regulator",
+	}, {
+		.name		= "axp20x-usb-power-supply",
+		.of_compatible	= "x-powers,axp221-usb-power-supply",
+		.num_resources	= ARRAY_SIZE(axp22x_usb_power_supply_resources),
+		.resources	= axp22x_usb_power_supply_resources,
+	},
+};
+
+static struct mfd_cell axp223_cells[] = {
 	{
 		.name			= "axp20x-pek",
 		.num_resources		= ARRAY_SIZE(axp22x_pek_resources),
@@ -600,7 +615,7 @@ static struct mfd_cell axp22x_cells[] = {
 		.name			= "axp20x-regulator",
 	}, {
 		.name		= "axp20x-usb-power-supply",
-		.of_compatible	= "x-powers,axp221-usb-power-supply",
+		.of_compatible	= "x-powers,axp223-usb-power-supply",
 		.num_resources	= ARRAY_SIZE(axp22x_usb_power_supply_resources),
 		.resources	= axp22x_usb_power_supply_resources,
 	},
@@ -793,9 +808,14 @@ int axp20x_match_device(struct axp20x_dev *axp20x)
 		axp20x->regmap_irq_chip = &axp20x_regmap_irq_chip;
 		break;
 	case AXP221_ID:
+		axp20x->nr_cells = ARRAY_SIZE(axp221_cells);
+		axp20x->cells = axp221_cells;
+		axp20x->regmap_cfg = &axp22x_regmap_config;
+		axp20x->regmap_irq_chip = &axp22x_regmap_irq_chip;
+		break;
 	case AXP223_ID:
-		axp20x->nr_cells = ARRAY_SIZE(axp22x_cells);
-		axp20x->cells = axp22x_cells;
+		axp20x->nr_cells = ARRAY_SIZE(axp223_cells);
+		axp20x->cells = axp223_cells;
 		axp20x->regmap_cfg = &axp22x_regmap_config;
 		axp20x->regmap_irq_chip = &axp22x_regmap_irq_chip;
 		break;
-- 
2.9.3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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