mbox series

[v4,0/3] Renesas RZ/G2L ADC driver support

Message ID 20210804202118.25745-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Headers show
Series Renesas RZ/G2L ADC driver support | expand

Message

Prabhakar Mahadev Lad Aug. 4, 2021, 8:21 p.m. UTC
Hi All,

This patch series adds ADC support for Renesas RZ/G2L family.

Patches apply on top of v5.14-rc2.

Cheers,
Prabhakar

Changes for v4:
* Fixed registering action to assert resets on failure/remove
  as reported by Philip.
* Fixed review comments suggested by Jonathan.
* Included RB tag from Rob for patch 1/3
* Note DTS patch applies on top of https://git.kernel.org/pub/scm/
  linux/kernel/git/geert/renesas-devel.git/log/
  ?h=renesas-arm-dt-for-v5.15

Changes for v3 (as requested by Jonathan):
* Made use of FIELD_PREP()
* Renamed _CLEAR to _MASK and inverted inline as required
* Moved |= pair's on same lines
* Made use of sysfs_emit() while reading the labels
* Used for_each_bit_set() in rzg2l_adc_isr()
* Renamed rzg2l_adc_parse_of() -> rzg2l_adc_parse_properties()
* Used devm_add_action_or_reset() for asserting the reset signals and
  disabling pm_runtime and eventually removing remove() callback
