[PATCH] mfd: axp20x: export axp20x-regulator child for AXP152

Sascha Hauer sha at pengutronix.de
Tue Oct 4 00:47:07 PDT 2022


On Wed, Sep 28, 2022 at 10:50:52AM +0200, Ahmad Fatoum wrote:
> While the upstream Linux driver doesn't support regulator configuration
> for the AXP152, we may need this in barebox for initial regulator setup.
> Thus have the MFD driver register the appropriate child device as done
> for the other drivers. While at it, pass along the axp20x driver data
> object. This is needed, so the regulator driver can query the variant;
> so far it was only possible to retrieve the parent regmap and redo the
> revision readout.
> 
> Signed-off-by: Johannes Zink <j.zink at pengutronix.de>
> Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
> ---
>  drivers/mfd/axp20x.c | 5 +++++
>  1 file changed, 5 insertions(+)

Applied, thanks

Sascha

> 
> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
> index da1e8ce35a7d..0a53eaea7cfa 100644
> --- a/drivers/mfd/axp20x.c
> +++ b/drivers/mfd/axp20x.c
> @@ -141,6 +141,9 @@ static const struct mfd_cell axp152_cells[] = {
>  	{
>  		.name		= "axp20x-pek",
>  	},
> +	{
> +		.name		= "axp20x-regulator",
> +	},
>  };
>  
>  static const struct mfd_cell axp288_cells[] = {
> @@ -337,6 +340,8 @@ int axp20x_device_probe(struct axp20x_dev *axp20x)
>  				     AXP806_REG_ADDR_EXT_ADDR_SLAVE_MODE);
>  	}
>  
> +	axp20x->dev->priv = axp20x;
> +
>  	ret = mfd_add_devices(axp20x->dev, axp20x->cells, axp20x->nr_cells);
>  	if (ret)
>  		return dev_err_probe(axp20x->dev, ret, "failed to add MFD devices\n");
> -- 
> 2.30.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list