All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Akinobu Mita <akinobu.mita@gmail.com>, linux-iio@vger.kernel.org
Cc: Jonathan Cameron <jic23@kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Peter Meerwald <pmeerw@pmeerw.net>
Subject: Re: [PATCH 2/2] iio: pressure: mpl115: support MPL115A1
Date: Thu, 14 Jan 2016 17:37:59 +0100	[thread overview]
Message-ID: <5697CEE7.6070908@metafoo.de> (raw)
In-Reply-To: <1452789018-16255-2-git-send-email-akinobu.mita@gmail.com>

On 01/14/2016 05:30 PM, Akinobu Mita wrote:
> mpl115 driver currently supports i2c interface (MPL115A2).
> There is also SPI version (MPL115A1).  The difference between them
> is only physical transport so we can easily support both while sharing
> most of the code.
> 
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Jonathan Cameron <jic23@kernel.org>
> Cc: Hartmut Knaack <knaack.h@gmx.de>
> Cc: Lars-Peter Clausen <lars@metafoo.de>
> Cc: Peter Meerwald <pmeerw@pmeerw.net>
> Cc: linux-iio@vger.kernel.org
> ---
>  drivers/iio/pressure/Kconfig  |   8 +-
>  drivers/iio/pressure/mpl115.c | 258 +++++++++++++++++++++++++++++++++++++-----
>  2 files changed, 236 insertions(+), 30 deletions(-)
> 
> diff --git a/drivers/iio/pressure/Kconfig b/drivers/iio/pressure/Kconfig
> index 6f2e7c9..fa628b7 100644
> --- a/drivers/iio/pressure/Kconfig
> +++ b/drivers/iio/pressure/Kconfig
> @@ -31,11 +31,11 @@ config HID_SENSOR_PRESS
>            will be called hid-sensor-press.
>  
>  config MPL115
> -	tristate "Freescale MPL115A2 pressure sensor driver"
> -	depends on I2C
> +	tristate "Freescale MPL115A1/2 pressure sensor driver"
> +	depends on (SPI_MASTER && I2C!=m) || I2C

Hi,

for combined SPI and I2C support please follow a scheme similar to that used
by the mma7455 driver
(http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/iio?id=a84ef0d181d917125f1f16cffe53f84c19968969)
and split the driver into a core support module and one module each for I2C
and SPI support.

That is a much cleaner approach and avoids issues that can happen if core
I2C support is build as a module and core SPI support is built-in.

- Lars

  reply	other threads:[~2016-01-14 16:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-14 16:30 [PATCH 1/2] iio: pressure: mpl115: don't set unused i2c clientdata Akinobu Mita
2016-01-14 16:30 ` [PATCH 2/2] iio: pressure: mpl115: support MPL115A1 Akinobu Mita
2016-01-14 16:37   ` Lars-Peter Clausen [this message]
2016-01-15 13:33     ` Akinobu Mita

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=5697CEE7.6070908@metafoo.de \
    --to=lars@metafoo.de \
    --cc=akinobu.mita@gmail.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.