From: Arnd Bergmann <arnd@arndb.de>
To: Eric Andersson <eric.andersson@unixphere.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
alan@lxorguk.ukuu.org.uk, zhengguang.guo@bosch-sensortec.com,
peter.moeller@cn.bosch.com
Subject: Re: [PATCHv2 2/3] misc: add support for bmp18x chips to the bmp085 driver
Date: Tue, 6 Mar 2012 21:27:44 +0000 [thread overview]
Message-ID: <201203062127.44463.arnd@arndb.de> (raw)
In-Reply-To: <1331068084-17911-3-git-send-email-eric.andersson@unixphere.com>
On Tuesday 06 March 2012, Eric Andersson wrote:
> The bmp18x chip family comes in an I2C respectively SPI variant.
> Hence, the bmp085 driver was split to support both buses.
>
> Tested-by: Zhengguang Guo <zhengguang.guo@bosch-sensortec.com>
> Reviewed-by: Stefan Nilsson <stefan.nilsson@unixphere.com>
> Signed-off-by: Eric Andersson <eric.andersson@unixphere.com>
(adding Mark Brown to Cc)
I don't know much about regmap, but your description sounds like you
should be using it here, to simplify the differences between i2c and
spi in your driver instead of implementing your own abstraction
layer.
> config BMP085
> tristate "BMP085 digital pressure sensor"
> - depends on I2C && SYSFS
> + depends on (I2C || SPI_MASTER) && SYSFS
> help
> - If you say yes here you get support for the Bosch Sensortec
> - BMP085 digital pressure sensor.
> + Say Y here if you want support for Bosch Sensortec's digital
> + pressure sensors BMP085 and BMP18x.
>
> To compile this driver as a module, choose M here: the
> module will be called bmp085.
>
> +config BMP085_I2C
> + tristate "support I2C bus connection"
> + depends on BMP085 && I2C
> + help
> + Say Y here if you want to support Bosch Sensortec's digital pressure
> + sensor hooked to an I2C bus.
> +
> + To compile this driver as a module, choose M here: the
> + module will be called bmp085-i2c.
> +
> +config BMP085_SPI
> + tristate "support SPI bus connection"
> + depends on BMP085 && SPI_MASTER
> + help
> + Say Y here if you want to support Bosch Sensortec's digital pressure
> + sensor hooked to an SPI bus.
> +
> + To compile this driver as a module, choose M here: the
> + module will be called bmp085-spi.
> +
IMHO this would be better expressed if you make CONFIG_BMP085 a hidden
option that is selected when either BMP085_I2C or BMP085_SPI are enabled.
Otherwise you make it possible to build just the base driver but neither
of the front-ends, which is a bit pointless.
> }
> +EXPORT_SYMBOL(bmp085_probe);
>
When you add internal symbols inside of your driver, best always use
EXPORT_SYMBOL_GPL. There is little practical difference here, but it
helps to get used to just always pick that as a default.
Arnd
next prev parent reply other threads:[~2012-03-06 21:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-06 21:08 [PATCHv2 0/3] Add support for bmp18x to bmp085 Eric Andersson
2012-03-06 21:08 ` [PATCHv2 1/3] misc: clean up bmp085 driver Eric Andersson
2012-03-06 21:20 ` Arnd Bergmann
2012-03-12 22:53 ` Eric Andersson
2012-03-13 12:04 ` Arnd Bergmann
2012-03-06 21:08 ` [PATCHv2 2/3] misc: add support for bmp18x chips to the " Eric Andersson
2012-03-06 21:27 ` Arnd Bergmann [this message]
2012-03-06 22:17 ` Eric Andersson
2012-03-07 0:03 ` Mark Brown
2012-03-06 21:08 ` [PATCHv2 3/3] misc: rename bmp085 to bmp18x Eric Andersson
2012-03-06 21:14 ` Arnd Bergmann
2012-03-06 21:37 ` Alan Cox
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=201203062127.44463.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=eric.andersson@unixphere.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peter.moeller@cn.bosch.com \
--cc=zhengguang.guo@bosch-sensortec.com \
/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