devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Anand Ashok Dumbre <ANANDASH@xilinx.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	linux-iio <linux-iio@vger.kernel.org>, git <git@xilinx.com>,
	Michal Simek <michals@xilinx.com>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	devicetree <devicetree@vger.kernel.org>,
	Manish Narani <MNARANI@xilinx.com>
Subject: Re: [PATCH v7 2/4] iio: adc: Add Xilinx AMS driver
Date: Wed, 3 Nov 2021 17:19:28 +0000	[thread overview]
Message-ID: <20211103171928.23e86227@jic23-huawei> (raw)
In-Reply-To: <BY5PR02MB69163C30E1F4BAB847C88C1AA98B9@BY5PR02MB6916.namprd02.prod.outlook.com>

On Tue, 2 Nov 2021 21:31:21 +0000
Anand Ashok Dumbre <ANANDASH@xilinx.com> wrote:

> Hi Andy,
> 
> Thanks for the review.
...

> > > +               return IRQ_NONE;  
> > 
> > ...
> >   
> > > +       for_each_child_of_node(chan_node, child) {
> > > +               ret = of_property_read_u32(child, "reg", &reg);
> > > +               if (ret || reg > (AMS_PL_MAX_EXT_CHANNEL + 30))
> > > +                       continue;
> > > +
> > > +               memcpy(&channels[num_channels], &ams_pl_channels[reg +
> > > +                      AMS_PL_MAX_FIXED_CHANNEL - 30],
> > > + sizeof(*channels));
> > > +
> > > +               if (of_property_read_bool(child, "xlnx,bipolar"))
> > > +                       channels[num_channels].scan_type.sign = 's';
> > > +
> > > +               num_channels++;
> > > +       }  
> > 
> > Use device property API here instead of *of_*() calls.  
> 
> 
> > 
> > ...
> >   
> > > +       /* Initialize buffer for channel specification */
> > > +       ams_channels = kzalloc(sizeof(ams_ps_channels) +
> > > +                              sizeof(ams_pl_channels) +
> > > +                              sizeof(ams_ctrl_channels), GFP_KERNEL);  
> > 
> > Use the corresponding macro from overflow.h.
> >   
> > > +       if (!ams_channels)
> > > +               return -ENOMEM;  
> > 
> > ...
> >   
> > > +       if (of_device_is_available(np)) {  
> > 
> > fwnode_device_is_available()  
> 
> Currently acpi is not supported with this driver. But I will add support in the next series of patches.
> I don’t have a full understanding of ACPI and its interfaces. So would it be okay once the first iteration
> gets checked in, I will add ACPI support on top.

If you use the generic fwnode etc from property.h then dt
will just work and it may well be enough to enable the weirdness that
is ACPI ID PRP0001 which actually uses dt properties but reads them
from an ACPI DSDT.

So basically nothing to do except use the generic accessors rather than
the of_ variants.

Jonathan


  reply	other threads:[~2021-11-03 17:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 15:20 [PATCH v7 0/4] Add Xilinx AMS Driver Anand Ashok Dumbre
2021-10-19 15:20 ` [PATCH v7 1/4] arm64: zynqmp: DT: Add Xilinx AMS node Anand Ashok Dumbre
2021-10-19 15:20 ` [PATCH v7 2/4] iio: adc: Add Xilinx AMS driver Anand Ashok Dumbre
2021-10-21 11:06   ` Jonathan Cameron
2021-10-26 10:18     ` Anand Ashok Dumbre
2021-10-23 12:36   ` Lars-Peter Clausen
2021-10-27 20:35     ` Anand Ashok Dumbre
2021-10-24 14:27   ` kernel test robot
2021-10-25 10:10   ` Andy Shevchenko
2021-11-02 21:31     ` Anand Ashok Dumbre
2021-11-03 17:19       ` Jonathan Cameron [this message]
2021-10-25 13:08   ` Lars-Peter Clausen
2021-10-27  9:35     ` Anand Ashok Dumbre
2021-10-26  7:09   ` Lars-Peter Clausen
2021-10-27  9:04     ` Anand Ashok Dumbre
2021-10-19 15:20 ` [PATCH v7 3/4] dt-bindings: iio: adc: Add Xilinx AMS binding documentation Anand Ashok Dumbre
2021-10-27 17:00   ` Rob Herring
2021-10-19 15:20 ` [PATCH v7 4/4] MAINTAINERS: Add maintainer for xilinx-ams Anand Ashok Dumbre

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=20211103171928.23e86227@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=ANANDASH@xilinx.com \
    --cc=MNARANI@xilinx.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=git@xilinx.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michals@xilinx.com \
    --cc=pmeerw@pmeerw.net \
    /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;
as well as URLs for NNTP newsgroup(s).