summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-ventana-sensors.c
diff options
context:
space:
mode:
authorErik Lilliebjerg <elilliebjerg@nvidia.com>2011-03-10 01:55:35 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:46:16 -0800
commit9ceb5147d3c18a785579a1c4db0c5a9f95aad7fb (patch)
treed5b698d8a41630ccd2c7382465636ee1923dfdf3 /arch/arm/mach-tegra/board-ventana-sensors.c
parent071e09f316d41cfaaa5158ec246c2ef0d5ca9923 (diff)
ARM: tegra: ventana: SSL3250A board level support.
Add board level support for camera SSL3250A flash. Bug 778859 Original-Change-Id: I7375757546d7ed54dace9f9cd03adeee84959126 Reviewed-on: http://git-master/r/26903 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: Rc70a0c3f24d788455cef90068d06cb8cb771dce9
Diffstat (limited to 'arch/arm/mach-tegra/board-ventana-sensors.c')
-rw-r--r--arch/arm/mach-tegra/board-ventana-sensors.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-ventana-sensors.c b/arch/arm/mach-tegra/board-ventana-sensors.c
index 57af9431f5f9..2157db9c86cc 100644
--- a/arch/arm/mach-tegra/board-ventana-sensors.c
+++ b/arch/arm/mach-tegra/board-ventana-sensors.c
@@ -31,6 +31,7 @@
#include <media/ov5650.h>
#include <media/ov2710.h>
+#include <media/ssl3250a.h>
#include <generated/mach-types.h>
#include "gpio-names.h"
@@ -41,8 +42,14 @@
#define AKM8975_IRQ_GPIO TEGRA_GPIO_PN5
#define CAMERA_POWER_GPIO TEGRA_GPIO_PV4
#define CAMERA_CSI_MUX_SEL_GPIO TEGRA_GPIO_PBB4
+#define CAMERA_FLASH_ACT_GPIO TEGRA_GPIO_PD2
+#define CAMERA_FLASH_STRB_GPIO TEGRA_GPIO_PA0
#define AC_PRESENT_GPIO TEGRA_GPIO_PV3
#define NCT1008_THERM2_GPIO TEGRA_GPIO_PN6
+#define CAMERA_FLASH_OP_MODE 0 /*0=I2C mode, 1=GPIO mode*/
+#define CAMERA_FLASH_MAX_LED_AMP 7
+#define CAMERA_FLASH_MAX_TORCH_AMP 11
+#define CAMERA_FLASH_MAX_FLASH_AMP 31
extern void tegra_throttling_enable(bool enable);
@@ -144,6 +151,53 @@ struct ov2710_platform_data ventana_ov2710_data = {
.power_off = ventana_ov2710_power_off,
};
+static int ventana_ssl3250a_init(void)
+{
+ gpio_request(CAMERA_FLASH_ACT_GPIO, "torch_gpio_act");
+ gpio_direction_output(CAMERA_FLASH_ACT_GPIO, 0);
+ tegra_gpio_enable(CAMERA_FLASH_ACT_GPIO);
+ gpio_request(CAMERA_FLASH_STRB_GPIO, "torch_gpio_strb");
+ gpio_direction_output(CAMERA_FLASH_STRB_GPIO, 0);
+ tegra_gpio_enable(CAMERA_FLASH_STRB_GPIO);
+ gpio_export(CAMERA_FLASH_STRB_GPIO, false);
+ return 0;
+}
+
+static void ventana_ssl3250a_exit(void)
+{
+ gpio_set_value(CAMERA_FLASH_STRB_GPIO, 0);
+ gpio_free(CAMERA_FLASH_STRB_GPIO);
+ tegra_gpio_disable(CAMERA_FLASH_STRB_GPIO);
+ gpio_set_value(CAMERA_FLASH_ACT_GPIO, 0);
+ gpio_free(CAMERA_FLASH_ACT_GPIO);
+ tegra_gpio_disable(CAMERA_FLASH_ACT_GPIO);
+}
+
+static int ventana_ssl3250a_gpio_strb(int val)
+{
+ gpio_set_value(CAMERA_FLASH_STRB_GPIO, val);
+ return 0;
+};
+
+static int ventana_ssl3250a_gpio_act(int val)
+{
+ gpio_set_value(CAMERA_FLASH_ACT_GPIO, val);
+ return 0;
+};
+
+static struct ssl3250a_platform_data ventana_ssl3250a_data = {
+ .config = CAMERA_FLASH_OP_MODE,
+ .max_amp_indic = CAMERA_FLASH_MAX_LED_AMP,
+ .max_amp_torch = CAMERA_FLASH_MAX_TORCH_AMP,
+ .max_amp_flash = CAMERA_FLASH_MAX_FLASH_AMP,
+ .init = ventana_ssl3250a_init,
+ .exit = ventana_ssl3250a_exit,
+ .gpio_act = ventana_ssl3250a_gpio_act,
+ .gpio_en1 = NULL,
+ .gpio_en2 = NULL,
+ .gpio_strb = ventana_ssl3250a_gpio_strb,
+};
+
static void ventana_isl29018_init(void)
{
tegra_gpio_enable(ISL29018_IRQ_GPIO);
@@ -227,6 +281,13 @@ static const struct i2c_board_info ventana_i2c3_board_info_pca9546[] = {
},
};
+static const struct i2c_board_info ventana_i2c3_board_info_ssl3250a[] = {
+ {
+ I2C_BOARD_INFO("ssl3250a", 0x30),
+ .platform_data = &ventana_ssl3250a_data,
+ },
+};
+
static struct i2c_board_info ventana_i2c4_board_info[] = {
{
I2C_BOARD_INFO("nct1008", 0x4C),
@@ -287,6 +348,9 @@ int __init ventana_sensors_init(void)
ARRAY_SIZE(ventana_i2c2_board_info));
}
+ i2c_register_board_info(3, ventana_i2c3_board_info_ssl3250a,
+ ARRAY_SIZE(ventana_i2c3_board_info_ssl3250a));
+
i2c_register_board_info(4, ventana_i2c4_board_info,
ARRAY_SIZE(ventana_i2c4_board_info));