Skip to content

Commit

Permalink
drivers: sensors: Separate ancora and apache sensors
Browse files Browse the repository at this point in the history
* The following method is not a right way
 ifdef CONFIG_MACH_APACHE
  include "bma250.c"
 else
  include "bma222.c"
 endif
  • Loading branch information
sirmordred committed Jun 15, 2015
1 parent e2409f0 commit 4485f5d
Show file tree
Hide file tree
Showing 9 changed files with 2,294 additions and 1,182 deletions.
2 changes: 1 addition & 1 deletion arch/arm/configs/ancora_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2974,7 +2974,7 @@ CONFIG_DPRAM_WHITELIST=y
#
# Samsung Galaxy W/Exhibit 4G/Rugby Smart sensor drivers
#
CONFIG_SENSORS_BMA023_ACCEL=y
CONFIG_SENSORS_BMA222=y
CONFIG_INPUT_BMA023_POSITION=0
CONFIG_OPTICAL_GP2A=y
CONFIG_SENSORS_AK8975=y
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/configs/apache_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2969,7 +2969,7 @@ CONFIG_HAVE_CLK_PREPARE=y
CONFIG_DPRAM=y
# CONFIG_ENABLE_TTY_CIQ is not set
CONFIG_DPRAM_WHITELIST=y
CONFIG_SENSORS_BMA023_ACCEL=y
CONFIG_SENSORS_BMA250=y
CONFIG_INPUT_BMA023_POSITION=0
CONFIG_OPTICAL_GP2A=y
CONFIG_SENSORS_AK8975=y
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-msm/board-ancora.c
Original file line number Diff line number Diff line change
Expand Up @@ -3520,7 +3520,7 @@ static struct platform_device fmradio_i2c_gpio_device = {
};
#endif

#ifdef CONFIG_SENSORS_BMA023_ACCEL
#ifdef CONFIG_SENSORS_BMA222
static struct i2c_gpio_platform_data acc_i2c_gpio_data = {
.sda_pin = 149,
.scl_pin = 148,
Expand Down Expand Up @@ -5462,7 +5462,7 @@ static struct platform_device *devices[] __initdata = {
&opt_i2c_gpio_device,
&opt_gp2a,
#endif
#ifdef CONFIG_SENSORS_BMA023_ACCEL
#ifdef CONFIG_SENSORS_BMA222
&acc_i2c_gpio_device,
#endif
#ifdef CONFIG_SENSORS_AK8975
Expand Down Expand Up @@ -7172,7 +7172,7 @@ else
}
#endif

#ifdef CONFIG_SENSORS_BMA023_ACCEL
#ifdef CONFIG_SENSORS_BMA222
if(board_hw_revision >0)
{
i2c_register_board_info(8, acc_i2c_devices,
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-msm/board-apache.c
Original file line number Diff line number Diff line change
Expand Up @@ -3752,7 +3752,7 @@ static struct platform_device fmradio_i2c_gpio_device = {
};
#endif

#ifdef CONFIG_SENSORS_BMA023_ACCEL
#ifdef CONFIG_SENSORS_BMA250
static struct i2c_gpio_platform_data acc_i2c_gpio_data = {
.sda_pin = 149,
.scl_pin = 148,
Expand Down Expand Up @@ -5984,7 +5984,7 @@ static struct platform_device *devices[] __initdata = {
&opt_i2c_gpio_device,
&opt_gp2a,
#endif
#ifdef CONFIG_SENSORS_BMA023_ACCEL
#ifdef CONFIG_SENSORS_BMA250
&acc_i2c_gpio_device,
#endif
#ifdef CONFIG_SENSORS_AK8975
Expand Down Expand Up @@ -7706,7 +7706,7 @@ static void __init msm7x30_init(void)
}
#endif

#ifdef CONFIG_SENSORS_BMA023_ACCEL
#ifdef CONFIG_SENSORS_BMA250
if(board_hw_revision >0)
{
i2c_register_board_info(8, acc_i2c_devices,
Expand Down
12 changes: 8 additions & 4 deletions drivers/sensors_ancora/Kconfig
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
menu "Samsung Galaxy W/Exhibit 4G/Rugby Smart sensor drivers"

config SENSORS_BMA023_ACCEL
tristate "Bosch BMA023 Acceleration Sensor"
config SENSORS_BMA222
tristate "Bosch BMA222 Acceleration Sensor"
depends on I2C

config SENSORS_BMA250
tristate "Bosch BMA250 Acceleration Sensor"
depends on I2C

config INPUT_BMA023_POSITION
int "BMA023 Mounting Position on Board"
depends on SENSORS_BMA023_ACCEL
int "BMA2x2 Mounting Position on Board"
depends on I2C
default "0"
help
Chip mounting position (pin 1).
Expand Down
3 changes: 2 additions & 1 deletion drivers/sensors_ancora/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
obj-$(CONFIG_SENSORS_BMA023_ACCEL) += bma_accel_driver.o
obj-$(CONFIG_SENSORS_BMA222) += bma222.o
obj-$(CONFIG_SENSORS_BMA250) += bma250.o
obj-$(CONFIG_OPTICAL_GP2A) += gp2a_proximity.o gp2a_rpc.o
obj-$(CONFIG_SENSORS_AK8975) += ak8975.o

0 comments on commit 4485f5d

Please sign in to comment.