diff options
author | Sachin Nikam <snikam@nvidia.com> | 2011-01-03 14:14:13 +0530 |
---|---|---|
committer | Bharat Nihalani <bnihalani@nvidia.com> | 2011-01-05 06:32:33 -0800 |
commit | b50be4063e53381cb31822d13a919634e8105f0e (patch) | |
tree | f0b2d8fc4f6044dc6a335eb727fd08001e83dd22 /arch/arm | |
parent | ef110ce0c938c8c2dd6de491a999441c0c10e800 (diff) |
[ARM] tegra: whistler: Camera sensor ov5650
Regestering and intializing tegra_camera and ov5650.
Configuring pinmix for VI.
Change-Id: I7672f5a1e4ef87cc115183395b144a82bb52f9e8
Reviewed-on: http://git-master/r/14773
Tested-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-tegra/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-whistler-pinmux.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-whistler-power.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-whistler-sensors.c | 65 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-whistler.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-whistler.h | 2 |
6 files changed, 82 insertions, 9 deletions
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile index a532e0cce1d1..6aae10e49f90 100644 --- a/arch/arm/mach-tegra/Makefile +++ b/arch/arm/mach-tegra/Makefile @@ -66,4 +66,5 @@ obj-${CONFIG_MACH_WHISTLER} += board-whistler-pinmux.o obj-${CONFIG_MACH_WHISTLER} += board-whistler-sdhci.o obj-${CONFIG_MACH_WHISTLER} += board-whistler-power.o obj-${CONFIG_MACH_WHISTLER} += board-whistler-panel.o +obj-${CONFIG_MACH_WHISTLER} += board-whistler-sensors.o obj-${CONFIG_MACH_WHISTLER} += board-whistler-kbc.o diff --git a/arch/arm/mach-tegra/board-whistler-pinmux.c b/arch/arm/mach-tegra/board-whistler-pinmux.c index c85f72d7ce72..4f78b9814713 100644 --- a/arch/arm/mach-tegra/board-whistler-pinmux.c +++ b/arch/arm/mach-tegra/board-whistler-pinmux.c @@ -48,18 +48,18 @@ static __initdata struct tegra_pingroup_config whistler_pinmux[] = { {TEGRA_PINGROUP_CDEV1, TEGRA_MUX_OSC, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, {TEGRA_PINGROUP_CDEV2, TEGRA_MUX_OSC, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, {TEGRA_PINGROUP_CRTP, TEGRA_MUX_CRT, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, - {TEGRA_PINGROUP_CSUS, TEGRA_MUX_VI_SENSOR_CLK, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, + {TEGRA_PINGROUP_CSUS, TEGRA_MUX_VI_SENSOR_CLK, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, {TEGRA_PINGROUP_DAP1, TEGRA_MUX_DAP1, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, {TEGRA_PINGROUP_DAP2, TEGRA_MUX_DAP2, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, {TEGRA_PINGROUP_DAP3, TEGRA_MUX_DAP3, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, {TEGRA_PINGROUP_DAP4, TEGRA_MUX_DAP4, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, {TEGRA_PINGROUP_DDC, TEGRA_MUX_I2C2, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL}, - {TEGRA_PINGROUP_DTA, TEGRA_MUX_VI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, - {TEGRA_PINGROUP_DTB, TEGRA_MUX_VI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, - {TEGRA_PINGROUP_DTC, TEGRA_MUX_VI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, - {TEGRA_PINGROUP_DTD, TEGRA_MUX_VI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, - {TEGRA_PINGROUP_DTE, TEGRA_MUX_VI, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, - {TEGRA_PINGROUP_DTF, TEGRA_MUX_I2C3, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL}, + {TEGRA_PINGROUP_DTA, TEGRA_MUX_VI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL}, + {TEGRA_PINGROUP_DTB, TEGRA_MUX_VI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL}, + {TEGRA_PINGROUP_DTC, TEGRA_MUX_VI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL}, + {TEGRA_PINGROUP_DTD, TEGRA_MUX_VI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL}, + {TEGRA_PINGROUP_DTE, TEGRA_MUX_RSVD1, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, + {TEGRA_PINGROUP_DTF, TEGRA_MUX_I2C3, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, {TEGRA_PINGROUP_GMA, TEGRA_MUX_GMI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL}, {TEGRA_PINGROUP_GMB, TEGRA_MUX_GMI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL}, {TEGRA_PINGROUP_GMC, TEGRA_MUX_GMI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL}, diff --git a/arch/arm/mach-tegra/board-whistler-power.c b/arch/arm/mach-tegra/board-whistler-power.c index 8bc55aecff15..b1b814be9056 100644 --- a/arch/arm/mach-tegra/board-whistler-power.c +++ b/arch/arm/mach-tegra/board-whistler-power.c @@ -125,7 +125,7 @@ static struct regulator_consumer_supply max8907c_LDO17_supply[] = { }; static struct regulator_consumer_supply max8907c_LDO18_supply[] = { - REGULATOR_SUPPLY("vddio_vi", NULL), + REGULATOR_SUPPLY("vcsi", "tegra_camera"), }; static struct regulator_consumer_supply max8907c_LDO19_supply[] = { diff --git a/arch/arm/mach-tegra/board-whistler-sensors.c b/arch/arm/mach-tegra/board-whistler-sensors.c index 536a871a8303..3d88b981f78b 100644 --- a/arch/arm/mach-tegra/board-whistler-sensors.c +++ b/arch/arm/mach-tegra/board-whistler-sensors.c @@ -20,9 +20,74 @@ #include <linux/i2c.h> #include <mach/gpio.h> +#include <media/ov5650.h> + #include "gpio-names.h" +#define CAMERA_RESET2_SHUTTER_GPIO TEGRA_GPIO_PBB1 +#define CAMERA_PWNDN1_GPIO TEGRA_GPIO_PBB4 +#define CAMERA_PWNDN2_STROBE_GPIO TEGRA_GPIO_PBB5 +#define CAMERA_RESET1_GPIO TEGRA_GPIO_PD2 +#define CAMERA_FLASH_GPIO TEGRA_GPIO_PA0 + +static int whistler_camera_init(void) +{ + tegra_gpio_enable(CAMERA_PWNDN1_GPIO); + gpio_request(CAMERA_PWNDN1_GPIO, "camera_powerdown"); + gpio_direction_output(CAMERA_PWNDN1_GPIO, 0); + gpio_export(CAMERA_PWNDN1_GPIO, false); + + tegra_gpio_enable(CAMERA_RESET1_GPIO); + gpio_request(CAMERA_RESET1_GPIO, "camera_reset1"); + gpio_direction_output(CAMERA_RESET1_GPIO, 1); + gpio_export(CAMERA_RESET1_GPIO, false); + + tegra_gpio_enable(CAMERA_RESET2_SHUTTER_GPIO); + gpio_request(CAMERA_RESET2_SHUTTER_GPIO, "camera_reset2_shutter"); + gpio_direction_output(CAMERA_RESET2_SHUTTER_GPIO, 1); + gpio_export(CAMERA_RESET2_SHUTTER_GPIO, false); + + tegra_gpio_enable(CAMERA_PWNDN2_STROBE_GPIO); + gpio_request(CAMERA_PWNDN2_STROBE_GPIO, "camera_pwrdwn2_strobe"); + gpio_direction_output(CAMERA_PWNDN2_STROBE_GPIO, 0); + gpio_export(CAMERA_PWNDN2_STROBE_GPIO, false); + + tegra_gpio_enable(CAMERA_FLASH_GPIO); + gpio_request(CAMERA_FLASH_GPIO, "camera_flash"); + gpio_direction_output(CAMERA_FLASH_GPIO, 0); + gpio_export(CAMERA_FLASH_GPIO, false); + + return 0; +} + +static int whistler_ov5650_power_on(void) +{ + return 0; +} + +static int whistler_ov5650_power_off(void) +{ + return 0; +} + +struct ov5650_platform_data whistler_ov5650_data = { + .power_on = whistler_ov5650_power_on, + .power_off = whistler_ov5650_power_off, +}; + +static struct i2c_board_info whistler_i2c3_board_info[] = { + { + I2C_BOARD_INFO("ov5650", 0x36), + .platform_data = &whistler_ov5650_data, + }, +}; + int __init whistler_sensors_init(void) { + whistler_camera_init(); + + i2c_register_board_info(3, whistler_i2c3_board_info, + ARRAY_SIZE(whistler_i2c3_board_info)); + return 0; } diff --git a/arch/arm/mach-tegra/board-whistler.c b/arch/arm/mach-tegra/board-whistler.c index cc680262ad44..1f8847c67d14 100644 --- a/arch/arm/mach-tegra/board-whistler.c +++ b/arch/arm/mach-tegra/board-whistler.c @@ -215,6 +215,11 @@ static struct platform_device whistler_scroll_device = { }, }; +static struct platform_device tegra_camera = { + .name = "tegra_camera", + .id = -1, +}; + static struct platform_device *whistler_devices[] __initdata = { &androidusb_device, &debug_uart, @@ -225,6 +230,7 @@ static struct platform_device *whistler_devices[] __initdata = { &tegra_wdt_device, &tegra_avp_device, &whistler_scroll_device, + &tegra_camera, }; static struct synaptics_i2c_rmi_platform_data synaptics_pdata= { @@ -273,6 +279,7 @@ static void __init tegra_whistler_init(void) whistler_i2c_init(); whistler_regulator_init(); whistler_panel_init(); + whistler_sensors_init(); whistler_touch_init(); whistler_kbc_init(); whistler_bt_rfkill(); diff --git a/arch/arm/mach-tegra/board-whistler.h b/arch/arm/mach-tegra/board-whistler.h index 62b682a8b2a9..fabf0ac67b1c 100644 --- a/arch/arm/mach-tegra/board-whistler.h +++ b/arch/arm/mach-tegra/board-whistler.h @@ -22,5 +22,5 @@ int whistler_sdhci_init(void); int whistler_pinmux_init(void); int whistler_panel_init(void); int whistler_kbc_init(void); - +int whistler_sensors_init(void); #endif |