* Added comments in isr handler for channel select interrupt
* Moved enabling/disabling of pclk during hw init in rzg2l_adc_hw_init()
* Dropped clock patch 3/4 (https://lore.kernel.org/patchwork/patch/1462152/)
  from previous series as its queued up in renesas-clk-for-v5.15

Changes for v2:
* Update binding doc, dropped gpios/renesas-rzg2l,adc-trigger-mode
  properties included channel property to represent each wired channel.
* Fixed review comments pointed by Alexandru, implemented pm runtime
  support, dropped mlock usage
* Fixed review comments pointed by Jonathan, renamed the macros,
  simplified the code.
* Included clock and DT patches

v1: https://patchwork.kernel.org/project/linux-renesas-soc/cover/
    20210629220328.13366-1-prabhakar.mahadev-lad.rj@bp.renesas.com/

Lad Prabhakar (3):
  dt-bindings: iio: adc: Add binding documentation for Renesas RZ/G2L
    A/D converter
  iio: adc: Add driver for Renesas RZ/G2L A/D converter
  arm64: dts: renesas: r9a07g044: Add ADC node

 .../bindings/iio/adc/renesas,rzg2l-adc.yaml   | 134 ++++
 MAINTAINERS                                   |   8 +
 arch/arm64/boot/dts/renesas/r9a07g044.dtsi    |  42 ++
 drivers/iio/adc/Kconfig                       |  10 +
 drivers/iio/adc/Makefile                      |   1 +
 drivers/iio/adc/rzg2l_adc.c                   | 600 ++++++++++++++++++
 6 files changed, 795 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
 create mode 100644 drivers/iio/adc/rzg2l_adc.c

Comments

Jonathan Cameron Aug. 8, 2021, 5:01 p.m. UTC | #1
On Wed,  4 Aug 2021 21:21:15 +0100
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> wrote:

> Hi All,

> 

> This patch series adds ADC support for Renesas RZ/G2L family.

> 

> Patches apply on top of v5.14-rc2.

Hi Lad, I'm fine with this, but need to pull my tree forwards
to include the header that is only in rc2.

I'll probably do that later in the week then pick up patches 1 and 2.

Thanks,

Jonathan
> 

> Cheers,

> Prabhakar

> 

> Changes for v4:

> * Fixed registering action to assert resets on failure/remove

>   as reported by Philip.

> * Fixed review comments suggested by Jonathan.

> * Included RB tag from Rob for patch 1/3

> * Note DTS patch applies on top of https://git.kernel.org/pub/scm/

>   linux/kernel/git/geert/renesas-devel.git/log/

>   ?h=renesas-arm-dt-for-v5.15

> 

> Changes for v3 (as requested by Jonathan):

> * Made use of FIELD_PREP()

> * Renamed _CLEAR to _MASK and inverted inline as required

> * Moved |= pair's on same lines

> * Made use of sysfs_emit() while reading the labels

> * Used for_each_bit_set() in rzg2l_adc_isr()

> * Renamed rzg2l_adc_parse_of() -> rzg2l_adc_parse_properties()

> * Used devm_add_action_or_reset() for asserting the reset signals and

>   disabling pm_runtime and eventually removing remove() callback

> * Added comments in isr handler for channel select interrupt

> * Moved enabling/disabling of pclk during hw init in rzg2l_adc_hw_init()

> * Dropped clock patch 3/4 (https://lore.kernel.org/patchwork/patch/1462152/)

>   from previous series as its queued up in renesas-clk-for-v5.15

> 

> Changes for v2:

> * Update binding doc, dropped gpios/renesas-rzg2l,adc-trigger-mode

>   properties included channel property to represent each wired channel.

> * Fixed review comments pointed by Alexandru, implemented pm runtime

>   support, dropped mlock usage

> * Fixed review comments pointed by Jonathan, renamed the macros,

>   simplified the code.

> * Included clock and DT patches

> 

> v1: https://patchwork.kernel.org/project/linux-renesas-soc/cover/

>     20210629220328.13366-1-prabhakar.mahadev-lad.rj@bp.renesas.com/

> 

> Lad Prabhakar (3):

>   dt-bindings: iio: adc: Add binding documentation for Renesas RZ/G2L

>     A/D converter

>   iio: adc: Add driver for Renesas RZ/G2L A/D converter

>   arm64: dts: renesas: r9a07g044: Add ADC node

> 

>  .../bindings/iio/adc/renesas,rzg2l-adc.yaml   | 134 ++++

>  MAINTAINERS                                   |   8 +

>  arch/arm64/boot/dts/renesas/r9a07g044.dtsi    |  42 ++

>  drivers/iio/adc/Kconfig                       |  10 +

>  drivers/iio/adc/Makefile                      |   1 +

>  drivers/iio/adc/rzg2l_adc.c                   | 600 ++++++++++++++++++

>  6 files changed, 795 insertions(+)

>  create mode 100644 Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml

>  create mode 100644 drivers/iio/adc/rzg2l_adc.c

>
Lad, Prabhakar Aug. 9, 2021, 1:04 p.m. UTC | #2
Hi Jonathan,

On Sun, Aug 8, 2021 at 5:58 PM Jonathan Cameron <jic23@kernel.org> wrote:
>

> On Wed,  4 Aug 2021 21:21:15 +0100

> Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> wrote:

>

> > Hi All,

> >

> > This patch series adds ADC support for Renesas RZ/G2L family.

> >

> > Patches apply on top of v5.14-rc2.

> Hi Lad, I'm fine with this, but need to pull my tree forwards

> to include the header that is only in rc2.

>

> I'll probably do that later in the week then pick up patches 1 and 2.

>

Thanks.

Geert could you please pick patch 3/3.

Cheers,
Prabhakar

> Thanks,

>

> Jonathan

> >

> > Cheers,

> > Prabhakar

> >

> > Changes for v4:

> > * Fixed registering action to assert resets on failure/remove

> >   as reported by Philip.

> > * Fixed review comments suggested by Jonathan.

> > * Included RB tag from Rob for patch 1/3

> > * Note DTS patch applies on top of https://git.kernel.org/pub/scm/

> >   linux/kernel/git/geert/renesas-devel.git/log/

> >   ?h=renesas-arm-dt-for-v5.15

> >

> > Changes for v3 (as requested by Jonathan):

> > * Made use of FIELD_PREP()

> > * Renamed _CLEAR to _MASK and inverted inline as required

> > * Moved |= pair's on same lines

> > * Made use of sysfs_emit() while reading the labels

> > * Used for_each_bit_set() in rzg2l_adc_isr()

> > * Renamed rzg2l_adc_parse_of() -> rzg2l_adc_parse_properties()

> > * Used devm_add_action_or_reset() for asserting the reset signals and

> >   disabling pm_runtime and eventually removing remove() callback

> > * Added comments in isr handler for channel select interrupt

> > * Moved enabling/disabling of pclk during hw init in rzg2l_adc_hw_init()

> > * Dropped clock patch 3/4 (https://lore.kernel.org/patchwork/patch/1462152/)

> >   from previous series as its queued up in renesas-clk-for-v5.15

> >

> > Changes for v2:

> > * Update binding doc, dropped gpios/renesas-rzg2l,adc-trigger-mode

> >   properties included channel property to represent each wired channel.

> > * Fixed review comments pointed by Alexandru, implemented pm runtime

> >   support, dropped mlock usage

> > * Fixed review comments pointed by Jonathan, renamed the macros,

> >   simplified the code.

> > * Included clock and DT patches

> >

> > v1: https://patchwork.kernel.org/project/linux-renesas-soc/cover/

> >     20210629220328.13366-1-prabhakar.mahadev-lad.rj@bp.renesas.com/

> >

> > Lad Prabhakar (3):

> >   dt-bindings: iio: adc: Add binding documentation for Renesas RZ/G2L

> >     A/D converter

> >   iio: adc: Add driver for Renesas RZ/G2L A/D converter

> >   arm64: dts: renesas: r9a07g044: Add ADC node

> >

> >  .../bindings/iio/adc/renesas,rzg2l-adc.yaml   | 134 ++++

> >  MAINTAINERS                                   |   8 +

> >  arch/arm64/boot/dts/renesas/r9a07g044.dtsi    |  42 ++

> >  drivers/iio/adc/Kconfig                       |  10 +

> >  drivers/iio/adc/Makefile                      |   1 +

> >  drivers/iio/adc/rzg2l_adc.c                   | 600 ++++++++++++++++++

> >  6 files changed, 795 insertions(+)

> >  create mode 100644 Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml

> >  create mode 100644 drivers/iio/adc/rzg2l_adc.c

> >

>
Geert Uytterhoeven Aug. 10, 2021, 9:42 a.m. UTC | #3
Hi Prabhakar,

On Wed, Aug 4, 2021 at 10:25 PM Lad Prabhakar
<prabhakar.mahadev-lad.rj@bp.renesas.com> wrote:
> Add ADC node to R9A07G044 (RZ/G2L) SoC DTSI.

>

> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>


Thanks for your patch!

> --- a/arch/arm64/boot/dts/renesas/r9a07g044.dtsi

> +++ b/arch/arm64/boot/dts/renesas/r9a07g044.dtsi

> @@ -169,6 +169,48 @@

>                         status = "disabled";

>                 };

>

> +               adc: adc@10059000 {

> +                       compatible = "renesas,r9a07g044-adc", "renesas,rzg2l-adc";

> +                       reg = <0 0x10059000 0 0x400>;

> +                       interrupts = <GIC_SPI 347  IRQ_TYPE_EDGE_RISING>;


Double space after 347.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

i.e. will queue in renesas-devel for v5.15 with the above fixed.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Jonathan Cameron Aug. 15, 2021, 4:04 p.m. UTC | #4
On Mon, 9 Aug 2021 14:04:33 +0100
"Lad, Prabhakar" <prabhakar.csengg@gmail.com> wrote:

> Hi Jonathan,

> 

> On Sun, Aug 8, 2021 at 5:58 PM Jonathan Cameron <jic23@kernel.org> wrote:

> >

> > On Wed,  4 Aug 2021 21:21:15 +0100

> > Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> wrote:

> >  

> > > Hi All,

> > >

> > > This patch series adds ADC support for Renesas RZ/G2L family.

> > >

> > > Patches apply on top of v5.14-rc2.  

> > Hi Lad, I'm fine with this, but need to pull my tree forwards

> > to include the header that is only in rc2.

> >

> > I'll probably do that later in the week then pick up patches 1 and 2.

> >  

> Thanks.

> 

> Geert could you please pick patch 3/3.

1 and 2 now applied to the togreg branch of iio.git and pushed out
as testing to see if 0-day can break them.

Thanks,

Jonathan
> 

> Cheers,

> Prabhakar

> 

> > Thanks,

> >

> > Jonathan  

> > >

> > > Cheers,

> > > Prabhakar

> > >

> > > Changes for v4:

> > > * Fixed registering action to assert resets on failure/remove

> > >   as reported by Philip.

> > > * Fixed review comments suggested by Jonathan.

> > > * Included RB tag from Rob for patch 1/3

> > > * Note DTS patch applies on top of https://git.kernel.org/pub/scm/

> > >   linux/kernel/git/geert/renesas-devel.git/log/

> > >   ?h=renesas-arm-dt-for-v5.15

> > >

> > > Changes for v3 (as requested by Jonathan):

> > > * Made use of FIELD_PREP()

> > > * Renamed _CLEAR to _MASK and inverted inline as required

> > > * Moved |= pair's on same lines

> > > * Made use of sysfs_emit() while reading the labels

> > > * Used for_each_bit_set() in rzg2l_adc_isr()

> > > * Renamed rzg2l_adc_parse_of() -> rzg2l_adc_parse_properties()

> > > * Used devm_add_action_or_reset() for asserting the reset signals and

> > >   disabling pm_runtime and eventually removing remove() callback

> > > * Added comments in isr handler for channel select interrupt

> > > * Moved enabling/disabling of pclk during hw init in rzg2l_adc_hw_init()

> > > * Dropped clock patch 3/4 (https://lore.kernel.org/patchwork/patch/1462152/)

> > >   from previous series as its queued up in renesas-clk-for-v5.15

> > >

> > > Changes for v2:

> > > * Update binding doc, dropped gpios/renesas-rzg2l,adc-trigger-mode

> > >   properties included channel property to represent each wired channel.

> > > * Fixed review comments pointed by Alexandru, implemented pm runtime

> > >   support, dropped mlock usage

> > > * Fixed review comments pointed by Jonathan, renamed the macros,

> > >   simplified the code.

> > > * Included clock and DT patches

> > >

> > > v1: https://patchwork.kernel.org/project/linux-renesas-soc/cover/

> > >     20210629220328.13366-1-prabhakar.mahadev-lad.rj@bp.renesas.com/

> > >

> > > Lad Prabhakar (3):

> > >   dt-bindings: iio: adc: Add binding documentation for Renesas RZ/G2L

> > >     A/D converter

> > >   iio: adc: Add driver for Renesas RZ/G2L A/D converter

> > >   arm64: dts: renesas: r9a07g044: Add ADC node

> > >

> > >  .../bindings/iio/adc/renesas,rzg2l-adc.yaml   | 134 ++++

> > >  MAINTAINERS                                   |   8 +

> > >  arch/arm64/boot/dts/renesas/r9a07g044.dtsi    |  42 ++

> > >  drivers/iio/adc/Kconfig                       |  10 +

> > >  drivers/iio/adc/Makefile                      |   1 +

> > >  drivers/iio/adc/rzg2l_adc.c                   | 600 ++++++++++++++++++

> > >  6 files changed, 795 insertions(+)

> > >  create mode 100644 Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml

> > >  create mode 100644 drivers/iio/adc/rzg2l_adc.c

> > >  

> >