From: Lee Jones <lee@kernel.org>
To: Chris Morgan <macroalpha82@gmail.com>
Cc: linux-sunxi@lists.linux.dev, linux-pm@vger.kernel.org,
devicetree@vger.kernel.org, linux-iio@vger.kernel.org,
broonie@kernel.org, samuel@sholland.org,
jernej.skrabec@gmail.com, sre@kernel.org, wens@csie.org,
conor+dt@kernel.org, krzk+dt@kernel.org, robh@kernel.org,
lars@metafoo.de, Chris Morgan <macromorgan@hotmail.com>
Subject: Re: [PATCH 4/8] mfd: axp20x: Add ADC, BAT, and USB cells for AXP717
Date: Thu, 20 Jun 2024 18:25:59 +0100 [thread overview]
Message-ID: <20240620172559.GZ3029315@google.com> (raw)
In-Reply-To: <20240617220535.359021-5-macroalpha82@gmail.com>
On Mon, 17 Jun 2024, Chris Morgan wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
>
> Add support for the AXP717 PMIC to utilize the ADC (for reading
> voltage, current, and temperature information from the PMIC) as well
> as the USB charger and battery.
>
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> ---
> drivers/mfd/axp20x.c | 30 +++++++++++++++++++++++++---
> drivers/regulator/axp20x-regulator.c | 2 +-
> include/linux/mfd/axp20x.h | 26 +++++++++++++++++++++++-
> 3 files changed, 53 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
> index 609e7e149681..07db4a11acbc 100644
> --- a/drivers/mfd/axp20x.c
> +++ b/drivers/mfd/axp20x.c
> @@ -209,15 +209,23 @@ static const struct regmap_access_table axp313a_volatile_table = {
> };
>
> static const struct regmap_range axp717_writeable_ranges[] = {
> - regmap_reg_range(AXP717_MODULE_EN_CONTROL, AXP717_MODULE_EN_CONTROL),
> - regmap_reg_range(AXP717_BOOST_CONTROL, AXP717_BOOST_CONTROL),
> + regmap_reg_range(AXP717_PMU_FAULT, AXP717_MODULE_EN_CONTROL_1),
> + regmap_reg_range(AXP717_MIN_SYS_V_CONTROL, AXP717_BOOST_CONTROL),
> + regmap_reg_range(AXP717_VSYS_V_POWEROFF, AXP717_VSYS_V_POWEROFF),
> regmap_reg_range(AXP717_IRQ0_EN, AXP717_IRQ4_EN),
> regmap_reg_range(AXP717_IRQ0_STATE, AXP717_IRQ4_STATE),
> + regmap_reg_range(AXP717_ICC_CHG_SET, AXP717_CV_CHG_SET),
> regmap_reg_range(AXP717_DCDC_OUTPUT_CONTROL, AXP717_CPUSLDO_CONTROL),
> + regmap_reg_range(AXP717_ADC_CH_EN_CONTROL, AXP717_ADC_CH_EN_CONTROL),
> + regmap_reg_range(AXP717_ADC_DATA_SEL, AXP717_ADC_DATA_SEL),
> };
>
> static const struct regmap_range axp717_volatile_ranges[] = {
> + regmap_reg_range(AXP717_ON_INDICATE, AXP717_PMU_FAULT),
> regmap_reg_range(AXP717_IRQ0_STATE, AXP717_IRQ4_STATE),
> + regmap_reg_range(AXP717_BATT_PERCENT_DATA, AXP717_BATT_PERCENT_DATA),
> + regmap_reg_range(AXP717_BATT_V_H, AXP717_BATT_CHRG_I_L),
> + regmap_reg_range(AXP717_ADC_DATA_H, AXP717_ADC_DATA_L),
> };
>
> static const struct regmap_access_table axp717_writeable_table = {
> @@ -310,6 +318,11 @@ static const struct resource axp22x_usb_power_supply_resources[] = {
> DEFINE_RES_IRQ_NAMED(AXP22X_IRQ_VBUS_REMOVAL, "VBUS_REMOVAL"),
> };
>
> +static const struct resource axp717_usb_power_supply_resources[] = {
> + DEFINE_RES_IRQ_NAMED(AXP717_IRQ_VBUS_PLUGIN, "VBUS_PLUGIN"),
> + DEFINE_RES_IRQ_NAMED(AXP717_IRQ_VBUS_REMOVAL, "VBUS_REMOVAL"),
> +};
> +
> /* AXP803 and AXP813/AXP818 share the same interrupts */
> static const struct resource axp803_usb_power_supply_resources[] = {
> DEFINE_RES_IRQ_NAMED(AXP803_IRQ_VBUS_PLUGIN, "VBUS_PLUGIN"),
> @@ -424,7 +437,7 @@ static const struct regmap_config axp717_regmap_config = {
> .val_bits = 8,
> .wr_table = &axp717_writeable_table,
> .volatile_table = &axp717_volatile_table,
> - .max_register = AXP717_CPUSLDO_CONTROL,
> + .max_register = AXP717_ADC_DATA_L,
> .cache_type = REGCACHE_MAPLE,
> };
>
> @@ -1026,6 +1039,17 @@ static struct mfd_cell axp313a_cells[] = {
> static struct mfd_cell axp717_cells[] = {
> MFD_CELL_NAME("axp20x-regulator"),
> MFD_CELL_RES("axp20x-pek", axp717_pek_resources),
> + {
> + .name = "axp717-adc",
> + .of_compatible = "x-powers,axp717-adc",
> + },
> + MFD_CELL_OF("axp20x-usb-power-supply",
> + axp717_usb_power_supply_resources, NULL, 0, 0,
> + "x-powers,axp717-usb-power-supply"),
> + {
> + .name = "axp20x-battery-power-supply",
> + .of_compatible = "x-powers,axp717-battery-power-supply",
> + },
> };
Please refrain from mixing and matching:
MFD_CELL_OF() for both.
--
Lee Jones [李琼斯]
next prev parent reply other threads:[~2024-06-20 17:26 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-17 22:05 [PATCH 0/8] Add Battery and USB Supply for AXP717 Chris Morgan
2024-06-17 22:05 ` [PATCH 1/8] dt-bindings: iio: adc: Add AXP717 compatible Chris Morgan
2024-06-18 6:41 ` Krzysztof Kozlowski
2024-06-23 5:17 ` Chen-Yu Tsai
2024-06-17 22:05 ` [PATCH 2/8] power: supply: axp20x_usb_power: Add support for AXP717 Chris Morgan
2024-06-18 6:40 ` Krzysztof Kozlowski
2024-06-23 5:02 ` Chen-Yu Tsai
2024-06-17 22:05 ` [PATCH 3/8] power: supply: axp20x_battery: add " Chris Morgan
2024-06-18 6:41 ` Krzysztof Kozlowski
2024-06-23 5:05 ` Chen-Yu Tsai
2024-06-17 22:05 ` [PATCH 4/8] mfd: axp20x: Add ADC, BAT, and USB cells " Chris Morgan
2024-06-20 17:25 ` Lee Jones [this message]
2024-06-23 5:55 ` Chen-Yu Tsai
2024-06-17 22:05 ` [PATCH 5/8] iio: adc: axp20x_adc: add support for AXP717 ADC Chris Morgan
2024-06-23 5:27 ` Chen-Yu Tsai
2024-07-30 19:11 ` Chris Morgan
2024-06-23 16:30 ` Jonathan Cameron
2024-06-17 22:05 ` [PATCH 6/8] power: supply: axp20x_usb_power: Add support for AXP717 Chris Morgan
2024-06-22 23:49 ` Ryan Walklin
2024-06-23 5:42 ` Chen-Yu Tsai
2024-07-30 19:14 ` Chris Morgan
2024-06-24 18:00 ` Philippe Simons
2024-06-17 22:05 ` [PATCH 7/8] power: supply: axp20x_battery: add " Chris Morgan
2024-06-22 23:51 ` Ryan Walklin
2024-06-23 6:19 ` Chen-Yu Tsai
2024-07-30 19:38 ` Chris Morgan
2024-06-24 17:56 ` Philippe Simons
2024-06-17 22:05 ` [PATCH 8/8] arm64: dts: allwinner: h700: Add charger for Anbernic RG35XX Chris Morgan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240620172559.GZ3029315@google.com \
--to=lee@kernel.org \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jernej.skrabec@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=macroalpha82@gmail.com \
--cc=macromorgan@hotmail.com \
--cc=robh@kernel.org \
--cc=samuel@sholland.org \
--cc=sre@kernel.org \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.