devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Barinov <vladimir.barinov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
To: Peter Meerwald <pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>
Cc: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Hartmut Knaack <knaack.h-Mmb7MZpHnFY@public.gmane.org>,
	Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>,
	linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/3] iio: adc: hi-843x: Holt HI-8435/8436/8437 descrete ADC
Date: Mon, 01 Jun 2015 17:41:47 +0300	[thread overview]
Message-ID: <556C6F2B.5010404@cogentembedded.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1506011440121.1644-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>

Hello Peter,

Thank you for the review.

On 01.06.2015 15:55, Peter Meerwald wrote:
>> Add Holt descrete ADC driver for HI-8435/8436/8437 chips
> discrete
Thx, will replace in the next try.
>
> link to datasheet would be nice, comments below
the official link is here:
http://www.holtic.com/products/3081-hi-8435.aspx
>
> what is the purpose of the driver?
Support hi-8435/36/37 chips in linux kernel via IIO subsystem with use 
of iio-buffer and triggered-buffer features.
>
> the driver-specific ABI needs to be documented under
> Documentation/ABI/testing/sys-bus-iio-*
Thanks, I will add this in the next try.
>
>> Signed-off-by: Vladimir Barinov <vladimir.barinov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
>> ---
>>   drivers/iio/adc/Kconfig   |  12 +
>>   drivers/iio/adc/Makefile  |   1 +
>>   drivers/iio/adc/hi-843x.c | 777 ++++++++++++++++++++++++++++++++++++++++++++++
>>   3 files changed, 790 insertions(+)
>>   create mode 100644 drivers/iio/adc/hi-843x.c
>>
>> diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
>> index e36a73e..71b0efc 100644
>> --- a/drivers/iio/adc/Kconfig
>> +++ b/drivers/iio/adc/Kconfig
>> @@ -164,6 +164,18 @@ config EXYNOS_ADC
>>   	  of SoCs for drivers such as the touchscreen and hwmon to use to share
>>   	  this resource.
>>   
>> +config HI_843X
> we recommend against using a placeholder in a drivers name;
> we suggest to name the driver after the first/primary chip it supports
> (that you test with most)
Ok, I will name the driver as hi8435_adc/HI8435_ADC in the next try.
> +#include <linux/interrupt.h>
> +
> +#define DRV_NAME "hi-843x"
> HI84.. prefix
sure, as mentioned above I will also use hi8435_adc name and rename all 
functions appropriately with this prefix.
> +static int hi843x_readw(struct hi843x_priv *priv, u8 reg, u16 *val)
> +{
> +	int ret;
> +
> +	reg |= HI843X_READ_OPCODE;
> +	ret = spi_write_then_read(priv->spi, &reg, 1, val, 2);
> +	*val = swab16p(val);
> will this work on big- and little-endian CPUs?
Actually I've tested it with little-endian CPU.
I will replace it with  be16_to_cpup in the next try and the same for 
swab32p -> be32_to_cpup.
>
> +#define HI843X_VOLTAGE_CHANNEL(num)				\
> +	{							\
> +		.type = IIO_VOLTAGE,				\
> +		.indexed = 1,					\
> +		.channel = num,					\
> +		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),	\
> +		.scan_index = num,				\
> +		.scan_type = {					\
> +			.sign = 'u',				\
> +			.realbits = 1,				\
> huh? this is unusual for an ADC
This is discrete ADC, only 2 possible results: 0 or 1.

Regards,
Vladimir

  parent reply	other threads:[~2015-06-01 14:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 12:17 [PATCH 0/3] iio: adc: hi-843x: Add Holt HI-8435/8436/8437 descrete ADC Vladimir Barinov
2015-06-01 12:20 ` [PATCH 1/3] iio: adc: hi-843x: " Vladimir Barinov
     [not found]   ` <1433161211-22034-1-git-send-email-vladimir.barinov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2015-06-01 12:55     ` Peter Meerwald
     [not found]       ` <alpine.DEB.2.02.1506011440121.1644-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>
2015-06-01 14:41         ` Vladimir Barinov [this message]
2015-06-03  7:05     ` Paul Bolle
2015-06-03  7:46       ` Vladimir Barinov
2015-06-07 16:11     ` Jonathan Cameron
     [not found]       ` <55746D35.1030409-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-06-18 19:33         ` Lars-Peter Clausen
     [not found]           ` <55831CF3.3070906-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2015-06-18 21:41             ` Vladimir Barinov
     [not found]               ` <55833B1D.8000407-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2015-06-21 14:14                 ` Jonathan Cameron
     [not found]                   ` <5586C6C0.8000307-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-06-24  9:25                     ` Vladimir Barinov
     [not found] ` <1433161073-21967-1-git-send-email-vladimir.barinov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2015-06-01 12:20   ` [PATCH 2/3] dt: Add vendor prefix 'holt' Vladimir Barinov
2015-06-01 12:20   ` [PATCH 3/3] dt: Document Holt descrete ADC bindings Vladimir Barinov
     [not found]     ` <1433161252-22122-1-git-send-email-vladimir.barinov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2015-06-07 15:43       ` 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=556C6F2B.5010404@cogentembedded.com \
    --to=vladimir.barinov-m4dtvfq/zs1mrggop+s0pdbpr1lh4cv8@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=knaack.h-Mmb7MZpHnFY@public.gmane.org \
    --cc=lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org \
    --cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.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 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).