devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Jerome Neanne <jneanne@baylibre.com>
Cc: lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org,
	nm@ti.com, kristo@kernel.org, khilman@baylibre.com,
	narmstrong@baylibre.com, msp@baylibre.com, j-keerthy@ti.com,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, Lee Jones <lee@kernel.org>
Subject: Re: [PATCH v2 08/11] mfd: tps65219: Add power-button support
Date: Mon, 8 Aug 2022 17:05:25 +0100	[thread overview]
Message-ID: <YvE0RclZipE+PyRn@google.com> (raw)
In-Reply-To: <20220726103355.17684-9-jneanne@baylibre.com>

On Tue, 26 Jul 2022, Jerome Neanne wrote:

> From: Markus Schneider-Pargmann <msp@baylibre.com>
> 
> Using a power-button on the EN/PB/VSENSE pin of TPS65219 is optional, so
> this driver adds the mfd cell for tps65219-pwrbutton only if needed. Two
> interrupts are passed to the driver.

Power button support was already added in the previous patch.

> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
> Signed-off-by: Jerome Neanne <jneanne@baylibre.com>
> ---
>  drivers/mfd/tps65219.c | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mfd/tps65219.c b/drivers/mfd/tps65219.c
> index 7366f251c21d..e1c30a49bf08 100644
> --- a/drivers/mfd/tps65219.c
> +++ b/drivers/mfd/tps65219.c
> @@ -335,7 +335,10 @@ static int tps65219_probe(struct i2c_client *client,
>  	struct tps65219 *tps;
>  	int ret;
>  	unsigned int chipid;
> +	bool pwr_button;
>  	bool sys_pwr;
> +	struct mfd_cell cells[TPS65219_MAX_CELLS];
> +	int nr_cells = 0;
>  
>  	tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL);
>  	if (!tps)
> @@ -364,9 +367,16 @@ static int tps65219_probe(struct i2c_client *client,
>  		return ret;
>  	}
>  
> -	ret = devm_mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO, tps65219_cells,
> -				   ARRAY_SIZE(tps65219_cells), NULL, 0,
> -				   NULL);
> +	memcpy(&cells[nr_cells++], &tps65219_regulator_cell,
> +	       sizeof(tps65219_regulator_cell));
> +	pwr_button = of_property_read_bool(tps->dev->of_node, "power-button");
> +	if (pwr_button)
> +		memcpy(&cells[nr_cells++], &tps65219_pwrbutton_cell,
> +		       sizeof(tps65219_pwrbutton_cell));

Gross, no way.

Please call devm_mfd_add_devices() twice.

> +	ret = devm_mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO, cells,
> +				   nr_cells, NULL, 0,
> +				   regmap_irq_get_domain(tps->irq_data));
>  	if (ret) {
>  		dev_err(tps->dev, "mfd_add_devices failed: %d\n", ret);
>  		return ret;

-- 
DEPRECATED: Please use lee@kernel.org

  reply	other threads:[~2022-08-08 16:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 10:33 [PATCH v2 00/11] Add support for TI TPS65219 PMIC Jerome Neanne
2022-07-26 10:33 ` [PATCH v2 01/11] DONOTMERGE: arm64: dts: ti: Add TI TPS65219 PMIC support for AM642 SK board Jerome Neanne
2022-07-26 10:33 ` [PATCH v2 02/11] DONOTMERGE: arm64: dts: ti: Add pinmux and irq mapping for TPS65219 external interrupts Jerome Neanne
2022-07-26 10:33 ` [PATCH v2 03/11] DONOTMERGE: arm64: dts: ti: k3-am642-sk: Enable tps65219 power-button Jerome Neanne
2022-07-26 10:33 ` [PATCH v2 04/11] MAINTAINERS: OMAP2+ support, add tps65218-pwrbutton Jerome Neanne
2022-07-26 14:30   ` Markus Schneider-Pargmann
2022-07-26 10:33 ` [PATCH v2 05/11] regulator: dt-bindings: Add TI TPS65219 PMIC bindings Jerome Neanne
2022-07-26 12:56   ` Markus Schneider-Pargmann
2022-07-26 10:33 ` [PATCH v2 06/11] mfd: drivers: Add TI TPS65219 PMIC support Jerome Neanne
2022-08-08 15:49   ` Lee Jones
2022-08-25  9:17     ` Markus Schneider-Pargmann
2022-07-26 10:33 ` [PATCH v2 07/11] mfd: drivers: Add interrupts support to TI TPS65219 PMIC Jerome Neanne
2022-08-08 15:57   ` Lee Jones
2022-07-26 10:33 ` [PATCH v2 08/11] mfd: tps65219: Add power-button support Jerome Neanne
2022-08-08 16:05   ` Lee Jones [this message]
2022-07-26 10:33 ` [PATCH v2 09/11] regulator: drivers: Add TI TPS65219 PMIC regulators support Jerome Neanne
2022-07-26 10:33 ` [PATCH v2 10/11] Input: Add tps65219 interrupt driven powerbutton Jerome Neanne
2022-07-26 10:33 ` [PATCH v2 11/11] arm64: defconfig: Add tps65219 as modules Jerome Neanne

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=YvE0RclZipE+PyRn@google.com \
    --to=lee.jones@linaro.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=j-keerthy@ti.com \
    --cc=jneanne@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=kristo@kernel.org \
    --cc=lee@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=msp@baylibre.com \
    --cc=narmstrong@baylibre.com \
    --cc=nm@ti.com \
    --cc=robh+dt@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).