linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Josh Wu <josh.wu@atmel.com>,
	jic23@cam.ac.uk, linux-arm-kernel@lists.infradead.org,
	linux-iio@vger.kernel.org, plagnioj@jcrosoft.com,
	thomas.petazzoni@free-electrons.com, mark.rutland@arm.com,
	b.brezillon@overkiz.com
Subject: Re: [PATCH v2 2/4] iio: at91: Use different prescal, startup mask in MR for different IP
Date: Tue, 27 Aug 2013 11:47:12 +0200	[thread overview]
Message-ID: <20130827094712.GH2695@lukather> (raw)
In-Reply-To: <521C6BD2.7070602@atmel.com>

[-- Attachment #1: Type: text/plain, Size: 3976 bytes --]

Hi Nicolas,

On Tue, Aug 27, 2013 at 11:05:22AM +0200, Nicolas Ferre wrote:
> On 27/08/2013 10:15, Maxime Ripard :
> >On Mon, Aug 26, 2013 at 06:03:31PM +0800, Josh Wu wrote:
> >>Hi, Ludovic and Maxime
> >>
> >>On 8/26/2013 4:32 PM, Ludovic Desroches wrote:
> >>>On Fri, Aug 23, 2013 at 06:59:36PM +0200, Maxime Ripard wrote:
> >>>>Hi Ludovic, Josh,
> >>>>
> >>>>On Fri, Aug 23, 2013 at 05:46:03PM +0200, Desroches, Ludovic wrote:
> >>>>>On Thu, Aug 22, 2013 at 05:53:00PM +0800, Josh Wu wrote:
> >>>>>>On 8/22/2013 5:51 PM, Josh Wu wrote:
> >>>>>>>Hi, Maxime
> >>>>>>>
> >>>>>>>On 8/16/2013 3:20 AM, Maxime Ripard wrote:
> >>>>>>>>Hi Josh,
> >>>>>>>>
> >>>>>>>>On Sun, Aug 11, 2013 at 07:04:29PM +0800, Josh Wu wrote:
> >>>>>>>>>For at91 boards, there are different IPs for adc. Different IPs has
> >>>>>>>>>different STARTUP & PRESCAL mask in ADC_MR.
> >>>>>>>>>
> >>>>>>>>>This patch introduce the multiple compatible string for those
> >>>>>>>>>different IPs.
> >>>>>>>>>
> >>>>>>>>>Signed-off-by: Josh Wu <josh.wu@atmel.com>
> >>>>>>>>Overall it looks like the right ways, but I think we can take it a step
> >>>>>>>>further.
> >>>>>>>>
> >>>>>>>>I'd drop at least the atmel,adc-drdy-mask, atmel,adc-num-channels,
> >>>>>>>>atmel,adc-status-register, atmel,adc-trigger-register properties (and
> >>>>>>>>probably the triggers as well description as well).
> >>>>>>>yeah, right. Currently I want to drop following:
> >>>>>>>
> >>>>>>>atmel,adc-drdy-mask, atmel,adc-status-register,
> >>>>>>>atmel,adc-trigger-register, atmel,adc-channel-base
> >>>>>>>
> >>>>>>>For the adc-num-channels, I'd like to leave it in dt parameters.
> >>>>>>>It is a description for an adc capablity.
> >>>>>About this parameter, I'll remove it too from the dt bindings. To set it you
> >>>>>need to have a look to the datasheet and to copy a constant value into the
> >>>>>dt. From my point of view, it means than this parameter should be managed by
> >>>>>the driver and by the dt.
> >>>>>
> >>>>>On the other side since there are some dynamic allocation depending on this
> >>>>>parameter maybe it makes sense to keep it in the dt. If the user wants to use
> >>>>>only 2 channels why doing allocation for max channel number. By the way, this
> >>>>>case is only valid if he uses the two first channels.
> >>>>I don't recall it very well, is there any reason to not have it in the
> >>>>DT? Can the ADC channels be used for something else? Or is it just some
> >>>>IP-specific number of channels?
> >>>>
> >>>It is IP-specific. I don't see what benefit we could have to keep it in the DT?
> >>>But Josh seems to have arguments to keep it.
> >>
> >>I'm ok to remove the channel number. What I worried is there also
> >>has a channel-used mask in DT.
> >>This mask should be removed too if channel number is removed.
> >>So maybe we can also use the sysfs to set the mask.
> >
> >Indeed, that would make adc-channel-used irrelevant. But I'm not sure
> >the mask is useful at all. Just enable all the channels and that's it?
> 
> On the top of my head: keeping all channels enabled, won't it have
> an impact on:
> 1/ power consumption?
> 2/ minimum period of sampling for a particular channel in case of
>    continuous ADC trigger?

I don't know, you tell me ;)

This is exactly why I was asking.

> And do not forget that sysfs is an interface that is:
> - needing a userspace tool to be configured properly (even just an
>   echo xx)
> - hard to design
> - a strict ABI that can't be changed once deployed
> 
> But yes, it is true that if the user has to configure ADC at
> runtime, it is certainly an interface worth considering...

Yes, of course. But the resolution is something I'd expect to be
user-configurable, probably at runtime, and the DT doesn't make it very
convenient to achieve.

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-08-27  9:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-11 11:04 [PATCH v2 0/4] iio: at91: Add touch screen support in at91 adc Josh Wu
2013-08-11 11:04 ` [PATCH v2 1/4] iio: at91: fix adc_clk overflow Josh Wu
2013-08-11 11:04 ` [PATCH v2 2/4] iio: at91: Use different prescal, startup mask in MR for different IP Josh Wu
2013-08-15 19:20   ` Maxime Ripard
2013-08-22  9:51     ` Josh Wu
2013-08-22  9:53       ` Josh Wu
     [not found]         ` <20130823154603.GA7468@ludovic.desroches@atmel.com>
2013-08-23 16:59           ` Maxime Ripard
2013-08-26  8:32             ` Ludovic Desroches
2013-08-26 10:03               ` Josh Wu
2013-08-27  8:15                 ` Maxime Ripard
2013-08-27  9:05                   ` Nicolas Ferre
2013-08-27  9:47                     ` Maxime Ripard [this message]
2013-08-11 11:04 ` [PATCH v2 3/4] iio: at91: ADC start-up time calculation changed since at91sam9x5 Josh Wu
2013-08-15 19:27   ` Maxime Ripard
2013-08-22  9:54     ` Josh Wu
2013-08-11 11:04 ` [PATCH v2 4/4] iio: at91: introduce touch screen support in iio adc driver Josh Wu
2013-08-12 17:24   ` Dmitry Torokhov
2013-08-15 10:27     ` Jonathan Cameron
2013-08-22 10:02       ` Josh Wu
2013-08-20  9:07     ` Josh Wu

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=20130827094712.GH2695@lukather \
    --to=maxime.ripard@free-electrons.com \
    --cc=b.brezillon@overkiz.com \
    --cc=jic23@cam.ac.uk \
    --cc=josh.wu@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=nicolas.ferre@atmel.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=thomas.petazzoni@free-electrons.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;
as well as URLs for NNTP newsgroup(s).