diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/board-colibri_t20.c | 61 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-colibri_t20.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-colibri_t30.c | 50 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-colibri_t30.h | 2 |
4 files changed, 100 insertions, 15 deletions
diff --git a/arch/arm/mach-tegra/board-colibri_t20.c b/arch/arm/mach-tegra/board-colibri_t20.c index 6f2c91852b12..dcbacc68c3e7 100644 --- a/arch/arm/mach-tegra/board-colibri_t20.c +++ b/arch/arm/mach-tegra/board-colibri_t20.c @@ -36,6 +36,9 @@ #include <mach/usb_phy.h> #include <mach/w1.h> +#include <media/soc_camera.h> +#include <media/tegra_v4l2_camera.h> + #include "board-colibri_t20.h" #include "board.h" #include "clock.h" @@ -75,14 +78,54 @@ void *get_colibri_t20_audio_platform_data(void) } EXPORT_SYMBOL(get_colibri_t20_audio_platform_data); -#ifdef CONFIG_TEGRA_CAMERA /* Camera */ + +#ifdef CONFIG_TEGRA_CAMERA static struct platform_device tegra_camera = { .name = "tegra_camera", .id = -1, }; #endif /* CONFIG_TEGRA_CAMERA */ +#ifdef CONFIG_VIDEO_TEGRA +static void tegra_camera_disable(struct nvhost_device *ndev) +{ +} + +static int tegra_camera_enable(struct nvhost_device *ndev) +{ + return 0; +} + +static struct tegra_camera_platform_data tegra_camera_platform_data = { + .disable_camera = tegra_camera_disable, + .enable_camera = tegra_camera_enable, + .flip_h = 0, + .flip_v = 0, + .port = TEGRA_CAMERA_PORT_VIP, +}; + +static struct i2c_board_info camera_i2c = { +#ifdef CONFIG_SOC_CAMERA_MAX9526 + I2C_BOARD_INFO("max9526", 0x21), +#endif +}; + +static struct soc_camera_link iclink = { + .board_info = &camera_i2c, + .bus_id = -1, /* This must match the .id of tegra_vi01_device */ + .i2c_adapter_id = 0, +}; + +static struct platform_device soc_camera = { + .name = "soc-camera-pdrv", + .id = 0, + .dev = { + .platform_data = &iclink, + }, +}; +#endif /* CONFIG_VIDEO_TEGRA */ + /* Clocks */ static struct tegra_clk_init_table colibri_t20_clk_init_table[] __initdata = { /* name parent rate enabled */ @@ -264,17 +307,6 @@ static struct i2c_board_info colibri_t20_i2c_bus1_board_info[] __initdata = { I2C_BOARD_INFO("fusion_F0710A", 0x10), }, #endif /* CONFIG_TOUCHSCREEN_FUSION_F0710A */ -#ifdef CONFIG_VIDEO_ADV7180 - { - I2C_BOARD_INFO("adv7180", 0x21), - }, -#endif /* CONFIG_VIDEO_ADV7180 */ -#ifdef CONFIG_VIDEO_MT9V111 - { - I2C_BOARD_INFO("mt9v111", 0x5c), - .platform_data = (void *)&camera_mt9v111_data, - }, -#endif /* CONFIG_VIDEO_MT9V111 */ }; static struct tegra_i2c_platform_data colibri_t20_i2c1_platform_data = { @@ -1301,6 +1333,11 @@ static void __init colibri_t20_init(void) colibri_t20_gpio_init(); colibri_t20_register_spidev(); +#ifdef CONFIG_VIDEO_TEGRA + t20_get_tegra_vi01_device()->dev.platform_data = &tegra_camera_platform_data; + platform_device_register(&soc_camera); +#endif /* CONFIG_VIDEO_TEGRA */ + tegra_release_bootloader_fb(); } diff --git a/arch/arm/mach-tegra/board-colibri_t20.h b/arch/arm/mach-tegra/board-colibri_t20.h index 09d5c3175b7f..8dc8d46c79d0 100644 --- a/arch/arm/mach-tegra/board-colibri_t20.h +++ b/arch/arm/mach-tegra/board-colibri_t20.h @@ -19,7 +19,7 @@ /* Uncomment for camera interface support on Colibri Evaluation carrier board */ -#ifdef CONFIG_TEGRA_CAMERA +#if defined(CONFIG_TEGRA_CAMERA) || defined(CONFIG_VIDEO_TEGRA) #define COLIBRI_T20_VI #endif diff --git a/arch/arm/mach-tegra/board-colibri_t30.c b/arch/arm/mach-tegra/board-colibri_t30.c index f08b38b6cbbe..f56750c36cdb 100644 --- a/arch/arm/mach-tegra/board-colibri_t30.c +++ b/arch/arm/mach-tegra/board-colibri_t30.c @@ -36,6 +36,9 @@ #include <mach/usb_phy.h> #include <mach/w1.h> +#include <media/soc_camera.h> +#include <media/tegra_v4l2_camera.h> + #include "board-colibri_t30.h" #include "board.h" #include "clock.h" @@ -78,14 +81,54 @@ static struct platform_device colibri_t30_audio_sgtl5000_device = { }, }; -#ifdef CONFIG_TEGRA_CAMERA /* Camera */ + +#ifdef CONFIG_TEGRA_CAMERA static struct platform_device tegra_camera = { .name = "tegra_camera", .id = -1, }; #endif /* CONFIG_TEGRA_CAMERA */ +#ifdef CONFIG_VIDEO_TEGRA +static void tegra_camera_disable(struct nvhost_device *ndev) +{ +} + +static int tegra_camera_enable(struct nvhost_device *ndev) +{ + return 0; +} + +static struct tegra_camera_platform_data tegra_camera_platform_data = { + .disable_camera = tegra_camera_disable, + .enable_camera = tegra_camera_enable, + .flip_h = 0, + .flip_v = 0, + .port = TEGRA_CAMERA_PORT_VIP, +}; + +static struct i2c_board_info camera_i2c = { +#ifdef CONFIG_SOC_CAMERA_MAX9526 + I2C_BOARD_INFO("max9526", 0x21), +#endif +}; + +static struct soc_camera_link iclink = { + .board_info = &camera_i2c, + .bus_id = -1, /* This must match the .id of tegra_vi01_device */ + .i2c_adapter_id = 0, +}; + +static struct platform_device soc_camera = { + .name = "soc-camera-pdrv", + .id = 0, + .dev = { + .platform_data = &iclink, + }, +}; +#endif /* CONFIG_VIDEO_TEGRA */ + /* Clocks */ static struct tegra_clk_init_table colibri_t30_clk_init_table[] __initdata = { /* name parent rate enabled */ @@ -1193,6 +1236,11 @@ static void __init colibri_t30_init(void) colibri_t30_emc_init(); colibri_t30_register_spidev(); +#ifdef CONFIG_VIDEO_TEGRA + t30_get_tegra_vi01_device()->dev.platform_data = &tegra_camera_platform_data; + platform_device_register(&soc_camera); +#endif /* CONFIG_VIDEO_TEGRA */ + tegra_release_bootloader_fb(); #ifdef CONFIG_TEGRA_WDT_RECOVERY tegra_wdt_recovery_init(); diff --git a/arch/arm/mach-tegra/board-colibri_t30.h b/arch/arm/mach-tegra/board-colibri_t30.h index 4244a007ee72..babd6943add3 100644 --- a/arch/arm/mach-tegra/board-colibri_t30.h +++ b/arch/arm/mach-tegra/board-colibri_t30.h @@ -28,7 +28,7 @@ /* Uncomment for camera interface support on Colibri Evaluation carrier board */ -#ifdef CONFIG_TEGRA_CAMERA +#if defined(CONFIG_TEGRA_CAMERA) || defined(CONFIG_VIDEO_TEGRA) #define COLIBRI_T30_VI #endif |