Linux-IIO Archive on lore.kernel.org
 help / color / Atom feed
From: Dan Robertson <dan@dlrobertson.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-iio <linux-iio@vger.kernel.org>
Subject: Re: [PATCH 1/1] iio: accel: bma400: add support for bma400 spi
Date: Fri, 22 May 2020 12:36:55 +0000
Message-ID: <20200522123655.GA28754@gothmog.test> (raw)
In-Reply-To: <CAHp75Ve-ub+CAo2Q3XEAL1diph+7EVh=3L-wdnst-WJ8aM6Yxg@mail.gmail.com>


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

On Fri, May 22, 2020 at 11:50:37AM +0300, Andy Shevchenko wrote:
> On Fri, May 22, 2020 at 4:48 AM Dan Robertson <dan@dlrobertson.com> wrote:
> >
> > Add basic support for the Bosch Sensortec BMA400 3-axes ultra-low power
> > accelerometer when configured to use SPI.
> 
> ...
> 
> >         tristate "Bosch BMA400 3-Axis Accelerometer Driver"
> >         select REGMAP
> >         select BMA400_I2C if I2C
> 
> > +       select BMA400_SPI if I2C
> 
> This is not right.

Will fix in the second version.

> > +#include <linux/module.h>
> > +#include <linux/spi/spi.h>
> 
> What's the point of dups (see below)?

An error on my part.

> > +#define BMA400_SPI_READ_BUFFER_SIZE (BMA400_MAX_SPI_READ + 1)
> 
> Do wee need separate macro? It seems longer than explicit use.
> Do we need the original macro either?

I was just trying to avoid magic values. I have no problem with removing this
though.

> > +       /*
> > +        * TODO(dlrobertson): What is a reasonable length to cap
> > +        * this at.
> > +        */
> 
> Either drop this or fulfill. There is no way to leave such in the
> non-staging code.

I'll drop this in the next patchset version if we stick with regmap_bus
implementation. We never read more than two bytes in bma400_core, so
this size should be fine.

> > +       .read_flag_mask = BIT(7),
> 
> #include <linux/bits.h>

Good catch.

Thanks for the review. I will make the changes for the next patchset version.

Cheers,

 - Dan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 902 bytes --]

      reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22  1:46 [PATCH 0/1] " Dan Robertson
2020-05-22  1:46 ` [PATCH 1/1] " Dan Robertson
2020-05-22  8:50   ` Andy Shevchenko
2020-05-22 12:36     ` Dan Robertson [this message]

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=20200522123655.GA28754@gothmog.test \
    --to=dan@dlrobertson.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linus.walleij@linaro.org \
    --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

Linux-IIO Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-iio/0 linux-iio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iio linux-iio/ https://lore.kernel.org/linux-iio \
		linux-iio@vger.kernel.org
	public-inbox-index linux-iio

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-iio


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git