mbox series

[v2,0/5] MediaTek MT6357/8/9 PMIC Auxiliary ADC support

Message ID 20240604123008.327424-1-angelogioacchino.delregno@collabora.com
Headers show
Series MediaTek MT6357/8/9 PMIC Auxiliary ADC support | expand

Message

AngeloGioacchino Del Regno June 4, 2024, 12:30 p.m. UTC
Changes in v2:
 - Dropped 'mfd: mt6397-core: Add support for AUXADCs on MT6357/58/59 PMICs'
   as Lee J already applied it;
 - Added patch to describe the ADC subnode in the MT6357 MFD binding
   and moved the example node from mediatek,mt6359-auxadc.yaml to
   mediatek,mt6357.yaml
 - Added 8-bits {s8,u8}_fract to math.h
 - Addressed reviewer comments on mt6359-auxadc driver

AngeloGioacchino Del Regno (5):
  dt-bindings: iio: adc: Add MediaTek MT6359 PMIC AUXADC
  dt-bindings: mfd: mediatek,mt6357: Describe Auxiliary ADC subdev
  math.h: Add unsigned 8 bits fractional numbers type
  iio: adc: Add support for MediaTek MT6357/8/9 Auxiliary ADC
  arm64: dts: mediatek: Add ADC node on MT6357, MT6358, MT6359 PMICs

 .../iio/adc/mediatek,mt6359-auxadc.yaml       |  33 +
 .../bindings/mfd/mediatek,mt6357.yaml         |  10 +
 arch/arm64/boot/dts/mediatek/mt6357.dtsi      |   5 +
 arch/arm64/boot/dts/mediatek/mt6358.dtsi      |   5 +
 arch/arm64/boot/dts/mediatek/mt6359.dtsi      |   5 +
 drivers/iio/adc/Kconfig                       |  12 +
 drivers/iio/adc/Makefile                      |   1 +
 drivers/iio/adc/mt6359-auxadc.c               | 606 ++++++++++++++++++
 .../iio/adc/mediatek,mt6357-auxadc.h          |  21 +
 .../iio/adc/mediatek,mt6358-auxadc.h          |  22 +
 .../iio/adc/mediatek,mt6359-auxadc.h          |  22 +
 include/linux/math.h                          |   2 +
 12 files changed, 744 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/mediatek,mt6359-auxadc.yaml
 create mode 100644 drivers/iio/adc/mt6359-auxadc.c
 create mode 100644 include/dt-bindings/iio/adc/mediatek,mt6357-auxadc.h
 create mode 100644 include/dt-bindings/iio/adc/mediatek,mt6358-auxadc.h
 create mode 100644 include/dt-bindings/iio/adc/mediatek,mt6359-auxadc.h

Comments

Andy Shevchenko June 4, 2024, 1:18 p.m. UTC | #1
On Tue, Jun 4, 2024 at 3:30 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> Some users may be requiring only rather small numbers as both
> numerator and denominator: add signed and unsigned 8 bits
> structs {s8,u8}_fract.

Reviewed-by: Andy Shevchenko <andy@kernel.org>
Thank you!
Andy Shevchenko June 4, 2024, 1:22 p.m. UTC | #2
On Tue, Jun 4, 2024 at 3:30 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> Add a driver to support reading the Auxiliary ADC IP found in the
> MediaTek MT6357, MT6358 and MT6359 Power Management ICs, featuring
> a different register layout, configurationm reset and ADC reading

configuration

> sequence from the other already supported MediaTek SoC or PMIC
> (aux)ADC HW.
>
> This driver provides multiple ADC channels for system monitoring,
> such as battery voltage, PMIC temperature, PMIC-internal voltage
> regulators temperature, and others.

Seems all my concerns were addressed, so
Reviewed-by: Andy Shevchenko <andy@kernel.org>
AngeloGioacchino Del Regno June 4, 2024, 1:24 p.m. UTC | #3
Il 04/06/24 15:22, Andy Shevchenko ha scritto:
> On Tue, Jun 4, 2024 at 3:30 PM AngeloGioacchino Del Regno
> <angelogioacchino.delregno@collabora.com> wrote:
>>
>> Add a driver to support reading the Auxiliary ADC IP found in the
>> MediaTek MT6357, MT6358 and MT6359 Power Management ICs, featuring
>> a different register layout, configurationm reset and ADC reading
> 
> configuration
> 

Oh, oops! If there's no further comment to address, can this be fixed while
applying, please?

Otherwise I can send a v3 :-)

