From: Dan Robertson <dan@dlrobertson.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
devicetree@vger.kernel.org, Hartmut Knaack <knaack.h@gmx.de>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
linux-kernel@vger.kernel.org,
Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: Re: [PATCH v2 2/2] iio: (bma400) add driver for the BMA400
Date: Sat, 12 Oct 2019 16:38:39 +0000 [thread overview]
Message-ID: <20191012163839.GB15972@nessie> (raw)
In-Reply-To: <20191012173344.7d25fd02@archlinux>
[-- Attachment #1: Type: text/plain, Size: 1662 bytes --]
On Sat, Oct 12, 2019 at 05:33:44PM +0100, Jonathan Cameron wrote:
> On Sat, 12 Oct 2019 15:35:56 +0000
> Dan Robertson <dan@dlrobertson.com> wrote:
> > On Sat, Oct 12, 2019 at 10:40:33AM +0100, Jonathan Cameron wrote:
> > >
> > > Silly question. Why is soft_reset preferred to sleep mode?
> >
> > Not a silly question. I actually debated this when initially implementing the
> > driver. The datasheet describes soft-reset behavior in section 4.9, the
> > following snippet from the datasheet is particularly relevant:
> >
> > > The softreset performs a fundamental reset to the device which is largely
> > > equivalent to a power cycle. Following a delay, all user configuration
> > > settings are overwritten with their default state...
> >
> > Sleep mode is the default power-mode, so the only real difference would be that
> > the oversampling ratio, sampling frequency, and scale would all be reset to
> > their defaults with a soft-reset. If we just set the power-mode to sleep mode,
> > the user configuration registers would be preserved.
> >
> > I can add a comment about the behavior of a softreset in bma400_remove.
> I'd just not do it. That way there is only the putting it to sleep path.
> We normally assume that we don't know the state during startup and aren't
> as careful on remove to make sure things are in a default state.
>
> That way you only need a single path in the remove function. If sleep mode
> fails you are probably broken anyway.
Sounds good. That does make remove much easier if the device is not ready for a
command. I'll remove this in the next patchset version.
Cheers,
- Dan
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-10-12 16:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-12 3:54 [PATCH v2 0/2] iio: add driver for Bosch BMA400 accelerometer Dan Robertson
2019-10-12 3:54 ` [PATCH v2 1/2] dt-bindings: iio: accel: bma400: add bindings Dan Robertson
2019-10-12 9:31 ` Jonathan Cameron
2019-10-12 3:54 ` [PATCH v2 2/2] iio: (bma400) add driver for the BMA400 Dan Robertson
2019-10-12 6:11 ` Randy Dunlap
2019-10-12 7:39 ` Andy Shevchenko
2019-10-12 9:29 ` Jonathan Cameron
2019-10-12 9:40 ` Jonathan Cameron
2019-10-12 15:35 ` Dan Robertson
2019-10-12 16:33 ` Jonathan Cameron
2019-10-12 16:38 ` Dan Robertson [this message]
2019-10-14 16:35 ` kbuild test robot
2019-10-15 13:53 ` Andy Shevchenko
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=20191012163839.GB15972@nessie \
--to=dan@dlrobertson.com \
--cc=andy.shevchenko@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pmeerw@pmeerw.net \
--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 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).