linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org
Cc: lars@metafoo.de, denis.ciocca@st.com,
	Jonathan Cameron <jic23@kernel.org>
Subject: [PATCH 2/2] Rework the Makefile / Kconfig for the st accel driver so that all options work.
Date: Sun, 20 Jan 2013 12:56:15 +0000	[thread overview]
Message-ID: <1358686575-16779-2-git-send-email-jic23@kernel.org> (raw)
In-Reply-To: <1358686575-16779-1-git-send-email-jic23@kernel.org>

---
 drivers/iio/accel/Kconfig        | 42 ++--------------------------------------
 drivers/iio/accel/Makefile       |  7 +++++--
 drivers/iio/accel/st_accel_i2c.c |  2 +-
 drivers/iio/accel/st_accel_spi.c |  2 +-
 4 files changed, 9 insertions(+), 44 deletions(-)

diff --git a/drivers/iio/accel/Kconfig b/drivers/iio/accel/Kconfig
index dbc1af0..c396ae1 100644
--- a/drivers/iio/accel/Kconfig
+++ b/drivers/iio/accel/Kconfig
@@ -40,55 +40,17 @@ config IIO_ST_ACCEL_3AXIS
 	  - st_accel_i2c (necessary for the I2C devices [optional*]);
 	  - st_accel_spi (necessary for the SPI devices [optional*]);
 	  - st_accel_buffer (necessary for triggered buffer [optional]);
-	  
-	  (*) one of these is necessary to do something.
-
-config IIO_ST_ACCEL_I2C_3AXIS
-	tristate
-	depends on IIO_ST_ACCEL_3AXIS
-
-config IIO_ST_ACCEL_SPI_3AXIS
-	tristate
-	depends on IIO_ST_ACCEL_3AXIS
-
-config IIO_ST_ACCEL_BUFFER
-	tristate
-	depends on IIO_ST_ACCEL_3AXIS
-	depends on (IIO_ST_ACCEL_I2C_3AXIS || IIO_ST_ACCEL_SPI_3AXIS)
-
-config IIO_ST_ACCEL_3AXIS
-	tristate "STMicroelectronics accelerometers 3-Axis Driver"
-	depends on (I2C || SPI_MASTER) && SYSFS
-	select IIO_ST_SENSORS_CORE
-	select IIO_ST_ACCEL_I2C_3AXIS if (I2C)
-	select IIO_ST_ACCEL_SPI_3AXIS if (SPI_MASTER)
-	select IIO_TRIGGERED_BUFFER if (IIO_BUFFER)
-	select IIO_ST_ACCEL_BUFFER if (IIO_TRIGGERED_BUFFER)
-	help
-	  Say yes here to build support for STMicroelectronics accelerometers:
-	  LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC,
-	  LIS331DLH, LSM303DL, LSM303DLM, LSM330.
 
-	  This driver can also be built as a module. If so, will be created
-	  these modules:
-	  - st_accel_core (core functions for the driver [it is mandatory]);
-	  - st_accel_i2c (necessary for the I2C devices [optional*]);
-	  - st_accel_spi (necessary for the SPI devices [optional*]);
-	  - st_accel_buffer (necessary for triggered buffer [optional]);
-	  
 	  (*) one of these is necessary to do something.
 
 config IIO_ST_ACCEL_I2C_3AXIS
 	tristate
 	depends on IIO_ST_ACCEL_3AXIS
+	depends on IIO_ST_SENSORS_I2C
 
 config IIO_ST_ACCEL_SPI_3AXIS
 	tristate
 	depends on IIO_ST_ACCEL_3AXIS
-
-config IIO_ST_ACCEL_BUFFER
-	tristate
-	depends on IIO_ST_ACCEL_3AXIS
-	depends on (IIO_ST_ACCEL_I2C_3AXIS || IIO_ST_ACCEL_SPI_3AXIS)
+	depends on IIO_ST_SENSORS_SPI
 
 endmenu
diff --git a/drivers/iio/accel/Makefile b/drivers/iio/accel/Makefile
index 820c17a..8d7a1c6 100644
--- a/drivers/iio/accel/Makefile
+++ b/drivers/iio/accel/Makefile
@@ -5,7 +5,10 @@
 obj-$(CONFIG_HID_SENSOR_ACCEL_3D) += hid-sensor-accel-3d.o
 obj-$(CONFIG_KXSD9)	+= kxsd9.o
 
-obj-$(CONFIG_IIO_ST_ACCEL_3AXIS) += st_accel_core.o
+obj-$(CONFIG_IIO_ST_ACCEL_3AXIS) += st_accel.o
+st_accel-y := st_accel_core.o
+st_accel-$(CONFIG_IIO_BUFFER) += st_accel_buffer.o
+
 obj-$(CONFIG_IIO_ST_ACCEL_I2C_3AXIS) += st_accel_i2c.o
 obj-$(CONFIG_IIO_ST_ACCEL_SPI_3AXIS) += st_accel_spi.o
-obj-$(CONFIG_IIO_ST_ACCEL_BUFFER) += st_accel_buffer.o
+
diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c
index e782717..066a9fb 100644
--- a/drivers/iio/accel/st_accel_i2c.c
+++ b/drivers/iio/accel/st_accel_i2c.c
@@ -17,7 +17,7 @@
 
 #include <linux/iio/accel/st_accel.h>
 #include <linux/iio/common/st_sensors.h>
-
+#include <linux/iio/common/st_i2c.h>
 
 static int st_accel_i2c_probe(struct i2c_client *client,
 						const struct i2c_device_id *id)
diff --git a/drivers/iio/accel/st_accel_spi.c b/drivers/iio/accel/st_accel_spi.c
index 92e78ba..67532eb 100644
--- a/drivers/iio/accel/st_accel_spi.c
+++ b/drivers/iio/accel/st_accel_spi.c
@@ -17,7 +17,7 @@
 
 #include <linux/iio/accel/st_accel.h>
 #include <linux/iio/common/st_sensors.h>
-
+#include <linux/iio/common/st_spi.h>
 
 static int st_accel_spi_probe(struct spi_device *spi)
 {
-- 
1.8.1


      reply	other threads:[~2013-01-20 12:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-18 16:58 STMicroelectronics drivers Denis CIOCCA
2013-01-18 16:58 ` [PATCH 1/4] iio:common: Add STMicroelectronics common library Denis CIOCCA
2013-01-18 16:58 ` [PATCH 2/4] iio:accel: Add STMicroelectronics accelerometers driver Denis CIOCCA
2013-01-18 16:58 ` [PATCH 3/4] iio:gyro: Add STMicroelectronics gyroscopes driver Denis CIOCCA
2013-01-18 16:58 ` [PATCH 4/4] iio:magnetometer: Add STMicroelectronics magnetometers driver Denis CIOCCA
2013-01-20 12:54 ` STMicroelectronics drivers Jonathan Cameron
2013-01-20 12:56   ` [PATCH 1/2] Make the st_sensors core library stuff build in all combinations Jonathan Cameron
2013-01-20 12:56     ` Jonathan Cameron [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=1358686575-16779-2-git-send-email-jic23@kernel.org \
    --to=jic23@kernel.org \
    --cc=denis.ciocca@st.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.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).