summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorRajat Verma <rajat.verma@stericsson.com>2011-10-07 12:13:05 +0530
committerRobert Marklund <robert.marklund@stericsson.com>2011-10-27 16:07:35 +0200
commit42d8cf9a19993e965eade53b70a536c31bdaa83c (patch)
tree9e6e8c838675f9a9d4b3885147ad695bc17275ca /arch
parent2c366acc5ebdfb73658182ff2664183b27d5e44b (diff)
ux500: camera_flash: add platform data for adp1653
board specific information such as enable_gpio and interrupt line information should be obtained using platform_data and not hardcoded inside the driver itself. ST-Ericsson Linux next: NA ST-Ericsson ID: 361940 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I73a0f3e986bd3cbf19a0797190d514af9b84e3df Signed-off-by: Rajat Verma <rajat.verma@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/33282 Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com> Signed-off-by: Robert Marklund <robert.marklund@stericsson.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-ux500/board-mop500-stuib.c23
-rw-r--r--arch/arm/mach-ux500/board-mop500-u8500uib.c14
-rw-r--r--arch/arm/mach-ux500/board-mop500.h10
3 files changed, 43 insertions, 4 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-stuib.c b/arch/arm/mach-ux500/board-mop500-stuib.c
index f704960eb55..ffd065f4627 100644
--- a/arch/arm/mach-ux500/board-mop500-stuib.c
+++ b/arch/arm/mach-ux500/board-mop500-stuib.c
@@ -11,6 +11,7 @@
#include <linux/gpio.h>
#include <linux/interrupt.h>
#include <linux/i2c.h>
+#include <../drivers/staging/camera_flash/adp1653_plat.h>
#include <linux/input/matrix_keypad.h>
#include <asm/mach-types.h>
@@ -108,6 +109,20 @@ static struct i2c_board_info __initdata mop500_i2c0_devices_stuib[] = {
};
/*
+ * Config data for the flash
+ */
+static struct adp1653_platform_data __initdata adp1653_pdata_u8500_uib = {
+ .irq_no = CAMERA_FLASH_INT_PIN
+};
+
+static struct i2c_board_info __initdata mop500_i2c2_devices_stuib[] = {
+ {
+ I2C_BOARD_INFO("adp1653", 0x30),
+ .platform_data = &adp1653_pdata_u8500_uib
+ }
+};
+
+/*
* BU21013 ROHM touchscreen interface on the STUIBs
*/
@@ -247,15 +262,21 @@ void __init mop500_stuib_init(void)
if (machine_is_hrefv60()) {
tsc_plat_device.cs_pin = HREFV60_TOUCH_RST_GPIO;
tsc_plat2_device.cs_pin = HREFV60_TOUCH_RST_GPIO;
+ adp1653_pdata_u8500_uib.enable_gpio =
+ HREFV60_CAMERA_FLASH_ENABLE;
} else {
tsc_plat_device.cs_pin = GPIO_BU21013_CS;
tsc_plat2_device.cs_pin = GPIO_BU21013_CS;
-
+ adp1653_pdata_u8500_uib.enable_gpio =
+ GPIO_CAMERA_FLASH_ENABLE;
}
mop500_uib_i2c_add(0, mop500_i2c0_devices_stuib,
ARRAY_SIZE(mop500_i2c0_devices_stuib));
+ mop500_uib_i2c_add(2, mop500_i2c2_devices_stuib,
+ ARRAY_SIZE(mop500_i2c2_devices_stuib));
+
mop500_uib_i2c_add(3, u8500_i2c3_devices_stuib,
ARRAY_SIZE(u8500_i2c3_devices_stuib));
diff --git a/arch/arm/mach-ux500/board-mop500-u8500uib.c b/arch/arm/mach-ux500/board-mop500-u8500uib.c
index adb6a1a0a3b..1f044b55818 100644
--- a/arch/arm/mach-ux500/board-mop500-u8500uib.c
+++ b/arch/arm/mach-ux500/board-mop500-u8500uib.c
@@ -8,6 +8,7 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/i2c.h>
+#include <../drivers/staging/camera_flash/adp1653_plat.h>
#include <linux/gpio.h>
#include <linux/interrupt.h>
#include <linux/lsm303dlh.h>
@@ -45,6 +46,11 @@ static struct l3g4200d_gyr_platform_data __initdata l3g4200d_pdata_u8500 = {
.negative_y = 0,
.negative_z = 1,
};
+
+static struct adp1653_platform_data __initdata adp1653_pdata_u8500_uib = {
+ .irq_no = CAMERA_FLASH_INT_PIN
+};
+
static struct i2c_board_info __initdata mop500_i2c2_devices_u8500[] = {
{
/* LSM303DLH Accelerometer */
@@ -61,6 +67,10 @@ static struct i2c_board_info __initdata mop500_i2c2_devices_u8500[] = {
I2C_BOARD_INFO("l3g4200d", 0x68),
.platform_data = &l3g4200d_pdata_u8500,
},
+ {
+ I2C_BOARD_INFO("adp1653", 0x30),
+ .platform_data = &adp1653_pdata_u8500_uib
+ }
};
/*
@@ -155,10 +165,14 @@ void __init mop500_u8500uib_init(void)
lsm303dlh_pdata_u8500.irq_a1 = HREFV60_ACCEL_INT1_GPIO;
lsm303dlh_pdata_u8500.irq_a2 = HREFV60_ACCEL_INT2_GPIO;
lsm303dlh_pdata_u8500.irq_m = HREFV60_MAGNET_DRDY_GPIO;
+ adp1653_pdata_u8500_uib.enable_gpio =
+ HREFV60_CAMERA_FLASH_ENABLE;
} else {
lsm303dlh_pdata_u8500.irq_a1 = GPIO_ACCEL_INT1;
lsm303dlh_pdata_u8500.irq_a2 = GPIO_ACCEL_INT2;
lsm303dlh_pdata_u8500.irq_m = GPIO_MAGNET_DRDY;
+ adp1653_pdata_u8500_uib.enable_gpio =
+ GPIO_CAMERA_FLASH_ENABLE;
}
mop500_uib_i2c_add(2, mop500_i2c2_devices_u8500,
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h
index 9e14f6b5b66..fb15b8dbff6 100644
--- a/arch/arm/mach-ux500/board-mop500.h
+++ b/arch/arm/mach-ux500/board-mop500.h
@@ -35,17 +35,21 @@
#define HREFV60_DISP2_RST_GPIO 66
#define HREFV60_MMIO_XENON_CHARGE 170
#define HREFV60_XSHUTDOWN_SECONDARY_SENSOR 140
+#define HREFV60_CAMERA_FLASH_ENABLE 22
#define XSHUTDOWN_PRIMARY_SENSOR 141
#define XSHUTDOWN_SECONDARY_SENSOR 142
-#define CYPRESS_TOUCH_INT_PIN 84
-#define CYPRESS_TOUCH_RST_GPIO 143
-#define CYPRESS_SLAVE_SELECT_GPIO 216
+#define CAMERA_FLASH_INT_PIN 7
+#define CYPRESS_TOUCH_INT_PIN 84
+#define CYPRESS_TOUCH_RST_GPIO 143
+#define CYPRESS_SLAVE_SELECT_GPIO 216
+
/* MOP500 generic GPIOs */
#define MOP500_HDMI_RST_GPIO 196
/* GPIOs on the TC35892 expander */
#define GPIO_MAGNET_DRDY MOP500_EGPIO(1)
#define GPIO_SDMMC_CD MOP500_EGPIO(3)
+#define GPIO_CAMERA_FLASH_ENABLE MOP500_EGPIO(4)
#define GPIO_MMIO_XENON_CHARGE MOP500_EGPIO(5)
#define GPIO_PROX_SENSOR MOP500_EGPIO(7)
#define GPIO_HAL_SENSOR MOP500_EGPIO(8)