public inbox for linux-mips@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: <Claudiu.Beznea@microchip.com>
Cc: <nuno.sa@analog.com>, <openbmc@lists.ozlabs.org>,
	<linux-imx@nxp.com>, <linux-stm32@st-md-mailman.stormreply.com>,
	<linux-iio@vger.kernel.org>, <linux-mips@vger.kernel.org>,
	<linux-renesas-soc@vger.kernel.org>,
	<linux-mediatek@lists.infradead.org>,
	<chrome-platform@lists.linux.dev>,
	<linux-arm-kernel@lists.infradead.org>,
	<prabhakar.mahadev-lad.rj@bp.renesas.com>,
	<linux-arm-msm@vger.kernel.org>, <gwendal@chromium.org>,
	<sravanhome@gmail.com>, <tmaimon77@gmail.com>,
	<mcoquelin.stm32@gmail.com>, <alexandre.torgue@foss.st.com>,
	<lorenzo@kernel.org>, <festevam@gmail.com>, <shawnguo@kernel.org>,
	<olivier.moysan@foss.st.com>, <tali.perry1@gmail.com>,
	<thara.gopinath@linaro.org>, <bjorn.andersson@linaro.org>,
	<arnd@arndb.de>, <benjaminfair@google.com>,
	<Nicolas.Ferre@microchip.com>, <rafael@kernel.org>,
	<venture@google.com>, <kernel@pengutronix.de>,
	<fabrice.gasnier@foss.st.com>, <daniel.lezcano@linaro.org>,
	<bleung@chromium.org>, <yuenn@google.com>,
	<miquel.raynal@bootlin.com>, <alexandre.belloni@bootlin.com>,
	<rui.zhang@intel.com>, <linus.walleij@linaro.org>,
	<cbranchereau@gmail.com>, <cai.huoqing@linux.dev>,
	<avifishman70@gmail.com>, <Eugen.Hristev@microchip.com>,
	<matthias.bgg@gmail.com>, <s.hauer@pengutronix.de>,
	<lars@metafoo.de>, <andy.shevchenko@gmail.com>,
	<groeck@chromium.org>, <paul@crapouillou.net>,
	<agross@kernel.org>, <amitk@kernel.org>,
	<Michael.Hennerich@analog.com>, <haibo.chen@nxp.com>,
	<quic_jprakash@quicinc.com>
Subject: Re: [PATCH v3 09/15] iio: adc: at91-sama5d2_adc: convert to device properties
Date: Sat, 6 Aug 2022 19:49:35 +0100	[thread overview]
Message-ID: <20220806194935.383bf393@jic23-huawei> (raw)
In-Reply-To: <ada4c2a2-e13d-77aa-f489-7cc0a063adbd@microchip.com>

On Mon, 18 Jul 2022 05:21:47 +0000
<Claudiu.Beznea@microchip.com> wrote:

> On 15.07.2022 15:28, Nuno Sá wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> > 
> > Make the conversion to firmware agnostic device properties. As part of
> > the conversion the IIO inkern interface 'of_xlate()' is also converted to
> > 'fwnode_xlate()'. The goal is to completely drop 'of_xlate' and hence OF
> > dependencies from IIO.
> > 
> > Signed-off-by: Nuno Sá <nuno.sa@analog.com>
> > Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>  
> 
> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> 

Hi Nuno / Claudiu

Lots of fuzz on this one because of Claudiu's series that I took whilst this was under review
I haven't really checked the result of forcing it in but please take a look at the
testing branch of iio.git for anything silly that happened.

Jonathan

