From 39989815e732886a763d41b0067eb9ce64a7e84f Mon Sep 17 00:00:00 2001 From: Wojciech Bieganski Date: Thu, 3 Apr 2014 13:13:53 +0200 Subject: media: fixes in board-*.c files for Colibri T20/T30 and Apalis T30 This commit fixes the crash that occures while loading tegra_v4l2_camera module caused by its new features (private data per sensor). updated files: arch/arm/mach-tegra/board-apalis_t30.c arch/arm/mach-tegra/board-colibri_t20.c arch/arm/mach-tegra/board-colibri_t30.c --- arch/arm/mach-tegra/board-apalis_t30.c | 25 +++++++++++++------------ arch/arm/mach-tegra/board-colibri_t20.c | 26 ++++++++++++++------------ arch/arm/mach-tegra/board-colibri_t30.c | 26 ++++++++++++++------------ 3 files changed, 41 insertions(+), 36 deletions(-) diff --git a/arch/arm/mach-tegra/board-apalis_t30.c b/arch/arm/mach-tegra/board-apalis_t30.c index 6b2a39e7bcce..d26991be9e25 100644 --- a/arch/arm/mach-tegra/board-apalis_t30.c +++ b/arch/arm/mach-tegra/board-apalis_t30.c @@ -127,6 +127,7 @@ static struct i2c_board_info camera_i2c_max9526 = { static struct soc_camera_link iclink_max9526 = { .board_info = &camera_i2c_max9526, .bus_id = -1, /* This must match the .id of tegra_vi01_device */ + .priv = &tegra_camera_platform_data, .i2c_adapter_id = 2, }; @@ -141,21 +142,22 @@ static struct platform_device soc_camera_max9526 = { #if defined(CONFIG_VIDEO_ADV7180) || defined(CONFIG_VIDEO_ADV7180_MODULE) static struct i2c_board_info camera_i2c_adv7180 = { - I2C_BOARD_INFO("adv7180", 0x21), + I2C_BOARD_INFO("adv7180", 0x21), }; static struct soc_camera_link iclink_adv7180 = { - .board_info = &camera_i2c_adv7180, - .bus_id = -1, /* This must match the .id of tegra_vi01_device */ - .i2c_adapter_id = 2, + .board_info = &camera_i2c_adv7180, + .bus_id = -1, /* This must match the .id of tegra_vi01_device */ + .priv = &tegra_camera_platform_data, + .i2c_adapter_id = 2, }; static struct platform_device soc_camera_adv7180 = { - .name = "soc-camera-pdrv", - .id = 1, - .dev = { - .platform_data = &iclink_adv7180, - }, + .name = "soc-camera-pdrv", + .id = 1, + .dev = { + .platform_data = &iclink_adv7180, + }, }; #endif /* CONFIG_VIDEO_ADV7180 | CONFIG_VIDEO_ADV7180_MODULE */ @@ -167,6 +169,7 @@ static struct i2c_board_info camera_i2c_tvp5150soc = { static struct soc_camera_link iclink_tvp5150soc = { .board_info = &camera_i2c_tvp5150soc, .bus_id = -1, /* This must match the .id of tegra_vi01_device */ + .priv = &tegra_camera_platform_data, .i2c_adapter_id = 2, }; @@ -187,6 +190,7 @@ static struct i2c_board_info camera_i2c_ov7670soc = { static struct soc_camera_link iclink_ov7670soc = { .board_info = &camera_i2c_ov7670soc, .bus_id = -1, /* This must match the .id of tegra_vi01_device */ + .priv = &tegra_camera_platform_data, .i2c_adapter_id = 2, }; @@ -197,9 +201,7 @@ static struct platform_device soc_camera_ov7670soc = { .platform_data = &iclink_ov7670soc, }, }; - #endif /* CONFIG_SOC_CAMERA_OV7670SOC | CONFIG_SOC_CAMERA_OV7670SOC_MODULE */ - #endif /* CONFIG_VIDEO_TEGRA | CONFIG_VIDEO_TEGRA_MODULE */ /* CAN */ @@ -1427,7 +1429,6 @@ static void __init apalis_t30_init(void) apalis_t30_register_spidev(); #if defined(CONFIG_VIDEO_TEGRA) || defined(CONFIG_VIDEO_TEGRA_MODULE) - t30_get_tegra_vi01_device()->dev.platform_data = &tegra_camera_platform_data; #if defined(CONFIG_SOC_CAMERA_MAX9526) || defined(CONFIG_SOC_CAMERA_MAX9526_MODULE) platform_device_register(&soc_camera_max9526); #endif diff --git a/arch/arm/mach-tegra/board-colibri_t20.c b/arch/arm/mach-tegra/board-colibri_t20.c index e8bb48e27865..0f07ca4b63ed 100644 --- a/arch/arm/mach-tegra/board-colibri_t20.c +++ b/arch/arm/mach-tegra/board-colibri_t20.c @@ -125,12 +125,13 @@ static struct tegra_camera_platform_data tegra_camera_platform_data = { #if defined(CONFIG_SOC_CAMERA_MAX9526) || defined(CONFIG_SOC_CAMERA_MAX9526_MODULE) static struct i2c_board_info camera_i2c_max9526 = { - I2C_BOARD_INFO("max9526", 0x21), + I2C_BOARD_INFO("max9526", 0x20), }; static struct soc_camera_link iclink_max9526 = { .board_info = &camera_i2c_max9526, .bus_id = -1, /* This must match the .id of tegra_vi01_device */ + .priv = &tegra_camera_platform_data, .i2c_adapter_id = 0, }; @@ -145,21 +146,22 @@ static struct platform_device soc_camera_max9526 = { #if defined(CONFIG_VIDEO_ADV7180) || defined(CONFIG_VIDEO_ADV7180_MODULE) static struct i2c_board_info camera_i2c_adv7180 = { - I2C_BOARD_INFO("adv7180", 0x21), + I2C_BOARD_INFO("adv7180", 0x21), }; static struct soc_camera_link iclink_adv7180 = { - .board_info = &camera_i2c_adv7180, - .bus_id = -1, /* This must match the .id of tegra_vi01_device */ - .i2c_adapter_id = 0, + .board_info = &camera_i2c_adv7180, + .bus_id = -1, /* This must match the .id of tegra_vi01_device */ + .priv = &tegra_camera_platform_data, + .i2c_adapter_id = 0, }; static struct platform_device soc_camera_adv7180 = { - .name = "soc-camera-pdrv", - .id = 1, - .dev = { - .platform_data = &iclink_adv7180, - }, + .name = "soc-camera-pdrv", + .id = 1, + .dev = { + .platform_data = &iclink_adv7180, + }, }; #endif /* CONFIG_VIDEO_ADV7180 | CONFIG_VIDEO_ADV7180_MODULE */ @@ -171,6 +173,7 @@ static struct i2c_board_info camera_i2c_tvp5150soc = { static struct soc_camera_link iclink_tvp5150soc = { .board_info = &camera_i2c_tvp5150soc, .bus_id = -1, /* This must match the .id of tegra_vi01_device */ + .priv = &tegra_camera_platform_data, .i2c_adapter_id = 0, }; @@ -191,6 +194,7 @@ static struct i2c_board_info camera_i2c_ov7670soc = { static struct soc_camera_link iclink_ov7670soc = { .board_info = &camera_i2c_ov7670soc, .bus_id = -1, /* This must match the .id of tegra_vi01_device */ + .priv = &tegra_camera_platform_data, .i2c_adapter_id = 0, }; @@ -202,7 +206,6 @@ static struct platform_device soc_camera_ov7670soc = { }, }; #endif /* CONFIG_SOC_CAMERA_OV7670SOC | CONFIG_SOC_CAMERA_OV7670SOC_MODULE */ - #endif /* CONFIG_VIDEO_TEGRA | CONFIG_VIDEO_TEGRA_MODULE */ /* CAN */ @@ -1565,7 +1568,6 @@ static void __init colibri_t20_init(void) colibri_t20_mcp2515_can_init(); #if defined(CONFIG_VIDEO_TEGRA) || defined(CONFIG_VIDEO_TEGRA_MODULE) - t20_get_tegra_vi01_device()->dev.platform_data = &tegra_camera_platform_data; #if defined(CONFIG_SOC_CAMERA_MAX9526) || defined(CONFIG_SOC_CAMERA_MAX9526_MODULE) platform_device_register(&soc_camera_max9526); #endif diff --git a/arch/arm/mach-tegra/board-colibri_t30.c b/arch/arm/mach-tegra/board-colibri_t30.c index c35f2737f9df..1195cb2847b7 100644 --- a/arch/arm/mach-tegra/board-colibri_t30.c +++ b/arch/arm/mach-tegra/board-colibri_t30.c @@ -121,12 +121,13 @@ static struct tegra_camera_platform_data tegra_camera_platform_data = { #if defined(CONFIG_SOC_CAMERA_MAX9526) || defined(CONFIG_SOC_CAMERA_MAX9526_MODULE) static struct i2c_board_info camera_i2c_max9526 = { - I2C_BOARD_INFO("max9526", 0x21), + I2C_BOARD_INFO("max9526", 0x20), }; static struct soc_camera_link iclink_max9526 = { .board_info = &camera_i2c_max9526, .bus_id = -1, /* This must match the .id of tegra_vi01_device */ + .priv = &tegra_camera_platform_data, .i2c_adapter_id = 0, }; @@ -141,21 +142,22 @@ static struct platform_device soc_camera_max9526 = { #if defined(CONFIG_VIDEO_ADV7180) || defined(CONFIG_VIDEO_ADV7180_MODULE) static struct i2c_board_info camera_i2c_adv7180 = { - I2C_BOARD_INFO("adv7180", 0x21), + I2C_BOARD_INFO("adv7180", 0x21), }; static struct soc_camera_link iclink_adv7180 = { - .board_info = &camera_i2c_adv7180, - .bus_id = -1, /* This must match the .id of tegra_vi01_device */ - .i2c_adapter_id = 0, + .board_info = &camera_i2c_adv7180, + .bus_id = -1, /* This must match the .id of tegra_vi01_device */ + .priv = &tegra_camera_platform_data, + .i2c_adapter_id = 0, }; static struct platform_device soc_camera_adv7180 = { - .name = "soc-camera-pdrv", - .id = 1, - .dev = { - .platform_data = &iclink_adv7180, - }, + .name = "soc-camera-pdrv", + .id = 1, + .dev = { + .platform_data = &iclink_adv7180, + }, }; #endif /* CONFIG_VIDEO_ADV7180 | CONFIG_VIDEO_ADV7180_MODULE */ @@ -167,6 +169,7 @@ static struct i2c_board_info camera_i2c_tvp5150soc = { static struct soc_camera_link iclink_tvp5150soc = { .board_info = &camera_i2c_tvp5150soc, .bus_id = -1, /* This must match the .id of tegra_vi01_device */ + .priv = &tegra_camera_platform_data, .i2c_adapter_id = 0, }; @@ -187,6 +190,7 @@ static struct i2c_board_info camera_i2c_ov7670soc = { static struct soc_camera_link iclink_ov7670soc = { .board_info = &camera_i2c_ov7670soc, .bus_id = -1, /* This must match the .id of tegra_vi01_device */ + .priv = &tegra_camera_platform_data, .i2c_adapter_id = 0, }; @@ -198,7 +202,6 @@ static struct platform_device soc_camera_ov7670soc = { }, }; #endif /* CONFIG_SOC_CAMERA_OV7670SOC | CONFIG_SOC_CAMERA_OV7670SOC_MODULE */ - #endif /* CONFIG_VIDEO_TEGRA | CONFIG_VIDEO_TEGRA_MODULE */ /* CAN */ @@ -1546,7 +1549,6 @@ static void __init colibri_t30_init(void) colibri_t30_gpio_init(); #if defined(CONFIG_VIDEO_TEGRA) || defined(CONFIG_VIDEO_TEGRA_MODULE) - t30_get_tegra_vi01_device()->dev.platform_data = &tegra_camera_platform_data; #if defined(CONFIG_SOC_CAMERA_MAX9526) || defined(CONFIG_SOC_CAMERA_MAX9526_MODULE) platform_device_register(&soc_camera_max9526); #endif -- cgit v1.2.3