mbox series

[v9,00/12] Add support for the silergy,sy7636a

Message ID 20210806091058.141-1-alistair@alistair23.me
Headers show
Series Add support for the silergy,sy7636a | expand

Message

Alistair Aug. 6, 2021, 9:10 a.m. UTC
This series applied on top of the "mfd: simple-mfd-i2c: Add support for 
registering devices via MFD cells" patch. Once "mfd: simple-mfd-i2c: Add 
support for registering devices via MFD cells" is merged this series is
ready to go.

v9:
 - Convert to use the simple-mfd-i2c instead

Alistair Francis (12):
  dt-bindings: mfd: Initial commit of silergy,sy7636a.yaml
  mfd: simple-mfd-i2c: Add a Kconfig name
  mfd: simple-mfd-i2c: Save the register client data
  mfd: simple-mfd-i2c: Enable support for the silergy,sy7636a
  regulator: sy7636a: Use the regmap directly
  regulator: sy7636a: Remove requirement on sy7636a mfd
  thermal: sy7636a: Add thermal driver for sy7636a
  hwmon: sy7636a: Add temperature driver for sy7636a
  ARM: imx_v6_v7_defconfig: Enable silergy,sy7636a
  ARM: dts: imx7d: remarkable2: Enable silergy,sy7636a
  ARM: imx_v6_v7_defconfig: Enable backlight class devices
  ARM: dts: imx7d: remarkable2: Enable lcdif

 .../bindings/mfd/silergy,sy7636a.yaml         |  79 ++++++++++++
 arch/arm/boot/dts/imx7d-remarkable2.dts       | 115 ++++++++++++++++++
 arch/arm/configs/imx_v6_v7_defconfig          |   5 +
 drivers/hwmon/Kconfig                         |  10 ++
 drivers/hwmon/Makefile                        |   1 +
 drivers/hwmon/sy7636a-hwmon.c                 |  77 ++++++++++++
 drivers/mfd/Kconfig                           |   2 +-
 drivers/mfd/simple-mfd-i2c.c                  |  14 +++
 drivers/regulator/Kconfig                     |   1 -
 drivers/regulator/sy7636a-regulator.c         |  13 +-
 drivers/thermal/Kconfig                       |   6 +
 drivers/thermal/Makefile                      |   1 +
 drivers/thermal/sy7636a_thermal.c             |  91 ++++++++++++++
 include/linux/mfd/sy7636a.h                   |  41 +++++++
 14 files changed, 447 insertions(+), 9 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/silergy,sy7636a.yaml
 create mode 100644 drivers/hwmon/sy7636a-hwmon.c
 create mode 100644 drivers/thermal/sy7636a_thermal.c
 create mode 100644 include/linux/mfd/sy7636a.h

Comments

Lee Jones Aug. 6, 2021, 11:38 a.m. UTC | #1
On Fri, 06 Aug 2021, Alistair Francis wrote:

> Signed-off-by: Alistair Francis <alistair@alistair23.me>
> ---
>  drivers/mfd/simple-mfd-i2c.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/mfd/simple-mfd-i2c.c b/drivers/mfd/simple-mfd-i2c.c
> index 583e8c7924af..633a2b28b6cb 100644
> --- a/drivers/mfd/simple-mfd-i2c.c
> +++ b/drivers/mfd/simple-mfd-i2c.c
> @@ -48,6 +48,8 @@ static int simple_mfd_i2c_probe(struct i2c_client *i2c)
>  	if (IS_ERR(regmap))
>  		return PTR_ERR(regmap);
>  
> +	i2c_set_clientdata(i2c, regmap);
> +

No need to store this here.

Just do this in the child device:

     dev_get_regmap(pdev->dev.parent, NULL);

>  	/* If no MFD cells are spedified, use register the DT child nodes instead */
>  	if (!simple_mfd_data || !simple_mfd_data->mfd_cell)
>  		return devm_of_platform_populate(&i2c->dev);
Lee Jones Aug. 9, 2021, 11:14 a.m. UTC | #2
On Fri, 06 Aug 2021, Mark Brown wrote:

> On Fri, Aug 06, 2021 at 12:38:36PM +0100, Lee Jones wrote:

> > On Fri, 06 Aug 2021, Alistair Francis wrote:

> 

> > > +	i2c_set_clientdata(i2c, regmap);

> > > +

> 

> > No need to store this here.

> 

> > Just do this in the child device:

> 

> >      dev_get_regmap(pdev->dev.parent, NULL);

> 

> Note that dev_get_regmap() is relatively expensive compared to a simple

> driver data reference since it needs to go search for the device to find

> the regmap, it's not the end of the world especially in the context of

> doing I2C I/O but storing it isn't a terrible idea.


It would be nice if someone could do some metrics on this.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
Mark Brown Aug. 9, 2021, 1:06 p.m. UTC | #3
On Fri, 6 Aug 2021 19:10:46 +1000, Alistair Francis wrote:
> This series applied on top of the "mfd: simple-mfd-i2c: Add support for

> registering devices via MFD cells" patch. Once "mfd: simple-mfd-i2c: Add

> support for registering devices via MFD cells" is merged this series is

> ready to go.

> 

> v9:

>  - Convert to use the simple-mfd-i2c instead

> 

> [...]


Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[05/12] regulator: sy7636a: Use the regmap directly
        commit: 27fdd3bbb7a13830c05b6bf777e45c392cb00f63

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
Alistair Francis Aug. 10, 2021, 7:03 a.m. UTC | #4
On Mon, Aug 9, 2021 at 9:14 PM Lee Jones <lee.jones@linaro.org> wrote:
>

> On Fri, 06 Aug 2021, Mark Brown wrote:

>

> > On Fri, Aug 06, 2021 at 12:38:36PM +0100, Lee Jones wrote:

> > > On Fri, 06 Aug 2021, Alistair Francis wrote:

> >

> > > > + i2c_set_clientdata(i2c, regmap);

> > > > +

> >

> > > No need to store this here.

> >

> > > Just do this in the child device:

> >

> > >      dev_get_regmap(pdev->dev.parent, NULL);

> >

> > Note that dev_get_regmap() is relatively expensive compared to a simple

> > driver data reference since it needs to go search for the device to find

> > the regmap, it's not the end of the world especially in the context of

> > doing I2C I/O but storing it isn't a terrible idea.

>

> It would be nice if someone could do some metrics on this.


I updated it to use `dev_get_regmap()` in version 10 of the series

Alistair

>

> --

> Lee Jones [李琼斯]

> Senior Technical Lead - Developer Services

> Linaro.org │ Open source software for Arm SoCs

> Follow Linaro: Facebook | Twitter | Blog