Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2424582ybp; Sat, 12 Oct 2019 09:57:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqygBj+khcjRBt40CyXrCu8bUBixXLTsYXc6QCEPzJw5oz2YYb/Qe68g64QDMe3ARJescqrM X-Received: by 2002:a17:906:3488:: with SMTP id g8mr19664025ejb.162.1570899448192; Sat, 12 Oct 2019 09:57:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1570899448; cv=pass; d=google.com; s=arc-20160816; b=xwLZXmnx4fv+SF2+TOVjEs2MbLacIRVPIlB6nju+4dJCr6pTDm3q1jHodGoChBkbh9 MQ0H7ldOi07sQIKvJuuOH27gduBE6yjsx8C5sMm8MxK3pJ6SZjr1tIM/geV6sGLBerk7 wNykqP65jDHwnIVDFGKOTxGQzHHbOhwA9WlShnGLQECiAZnjiIrzTFtjKtsg1X7RRPCq 1S11UnTHJkYSJBFCZKbwIYudylrBWCZXAQorYutXQu4YRUbcqqVh8eI6ljr/RQykhdKi AhH7TMn1faUM2iaLPgju/xvlpW0NBfN6F6NoxGk0vHspkvyZzshVIl3HrjfSCz7qJ+Uz xL/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=H490T33NOXsNv5uW2IbnnmW85uAQoogCvlGuJzkeYHg=; b=j15dyPa9SpnUOo1Go/MJP095F8Bi2cyEIqQKt08BDC3fbuZPWw7A3lu+EjiCO5iSxs GyxGHMcNue0IL1soQUMu4EfKUjm4kf51m2iLQrHar9E0M8VLa1YbpiIU3IgeItkMBQcM Mf5orkdQXWJ8UVeP55Wsix+qHFiTzrkGiL1PaFrz+i2AJkCHiFb9TAyN2GZgqkmijwe6 zL3F9WkaSnb5Y/kwmFWVVlR4GdtYuRdr2gMRj3Dtl6dRegukvPeyL/9xm2YtqYE9RmXh zyuukc/MiNxSeGVQFy6xvDTDxUZFrQgcsriKWdbwxYwAsCFeswOlUoQn8fq+q07x1vY0 xKrQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=dlrobertson.com dkim=pass dkdomain=dlrobertson.com dmarc=pass fromdomain=dlrobertson.com>); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id jx7si7803537ejb.84.2019.10.12.09.57.04; Sat, 12 Oct 2019 09:57:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=dlrobertson.com dkim=pass dkdomain=dlrobertson.com dmarc=pass fromdomain=dlrobertson.com>); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729461AbfJLQzM (ORCPT + 99 others); Sat, 12 Oct 2019 12:55:12 -0400 Received: from sender4-op-o14.zoho.com ([136.143.188.14]:17421 "EHLO sender4-op-o14.zoho.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727115AbfJLQxM (ORCPT ); Sat, 12 Oct 2019 12:53:12 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1570899183; cv=none; d=zoho.com; s=zohoarc; b=K+1e2/BFHXnRReb+f3XBc3FGfdWHDXmhlOtSs5lRq1CFVXB+4RA2tuFOL1yG6VSYp7CrRinIFMlqsvYSlPoptLpSmGz/J0/6JnoERQ3OH1M2klMHvYKJWLHs4VEbAIgnpk4xhWI5QiXysomDxyTnEVSDJGMjx+lNrt26mn3zsR4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570899183; h=Content-Type:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=H490T33NOXsNv5uW2IbnnmW85uAQoogCvlGuJzkeYHg=; b=HQtCAaVnSdO0rh2dh99uiPOqQR4dskSaQCfd2LmK/0VtKLYycoKarAIS8YJo++5RKqHUrlW4gTZpFsFZbReaRdh4wU+9wntR7Oo0ev7xCYQuSLFtH18IduOwPtgVIgoj7nR26o6gOwCP/OfoX4IxrXlfsPf7pPiAGxhxBXSBjdA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=dlrobertson.com; spf=pass smtp.mailfrom=dan@dlrobertson.com; dmarc=pass header.from= header.from= Received: from nessie (pool-100-15-144-194.washdc.fios.verizon.net [100.15.144.194]) by mx.zohomail.com with SMTPS id 157089918141952.24960803847944; Sat, 12 Oct 2019 09:53:01 -0700 (PDT) Date: Sat, 12 Oct 2019 16:38:39 +0000 From: Dan Robertson To: Jonathan Cameron Cc: linux-iio@vger.kernel.org, Peter Meerwald-Stadler , devicetree@vger.kernel.org, Hartmut Knaack , Rob Herring , Mark Rutland , linux-kernel@vger.kernel.org, Andy Shevchenko Subject: Re: [PATCH v2 2/2] iio: (bma400) add driver for the BMA400 Message-ID: <20191012163839.GB15972@nessie> References: <20191012035420.13904-1-dan@dlrobertson.com> <20191012035420.13904-3-dan@dlrobertson.com> <20191012104033.006b33f9@archlinux> <20191012153556.GA15972@nessie> <20191012173344.7d25fd02@archlinux> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ZfOjI3PrQbgiZnxM" Content-Disposition: inline In-Reply-To: <20191012173344.7d25fd02@archlinux> User-Agent: Mutt/1.12.2 (2019-09-21) X-Zoho-Virus-Status: 1 X-ZohoMailClient: External Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --ZfOjI3PrQbgiZnxM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 12, 2019 at 05:33:44PM +0100, Jonathan Cameron wrote: > On Sat, 12 Oct 2019 15:35:56 +0000 > Dan Robertson wrote: > > On Sat, Oct 12, 2019 at 10:40:33AM +0100, Jonathan Cameron wrote: > > > > > > Silly question. Why is soft_reset preferred to sleep mode? =20 > >=20 > > Not a silly question. I actually debated this when initially implementi= ng the > > driver. The datasheet describes soft-reset behavior in section 4.9, the > > following snippet from the datasheet is particularly relevant: > >=20 > > > The softreset performs a fundamental reset to the device which is lar= gely > > > equivalent to a power cycle. Following a delay, all user configuration > > > settings are overwritten with their default state... =20 > >=20 > > 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 rese= t to > > their defaults with a soft-reset. If we just set the power-mode to slee= p mode, > > the user configuration registers would be preserved. > >=20 > > 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. >=20 > 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 f= or a command. I'll remove this in the next patchset version. Cheers, - Dan --ZfOjI3PrQbgiZnxM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEF5dO2RaKc5C+SCJ9RcSmUsR+QqUFAl2iAYYACgkQRcSmUsR+ QqWfehAApr+GUxN8hPr6rvlGNCYOUAsH0xR5O1yDbOBeJ+KNTRu4yqOci19XXRvu oZh7eexWE+Jg3cqomkO4MBTqFbcE8fSMVsRS1g/dBSmIjP8t7elUXkyo0+u8BKhM BrPP/W9WnGQmj0m9crH9GYmAUh00KG1eG8JfPV/iO4Nj25FzyjidDgVdUb7+pieK EE85HRYLxc4EjbgiR5aFfHrHS7gFv0k/JZYGpTseL93VmHkRWEXYGemvEMJeu/GY +ZdHTL5kSyrQDsWOsc12B3uWxDbaVT0t6afEiaS0wHC5FeWg/axvldCO/SXaMSVy FUUH9+kIbS1CofTosjTsEopz8gEvmfM+Gn2n4PoP3R8GPzQJYDB1JSanJBwJlUKX 70+27TdX1HQq7iapt5QvjeQfarCGCrcWX7fQs3Z8uJxeGX2+WgElE1K58Cy1pe+c Z9DgLY1Baqb+njAWe5WAuLXaIBMsrbuJyu4jmanYdLD5OEkokbSdhht0Gcm2rRnp jErnlJHmQNZ9U9fv87nM6hAbHorj1ABasLvc2nyCAlQyGUaYnzXvYEXMLqBGAmie 7Cjv2gd53aoLyfFq1F4Yy6ETWmo/0lzRPS9+Lv/jgPyr4z7Lch3tZEFAmQMRHz8P WEza1Op588Do/vFarcCzQgHlPNfY1HS7P3J6ae2oFIB33cil8hc= =0oSI -----END PGP SIGNATURE----- --ZfOjI3PrQbgiZnxM--