>> sequence from the other already supported MediaTek SoC or PMIC
>> (aux)ADC HW.
>>
>> This driver provides multiple ADC channels for system monitoring,
>> such as battery voltage, PMIC temperature, PMIC-internal voltage
>> regulators temperature, and others.
> 
> Seems all my concerns were addressed, so
> Reviewed-by: Andy Shevchenko <andy@kernel.org>
> 

Thanks!
Angelo
Jonathan Cameron June 8, 2024, 5:44 p.m. UTC | #4
On Tue, 4 Jun 2024 15:24:31 +0200
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> wrote:

> Il 04/06/24 15:22, Andy Shevchenko ha scritto:
> > On Tue, Jun 4, 2024 at 3:30 PM AngeloGioacchino Del Regno
> > <angelogioacchino.delregno@collabora.com> wrote:  
> >>
> >> Add a driver to support reading the Auxiliary ADC IP found in the
> >> MediaTek MT6357, MT6358 and MT6359 Power Management ICs, featuring
> >> a different register layout, configurationm reset and ADC reading  
> > 
> > configuration
> >   
> 
> Oh, oops! If there's no further comment to address, can this be fixed while
> applying, please?
> 
Yes if Rob is happy with your response to his question on the
dt-binding.

LGTM as well btw.

Jonathan

> Otherwise I can send a v3 :-)
> 
> >> sequence from the other already supported MediaTek SoC or PMIC
> >> (aux)ADC HW.
> >>
> >> This driver provides multiple ADC channels for system monitoring,
> >> such as battery voltage, PMIC temperature, PMIC-internal voltage
> >> regulators temperature, and others.  
> > 
> > Seems all my concerns were addressed, so
> > Reviewed-by: Andy Shevchenko <andy@kernel.org>
> >   
> 
> Thanks!
> Angelo
Jonathan Cameron July 1, 2024, 6:40 p.m. UTC | #5
On Tue,  4 Jun 2024 14:30:03 +0200
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> wrote:

> Changes in v2:
>  - Dropped 'mfd: mt6397-core: Add support for AUXADCs on MT6357/58/59 PMICs'
>    as Lee J already applied it;
>  - Added patch to describe the ADC subnode in the MT6357 MFD binding
>    and moved the example node from mediatek,mt6359-auxadc.yaml to
>    mediatek,mt6357.yaml
>  - Added 8-bits {s8,u8}_fract to math.h
>  - Addressed reviewer comments on mt6359-auxadc driver

Applied 1,3,4 to the IIO tree. I'm assuming the mfd dt binding update
will got via mfd and the dts via appropriate SoC tree.

Given time is tight I'll gamble a bit and push directly out as togreg
rather than normal exposure to 0-day first.

Thanks,

Jonathan

> 
> AngeloGioacchino Del Regno (5):
>   dt-bindings: iio: adc: Add MediaTek MT6359 PMIC AUXADC
>   dt-bindings: mfd: mediatek,mt6357: Describe Auxiliary ADC subdev
>   math.h: Add unsigned 8 bits fractional numbers type
>   iio: adc: Add support for MediaTek MT6357/8/9 Auxiliary ADC
>   arm64: dts: mediatek: Add ADC node on MT6357, MT6358, MT6359 PMICs
> 
>  .../iio/adc/mediatek,mt6359-auxadc.yaml       |  33 +
>  .../bindings/mfd/mediatek,mt6357.yaml         |  10 +
>  arch/arm64/boot/dts/mediatek/mt6357.dtsi      |   5 +
>  arch/arm64/boot/dts/mediatek/mt6358.dtsi      |   5 +
>  arch/arm64/boot/dts/mediatek/mt6359.dtsi      |   5 +
>  drivers/iio/adc/Kconfig                       |  12 +
>  drivers/iio/adc/Makefile                      |   1 +
>  drivers/iio/adc/mt6359-auxadc.c               | 606 ++++++++++++++++++
>  .../iio/adc/mediatek,mt6357-auxadc.h          |  21 +
>  .../iio/adc/mediatek,mt6358-auxadc.h          |  22 +
>  .../iio/adc/mediatek,mt6359-auxadc.h          |  22 +
>  include/linux/math.h                          |   2 +
>  12 files changed, 744 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/adc/mediatek,mt6359-auxadc.yaml
>  create mode 100644 drivers/iio/adc/mt6359-auxadc.c
>  create mode 100644 include/dt-bindings/iio/adc/mediatek,mt6357-auxadc.h
>  create mode 100644 include/dt-bindings/iio/adc/mediatek,mt6358-auxadc.h
>  create mode 100644 include/dt-bindings/iio/adc/mediatek,mt6359-auxadc.h
>