linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Slawomir Stepien <sst@poczta.fm>
Cc: Himanshu Jha <himanshujha199640@gmail.com>,
	lars@metafoo.de, Michael.Hennerich@analog.com, knaack.h@gmx.de,
	pmeerw@pmeerw.net, linux-iio@vger.kernel.org,
	gregkh@linuxfoundation.org
Subject: Re: [PATCH v5 1/1] staging: iio: adc: ad7280a: use devm_* APIs
Date: Sun, 11 Nov 2018 15:01:51 +0000	[thread overview]
Message-ID: <20181111150151.027875e0@archlinux> (raw)
In-Reply-To: <20181109165904.GB25135@x220.localdomain>

On Fri, 9 Nov 2018 17:59:04 +0100
Slawomir Stepien <sst@poczta.fm> wrote:

> On lis 04, 2018 16:33, Jonathan Cameron wrote:
> > The odd bit here is that I'm not entirely sure what 'power up' action
> > this power down is undoing, so not sure where exactly it should be.
> > 
> > It may just be a catch all for the device being left powered up after
> > a read sometime earlier.  If that's the case I would suggest a comment
> > making that clear and do it only just before the devm_iio_device_register
> > (as we don't power up anywhere in probe that I can see and this is the
> > point at which a power up 'might' occur as the interfaces are exposed.  
> 
> Inside the ad7280_chain_setup(), the first write to the device(s) is with
> AD7280A_CTRL_LB_SWRST bit. The next write is de-asserting this bit. Based on
> datasheet, such two writes will reset the upper part of the control register to
> its default state, that means, the device will left the software power down
> state.
> 
> So inside ad7280_chain_setup() we have the power up you are talking about.
> That is why I think that action that will put the device into software power
> down should be after spi_setup(), but before ad7280_chain_setup() - and this is
> the current form (of course I will use the ...or_reset() variant as Jha pointed
> out in next patch's version).
Good explanation.  I would just add a brief version of this to the code
so it's easy to follow for anyone looking at it in the future.

Thanks,

Jonathan

> 
> What do you think?
> 

  reply	other threads:[~2018-11-12  0:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-04 10:49 [PATCH v5 1/1] staging: iio: adc: ad7280a: use devm_* APIs Slawomir Stepien
2018-11-04 14:54 ` Himanshu Jha
2018-11-04 16:33   ` Jonathan Cameron
2018-11-09 16:59     ` Slawomir Stepien
2018-11-11 15:01       ` Jonathan Cameron [this message]
2018-11-11 16:00         ` Slawomir Stepien
2018-11-06 18:50   ` Slawomir Stepien

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=20181111150151.027875e0@archlinux \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=himanshujha199640@gmail.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=sst@poczta.fm \
    /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).