From: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
To: Hartmut Knaack <knaack.h@gmx.de>,
Jonathan Cameron <jic23@kernel.org>,
James Hartley <james.hartley@imgtec.com>,
Andrew Bresticker <abrestic@chromium.org>
Cc: <linux-iio@vger.kernel.org>, <devicetree@vger.kernel.org>,
<robh+dt@kernel.org>, <Pawel.Moll@arm.com>,
<Mark.Rutland@arm.com>, <ijc+devicetree@hellion.org.uk>,
<galak@codeaurora.org>, Phani Movva <Phani.Movva@imgtec.com>,
Naidu Tellapati <Naidu.Tellapati@imgtec.com>
Subject: Re: [PATCH v5 1/3] iio: adc: Cosmic Circuits 10001 ADC driver
Date: Thu, 11 Dec 2014 12:21:36 -0300 [thread overview]
Message-ID: <5489B680.1030906@imgtec.com> (raw)
In-Reply-To: <5488DAAF.1080506@gmx.de>
Hi Hartmut,
On 12/10/2014 08:43 PM, Hartmut Knaack wrote:
> Ezequiel Garcia schrieb am 27.11.2014 um 16:39:
>> From: Phani Movva <Phani.Movva@imgtec.com>
>>
>> This commit adds support for Cosmic Circuits 10001 10-bit ADC device.
> Still some issues left, unfortunately things I pointed out in my last review.
Ouch, sorry about that.
[..]
>> +
>> +#define CC10001_ADC_DATA_MASK GENMASK(9, 0)
>> +#define CC10001_ADC_NUM_CHANNELS 8
>> +#define CC10001_ADC_CH_MASK GENMASK(CC10001_ADC_NUM_CHANNELS - 1, 0)
> This is only valid for one of the cases you make (wrong) use of CC10001_ADC_CH_MASK.
> As you seem to use this mask to separate channel selection values (0 - 7) in register
> CC10001_ADC_CONFIG, a GENMASK(2, 0) would be appropriate.
> In case of the indio_dev->channel_mask, you would actually need this
> GENMASK(CC10001_ADC_NUM_CHANNELS - 1, 0).
Right.
[..]
>> +static int cc10001_adc_probe(struct platform_device *pdev)
>> +{
>> + struct device_node *node = pdev->dev.of_node;
>> + struct cc10001_adc_device *adc_dev;
>> + unsigned long adc_clk_rate;
>> + struct resource *res;
>> + struct iio_dev *indio_dev;
>> + int ret;
>> +
>> + indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*adc_dev));
>> + if (indio_dev == NULL)
>> + return -ENOMEM;
>> +
>> + adc_dev = iio_priv(indio_dev);
>> +
>> + adc_dev->channel_map = CC10001_ADC_CH_MASK;
> So, here you need a GENMASK(CC10001_ADC_NUM_CHANNELS - 1, 0).
Right.
>> + if (!of_property_read_u32(node, "cosmic,reserved-adc-channels", &ret))
>> + adc_dev->channel_map &= ~ret;
>> +
>> + adc_dev->reg = devm_regulator_get(&pdev->dev, "vref");
>> + if (IS_ERR(adc_dev->reg))
>> + return -EINVAL;
> Preferably pass up the real error code with PTR_ERR(adc_dev->reg).
OK.
Thanks for all your reviews!
--
Ezequiel
WARNING: multiple messages have this Message-ID (diff)
From: Ezequiel Garcia <ezequiel.garcia-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
To: Hartmut Knaack <knaack.h-Mmb7MZpHnFY@public.gmane.org>,
Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
James Hartley
<james.hartley-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>,
Andrew Bresticker
<abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
Pawel.Moll-5wv7dgnIgG8@public.gmane.org,
Mark.Rutland-5wv7dgnIgG8@public.gmane.org,
ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
Phani Movva <Phani.Movva-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>,
Naidu Tellapati
<Naidu.Tellapati-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH v5 1/3] iio: adc: Cosmic Circuits 10001 ADC driver
Date: Thu, 11 Dec 2014 12:21:36 -0300 [thread overview]
Message-ID: <5489B680.1030906@imgtec.com> (raw)
In-Reply-To: <5488DAAF.1080506-Mmb7MZpHnFY@public.gmane.org>
Hi Hartmut,
On 12/10/2014 08:43 PM, Hartmut Knaack wrote:
> Ezequiel Garcia schrieb am 27.11.2014 um 16:39:
>> From: Phani Movva <Phani.Movva-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
>>
>> This commit adds support for Cosmic Circuits 10001 10-bit ADC device.
> Still some issues left, unfortunately things I pointed out in my last review.
Ouch, sorry about that.
[..]
>> +
>> +#define CC10001_ADC_DATA_MASK GENMASK(9, 0)
>> +#define CC10001_ADC_NUM_CHANNELS 8
>> +#define CC10001_ADC_CH_MASK GENMASK(CC10001_ADC_NUM_CHANNELS - 1, 0)
> This is only valid for one of the cases you make (wrong) use of CC10001_ADC_CH_MASK.
> As you seem to use this mask to separate channel selection values (0 - 7) in register
> CC10001_ADC_CONFIG, a GENMASK(2, 0) would be appropriate.
> In case of the indio_dev->channel_mask, you would actually need this
> GENMASK(CC10001_ADC_NUM_CHANNELS - 1, 0).
Right.
[..]
>> +static int cc10001_adc_probe(struct platform_device *pdev)
>> +{
>> + struct device_node *node = pdev->dev.of_node;
>> + struct cc10001_adc_device *adc_dev;
>> + unsigned long adc_clk_rate;
>> + struct resource *res;
>> + struct iio_dev *indio_dev;
>> + int ret;
>> +
>> + indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*adc_dev));
>> + if (indio_dev == NULL)
>> + return -ENOMEM;
>> +
>> + adc_dev = iio_priv(indio_dev);
>> +
>> + adc_dev->channel_map = CC10001_ADC_CH_MASK;
> So, here you need a GENMASK(CC10001_ADC_NUM_CHANNELS - 1, 0).
Right.
>> + if (!of_property_read_u32(node, "cosmic,reserved-adc-channels", &ret))
>> + adc_dev->channel_map &= ~ret;
>> +
>> + adc_dev->reg = devm_regulator_get(&pdev->dev, "vref");
>> + if (IS_ERR(adc_dev->reg))
>> + return -EINVAL;
> Preferably pass up the real error code with PTR_ERR(adc_dev->reg).
OK.
Thanks for all your reviews!
--
Ezequiel
next prev parent reply other threads:[~2014-12-11 15:21 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-27 15:39 [PATCH v5 0/3] iio: Add Cosmic Circuits ADC support Ezequiel Garcia
2014-11-27 15:39 ` Ezequiel Garcia
2014-11-27 15:39 ` [PATCH v5 1/3] iio: adc: Cosmic Circuits 10001 ADC driver Ezequiel Garcia
2014-11-27 15:39 ` Ezequiel Garcia
2014-12-10 23:43 ` Hartmut Knaack
2014-12-10 23:43 ` Hartmut Knaack
2014-12-11 15:21 ` Ezequiel Garcia [this message]
2014-12-11 15:21 ` Ezequiel Garcia
2014-11-27 15:39 ` [PATCH v5 2/3] DT: iio: adc: Add CC_10001 binding documentation Ezequiel Garcia
2014-11-27 15:39 ` Ezequiel Garcia
2014-11-27 15:39 ` [PATCH v5 3/3] DT: Add a vendor prefix for Cosmic Circuits Ezequiel Garcia
2014-11-27 15:39 ` Ezequiel Garcia
2014-12-05 11:55 ` [PATCH v5 0/3] iio: Add Cosmic Circuits ADC support Ezequiel Garcia
2014-12-05 11:55 ` Ezequiel Garcia
2014-12-05 13:12 ` Jonathan Cameron
2014-12-05 13:12 ` Jonathan Cameron
2014-12-05 13:25 ` Jonathan Cameron
2014-12-05 13:25 ` Jonathan Cameron
2014-12-05 14:33 ` Ezequiel Garcia
2014-12-05 14:33 ` Ezequiel Garcia
2014-12-06 14:56 ` Jonathan Cameron
2014-12-06 14:56 ` 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=5489B680.1030906@imgtec.com \
--to=ezequiel.garcia@imgtec.com \
--cc=Mark.Rutland@arm.com \
--cc=Naidu.Tellapati@imgtec.com \
--cc=Pawel.Moll@arm.com \
--cc=Phani.Movva@imgtec.com \
--cc=abrestic@chromium.org \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=james.hartley@imgtec.com \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=linux-iio@vger.kernel.org \
--cc=robh+dt@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.