> 
> > ---
> >  drivers/iio/adc/at91-sama5d2_adc.c | 30 +++++++++++++++---------------
> >  1 file changed, 15 insertions(+), 15 deletions(-)
> > 
> > diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
> > index fe3131c9593c..df716584c117 100644
> > --- a/drivers/iio/adc/at91-sama5d2_adc.c
> > +++ b/drivers/iio/adc/at91-sama5d2_adc.c
> > @@ -16,8 +16,9 @@
> >  #include <linux/interrupt.h>
> >  #include <linux/io.h>
> >  #include <linux/module.h>
> > -#include <linux/of_device.h>
> > +#include <linux/mod_devicetable.h>
> >  #include <linux/platform_device.h>
> > +#include <linux/property.h>
> >  #include <linux/sched.h>
> >  #include <linux/wait.h>
> >  #include <linux/iio/iio.h>
> > @@ -650,8 +651,8 @@ at91_adc_chan_get(struct iio_dev *indio_dev, int chan)
> >         return indio_dev->channels + index;
> >  }
> > 
> > -static inline int at91_adc_of_xlate(struct iio_dev *indio_dev,
> > -                                   const struct of_phandle_args *iiospec)
> > +static inline int at91_adc_fwnode_xlate(struct iio_dev *indio_dev,
> > +                                       const struct fwnode_reference_args *iiospec)
> >  {
> >         return at91_adc_chan_xlate(indio_dev, iiospec->args[0]);
> >  }
> > @@ -1876,7 +1877,7 @@ static const struct iio_info at91_adc_info = {
> >         .read_raw = &at91_adc_read_raw,
> >         .write_raw = &at91_adc_write_raw,
> >         .update_scan_mode = &at91_adc_update_scan_mode,
> > -       .of_xlate = &at91_adc_of_xlate,
> > +       .fwnode_xlate = &at91_adc_fwnode_xlate,
> >         .hwfifo_set_watermark = &at91_adc_set_watermark,
> >  };
> > 
> > @@ -1920,6 +1921,7 @@ static int at91_adc_buffer_and_trigger_init(struct device *dev,
> > 
> >  static int at91_adc_probe(struct platform_device *pdev)
> >  {
> > +       struct device *dev = &pdev->dev;
> >         struct iio_dev *indio_dev;
> >         struct at91_adc_state *st;
> >         struct resource *res;
> > @@ -1933,7 +1935,7 @@ static int at91_adc_probe(struct platform_device *pdev)
> >         st = iio_priv(indio_dev);
> >         st->indio_dev = indio_dev;
> > 
> > -       st->soc_info.platform = of_device_get_match_data(&pdev->dev);
> > +       st->soc_info.platform = device_get_match_data(dev);
> > 
> >         indio_dev->name = dev_name(&pdev->dev);
> >         indio_dev->modes = INDIO_DIRECT_MODE | INDIO_BUFFER_SOFTWARE;
> > @@ -1950,34 +1952,32 @@ static int at91_adc_probe(struct platform_device *pdev)
> > 
> >         st->oversampling_ratio = AT91_OSR_1SAMPLES;
> > 
> > -       ret = of_property_read_u32(pdev->dev.of_node,
> > -                                  "atmel,min-sample-rate-hz",
> > -                                  &st->soc_info.min_sample_rate);
> > +       ret = device_property_read_u32(dev, "atmel,min-sample-rate-hz",
> > +                                      &st->soc_info.min_sample_rate);
> >         if (ret) {
> >                 dev_err(&pdev->dev,
> >                         "invalid or missing value for atmel,min-sample-rate-hz\n");
> >                 return ret;
> >         }
> > 
> > -       ret = of_property_read_u32(pdev->dev.of_node,
> > -                                  "atmel,max-sample-rate-hz",
> > -                                  &st->soc_info.max_sample_rate);
> > +       ret = device_property_read_u32(dev, "atmel,max-sample-rate-hz",
> > +                                      &st->soc_info.max_sample_rate);
> >         if (ret) {
> >                 dev_err(&pdev->dev,
> >                         "invalid or missing value for atmel,max-sample-rate-hz\n");
> >                 return ret;
> >         }
> > 
> > -       ret = of_property_read_u32(pdev->dev.of_node, "atmel,startup-time-ms",
> > -                                  &st->soc_info.startup_time);
> > +       ret = device_property_read_u32(dev, "atmel,startup-time-ms",
> > +                                      &st->soc_info.startup_time);
> >         if (ret) {
> >                 dev_err(&pdev->dev,
> >                         "invalid or missing value for atmel,startup-time-ms\n");
> >                 return ret;
> >         }
> > 
> > -       ret = of_property_read_u32(pdev->dev.of_node,
> > -                                  "atmel,trigger-edge-type", &edge_type);
> > +       ret = device_property_read_u32(dev, "atmel,trigger-edge-type",
> > +                                      &edge_type);
> >         if (ret) {
> >                 dev_dbg(&pdev->dev,
> >                         "atmel,trigger-edge-type not specified, only software trigger available\n");
> > --
> > 2.37.1
> >   
> 


  reply	other threads:[~2022-08-06 18:39 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15 12:28 [PATCH v3 00/15] make iio inkern interface firmware agnostic Nuno Sá
2022-07-15 12:28 ` [PATCH v3 01/15] iio: inkern: only release the device node when done with it Nuno Sá
2022-07-15 12:28 ` [PATCH v3 02/15] iio: inkern: fix return value in devm_of_iio_channel_get_by_name() Nuno Sá
2022-07-15 12:28 ` [PATCH v3 03/15] iio: inkern: only return error codes in iio_channel_get_*() APIs Nuno Sá
2022-08-06 17:45   ` Jonathan Cameron
2022-07-15 12:28 ` [PATCH v3 04/15] iio: inkern: split of_iio_channel_get_by_name() Nuno Sá
2022-08-06 18:30   ` Jonathan Cameron
2022-07-15 12:28 ` [PATCH v3 05/15] iio: inkern: move to fwnode properties Nuno Sá
2022-08-06 17:59   ` Jonathan Cameron
2022-08-06 18:38   ` Jonathan Cameron
2022-07-15 12:28 ` [PATCH v3 06/15] thermal: qcom: qcom-spmi-adc-tm5: convert to IIO fwnode API Nuno Sá
2022-07-15 21:40   ` Daniel Lezcano
2022-07-15 12:28 ` [PATCH v3 07/15] iio: adc: ingenic-adc: convert to IIO fwnode interface Nuno Sá
2022-07-15 12:28 ` [PATCH v3 08/15] iio: adc: ab8500-gpadc: convert to device properties Nuno Sá
2022-08-06 18:03   ` Jonathan Cameron
2022-08-06 18:08     ` Jonathan Cameron
2022-07-15 12:28 ` [PATCH v3 09/15] iio: adc: at91-sama5d2_adc: " Nuno Sá
2022-07-18  5:21   ` Claudiu.Beznea
2022-08-06 18:49     ` Jonathan Cameron [this message]
2022-08-18  8:39       ` Claudiu.Beznea
2022-07-15 12:28 ` [PATCH v3 10/15] iio: adc: qcom-pm8xxx-xoadc: " Nuno Sá
2022-07-15 12:28 ` [PATCH v3 11/15] iio: adc: qcom-spmi-vadc: " Nuno Sá
2022-07-15 12:29 ` [PATCH v3 12/15] iio: adc: qcom-spmi-adc5: " Nuno Sá
2022-08-06 18:20   ` Jonathan Cameron
2023-01-16 20:44     ` Marijn Suijten
2023-01-17  8:53       ` Andy Shevchenko
2023-01-17  9:06         ` Andy Shevchenko
2023-01-17  9:40           ` Andy Shevchenko
2023-01-17 22:42             ` Marijn Suijten
2022-07-15 12:29 ` [PATCH v3 13/15] iio: adc: stm32-adc: " Nuno Sá
2022-08-05  7:25   ` Fabrice Gasnier
2022-08-06 18:15   ` Jonathan Cameron
2022-08-06 18:53     ` Jonathan Cameron
2022-07-15 12:29 ` [PATCH v3 14/15] iio: inkern: remove OF dependencies Nuno Sá
2022-07-15 12:29 ` [PATCH v3 15/15] iio: inkern: fix coding style warnings Nuno Sá
2022-07-15 16:58   ` Andy Shevchenko
2022-08-06 18:56 ` [PATCH v3 00/15] make iio inkern interface firmware agnostic Jonathan Cameron

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=20220806194935.383bf393@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Claudiu.Beznea@microchip.com \
    --cc=Eugen.Hristev@microchip.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=agross@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=amitk@kernel.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=arnd@arndb.de \
    --cc=avifishman70@gmail.com \
    --cc=benjaminfair@google.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=bleung@chromium.org \
    --cc=cai.huoqing@linux.dev \
    --cc=cbranchereau@gmail.com \
    --cc=chrome-platform@lists.linux.dev \
    --cc=daniel.lezcano@linaro.org \
    --cc=fabrice.gasnier@foss.st.com \
    --cc=festevam@gmail.com \
    --cc=groeck@chromium.org \
    --cc=gwendal@chromium.org \
    --cc=haibo.chen@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=lars@metafoo.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=lorenzo@kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=nuno.sa@analog.com \
    --cc=olivier.moysan@foss.st.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=paul@crapouillou.net \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=quic_jprakash@quicinc.com \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=sravanhome@gmail.com \
    --cc=tali.perry1@gmail.com \
    --cc=thara.gopinath@linaro.org \
    --cc=tmaimon77@gmail.com \
    --cc=venture@google.com \
    --cc=yuenn@google.com \
    /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