linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antoine Tenart <antoine.tenart@free-electrons.com>
To: Hartmut Knaack <knaack.h@gmx.de>
Cc: linux-iio@vger.kernel.org, Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	Antoine Tenart <antoine.tenart@free-electrons.com>
Subject: Re: [PATCH 1/8] iio:adc:berlin2-adc: Fix register definition
Date: Mon, 27 Jul 2015 09:45:52 +0200	[thread overview]
Message-ID: <20150727074552.GA16683@kwain> (raw)
In-Reply-To: <57c4e77919394abab3c4f93c84d469221ba081f4.1437862404.git.knaack.h@gmx.de>

On Sun, Jul 26, 2015 at 12:43:19AM +0200, Hartmut Knaack wrote:
> Active channel number is stored in BERLIN2_SM_CTRL as value, instead of a
> bit map.
> The masks for channel interrupts and data ready are a 16 bits wide bit
> map each, instead of just 4 bits.

Thanks for fixing this!

> Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>

Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com>

> ---
> Driver analysis indicates that only one ADC channel can be sampled at a
> time, and this channel number is stored in BERLIN2_SM_CTRL as a value,
> instead of a bit map.
> In register BERLIN2_SM_ADC_STATUS however, interrupts can be enabled for
> each ADC channel, and data ready is indicated for each ADC channel,
> too - in both cases as a bit map. Since there are 8 channels available,
> both masks should be at least 8 bits wide. But as the comment indicates,
> there are 16 bits for each mask.
> 
>  drivers/iio/adc/berlin2-adc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/adc/berlin2-adc.c b/drivers/iio/adc/berlin2-adc.c
> index aecc9ad995ad..97863d1ba79a 100644
> --- a/drivers/iio/adc/berlin2-adc.c
> +++ b/drivers/iio/adc/berlin2-adc.c
> @@ -26,7 +26,7 @@
>  #define BERLIN2_SM_CTRL				0x14
>  #define  BERLIN2_SM_CTRL_SM_SOC_INT		BIT(1)
>  #define  BERLIN2_SM_CTRL_SOC_SM_INT		BIT(2)
> -#define  BERLIN2_SM_CTRL_ADC_SEL(x)		(BIT(x) << 5)	/* 0-15 */
> +#define  BERLIN2_SM_CTRL_ADC_SEL(x)		((x) << 5)	/* 0-15 */
>  #define  BERLIN2_SM_CTRL_ADC_SEL_MASK		(0xf << 5)
>  #define  BERLIN2_SM_CTRL_ADC_POWER		BIT(9)
>  #define  BERLIN2_SM_CTRL_ADC_CLKSEL_DIV2	(0x0 << 10)
> @@ -53,9 +53,9 @@
>  #define  BERLIN2_SM_ADC_MASK			0x3ff
>  #define BERLIN2_SM_ADC_STATUS			0x1c
>  #define  BERLIN2_SM_ADC_STATUS_DATA_RDY(x)	BIT(x)		/* 0-15 */
> -#define  BERLIN2_SM_ADC_STATUS_DATA_RDY_MASK	0xf
> +#define  BERLIN2_SM_ADC_STATUS_DATA_RDY_MASK	GENMASK(15, 0)
>  #define  BERLIN2_SM_ADC_STATUS_INT_EN(x)	(BIT(x) << 16)	/* 0-15 */
> -#define  BERLIN2_SM_ADC_STATUS_INT_EN_MASK	(0xf << 16)
> +#define  BERLIN2_SM_ADC_STATUS_INT_EN_MASK	GENMASK(31, 16)
>  #define BERLIN2_SM_TSEN_STATUS			0x24
>  #define  BERLIN2_SM_TSEN_STATUS_DATA_RDY	BIT(0)
>  #define  BERLIN2_SM_TSEN_STATUS_INT_EN		BIT(1)
> -- 
> 2.4.3
> 

-- 
Antoine Ténart, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2015-07-27  7:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-25 22:43 [PATCH 0/8] berlin2-adc fixes and cleanup Hartmut Knaack
2015-07-25 22:43 ` [PATCH 1/8] iio:adc:berlin2-adc: Fix register definition Hartmut Knaack
2015-07-27  7:45   ` Antoine Tenart [this message]
2015-07-25 22:43 ` [PATCH 2/8] iio:adc:berlin2-adc: pass up real error code Hartmut Knaack
2015-07-27  7:46   ` Antoine Tenart
2015-07-25 22:43 ` [PATCH 3/8] iio:adc:berlin2-adc: use GENMASK and BIT for masks Hartmut Knaack
2015-07-27  7:48   ` Antoine Tenart
2015-07-25 22:43 ` [PATCH 4/8] iio:adc:berlin2-adc: constify iio_chan_spec Hartmut Knaack
2015-07-27  7:48   ` Antoine Tenart
2015-07-25 22:43 ` [PATCH 5/8] iio:adc:berlin2-adc: use short operator format Hartmut Knaack
2015-07-27  7:49   ` Antoine Tenart
2015-07-25 22:43 ` [PATCH 6/8] iio:adc:berlin2-adc: use channel-array size directly Hartmut Knaack
2015-07-27  7:49   ` Antoine Tenart
2015-07-25 22:43 ` [PATCH 7/8] iio:adc:berlin2-adc: enable interrupts with mutex locked Hartmut Knaack
2015-07-25 22:43 ` [PATCH 8/8] iio:adc:berlin2-adc: coding style cleanup Hartmut Knaack
2015-07-27  7:50   ` Antoine Tenart

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=20150727074552.GA16683@kwain \
    --to=antoine.tenart@free-electrons.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --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).