Title: [6936] trunk/drivers/input/misc/Kconfig: [#5146] Develop Linux driver for ADXL345/346 Three-Axis Digital
- Revision
- 6936
- Author
- hennerich
- Date
- 2009-07-07 02:55:01 -0500 (Tue, 07 Jul 2009)
Log Message
[#5146] Develop Linux driver for ADXL345/346 Three-Axis Digital
Accelerometers
From: Chris Verges <[email protected]>
I'd like to propose a slight change to the Kconfig for the adxl34x
driver. The original Kconfig listed two entries in the
drivers/input/misc menu:
[ ] ADXL345/346 Three-Axis Digital Accelerometer: I2C Interface
[ ] ADXL345/346 Three-Axis Digital Accelerometer: SPI Interface
If the I2C option was selected, the SPI option would disappear. If the
SPI option was selected, the I2C interface would still show. This is in
addition to both lines being compiled as the same driver (adxl34x) with
no way to tell I2C versus SPI apart.
In an attempt to simplify the interface, the changes made to the Kconfig
attached would put a single line in the menu, with a choice prompt to
select the communication method desired:
[ ] ADXL345/346 Three-Axis Digital Accelerometer
ADXL345/346 Communication Method (I2C Interface) --->
Modified Paths
Diff
Modified: trunk/drivers/input/misc/Kconfig (6935 => 6936)
--- trunk/drivers/input/misc/Kconfig 2009-07-07 07:41:50 UTC (rev 6935)
+++ trunk/drivers/input/misc/Kconfig 2009-07-07 07:55:01 UTC (rev 6936)
@@ -250,38 +250,48 @@
To compile this driver as a module, choose M here: the
module will be called rb532_button.
-config INPUT_ADXL34X_I2C
- tristate "ADXL345/346 Three-Axis Digital Accelerometer: I2C Interface"
- depends on I2C
- select INPUT_ADXL34X
+config INPUT_ADXL34X
+ tristate "ADXL345/346 Three-Axis Digital Accelerometer"
+ depends on I2C || SPI_MASTER
+ default n
help
Say Y here if you have a Accelerometer interface using the
ADXL345/6 controller, and your board-specific initialization
- code includes that in its table of I2C devices.
+ code includes that in its table of devices.
+ This driver can use either I2C or SPI communication to the
+ ADXL345/6 controller. Select the appropriate method for
+ your system.
+
If unsure, say N (but it's safe to say "Y").
To compile this driver as a module, choose M here: the
module will be called adxl34x.
+choice
+ prompt "ADXL345/346 Communication Method"
+ depends on INPUT_ADXL34X
+ default INPUT_ADXL34X_I2C if I2C
+ default INPUT_ADXL34X_SPI if (!I2C) && SPI_MASTER
+
+config INPUT_ADXL34X_I2C
+ bool "I2C Interface"
+ depends on I2C
+ help
+ Select this if you have a Accelerometer interface using the
+ ADXL345/6 controller, and your board-specific initialization
+ code includes that in its table of I2C devices.
+
config INPUT_ADXL34X_SPI
- tristate "ADXL345/346 Three-Axis Digital Accelerometer: SPI Interface"
- depends on SPI_MASTER && INPUT_ADXL34X_I2C = n
- select INPUT_ADXL34X
+ bool "SPI Interface"
+ depends on SPI_MASTER
help
- Say Y here if you have a Accelerometer interface using the
+ Select this if you have a Accelerometer interface using the
ADXL345/6 controller, and your board-specific initialization
code includes that in its table of SPI devices.
- If unsure, say N (but it's safe to say "Y").
+endchoice
- To compile this driver as a module, choose M here: the
- module will be called adxl34x.
-
-config INPUT_ADXL34X
- tristate
- default n
-
config INPUT_PCF8574
tristate "PCF8574 Keypad input device"
depends on I2C && EXPERIMENTAL
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits