diff options
author | Wojciech Bieganski <wbieganski@antmicro.com> | 2016-04-06 10:37:41 +0200 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2016-11-21 15:05:10 +0100 |
commit | 6261e3f9a7a1367fe92cabc7c79cc444a3cca679 (patch) | |
tree | b031731deb3dafb2b61ee382040470b0fb82aa95 | |
parent | 0fc1465eef15c2e0704e38238a82017ca06928f5 (diff) |
media: support for second single-lane decoder (ADV7280M)
Connected to CSI CIL-E. Cameras doesn't work simultaneously.
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Acked-by: Dominik Sliwa <dominik.sliwa@toradex.com>
-rw-r--r-- | arch/arm/mach-tegra/board-ardbeg-sensors.c | 54 | ||||
-rw-r--r-- | drivers/media/platform/soc_camera/tegra_camera/vi2.c | 13 |
2 files changed, 50 insertions, 17 deletions
diff --git a/arch/arm/mach-tegra/board-ardbeg-sensors.c b/arch/arm/mach-tegra/board-ardbeg-sensors.c index da0c4ad5b995..aa241d28c198 100644 --- a/arch/arm/mach-tegra/board-ardbeg-sensors.c +++ b/arch/arm/mach-tegra/board-ardbeg-sensors.c @@ -489,18 +489,19 @@ static struct platform_device ardbeg_tc358743_soc_camera_device = { static int ardbeg_adv7280_power(struct device *dev, int enable) { if(enable) { - tegra_io_dpd_disable(&csia_io); + tegra_io_dpd_disable(&csie_io); } else { - tegra_io_dpd_enable(&csia_io); + tegra_io_dpd_enable(&csie_io); } return 0; } -static struct i2c_board_info ardbeg_adv7280_camera_i2c_device = { - I2C_BOARD_INFO("adv7280", 0x21), + +static struct i2c_board_info ardbeg_adv7280_camera_i2c_device_a = { + I2C_BOARD_INFO("adv7280", 0x20), }; -static struct tegra_camera_platform_data ardbeg_adv7280_camera_platform_data = { +static struct tegra_camera_platform_data ardbeg_adv7280_camera_platform_data_a = { .flip_v = 0, .flip_h = 0, .port = TEGRA_CAMERA_PORT_CSI_A, @@ -508,20 +509,50 @@ static struct tegra_camera_platform_data ardbeg_adv7280_camera_platform_data = { .continuous_clk = 0, }; -static struct soc_camera_link adv7280_iclink = { +static struct soc_camera_link adv7280_iclink_a = { .bus_id = 0, /* This must match the .id of tegra_vi01_device */ - .board_info = &ardbeg_adv7280_camera_i2c_device, + .board_info = &ardbeg_adv7280_camera_i2c_device_a, .module_name = "adv7280", .i2c_adapter_id = 2, .power = ardbeg_adv7280_power, - .priv = &ardbeg_adv7280_camera_platform_data, + .priv = &ardbeg_adv7280_camera_platform_data_a, }; -static struct platform_device ardbeg_adv7280_soc_camera_device = { +static struct platform_device ardbeg_adv7280_soc_camera_device_a = { .name = "soc-camera-pdrv", .id = 5, .dev = { - .platform_data = &adv7280_iclink, + .platform_data = &adv7280_iclink_a, + }, +}; + +/* second ADV7280M connected to CSI CIL-E */ +static struct i2c_board_info ardbeg_adv7280_camera_i2c_device_b = { + I2C_BOARD_INFO("adv7280", 0x21), +}; + +static struct tegra_camera_platform_data ardbeg_adv7280_camera_platform_data_b = { + .flip_v = 0, + .flip_h = 0, + .port = TEGRA_CAMERA_PORT_CSI_C, + .lanes = 1, + .continuous_clk = 0, +}; + +static struct soc_camera_link adv7280_iclink_b = { + .bus_id = 0, /* This must match the .id of tegra_vi01_device */ + .board_info = &ardbeg_adv7280_camera_i2c_device_b, + .module_name = "adv7280", + .i2c_adapter_id = 2, + .power = ardbeg_adv7280_power, + .priv = &ardbeg_adv7280_camera_platform_data_b, +}; + +static struct platform_device ardbeg_adv7280_soc_camera_device_b = { + .name = "soc-camera-pdrv", + .id = 6, + .dev = { + .platform_data = &adv7280_iclink_b, }, }; #endif @@ -1738,7 +1769,8 @@ static int ardbeg_camera_init(void) platform_device_register(&ardbeg_tc358743_soc_camera_device); #endif #if IS_ENABLED(CONFIG_SOC_CAMERA_ADV7280) - platform_device_register(&ardbeg_adv7280_soc_camera_device); + platform_device_register(&ardbeg_adv7280_soc_camera_device_a); + platform_device_register(&ardbeg_adv7280_soc_camera_device_b); #endif return 0; } diff --git a/drivers/media/platform/soc_camera/tegra_camera/vi2.c b/drivers/media/platform/soc_camera/tegra_camera/vi2.c index 331f35cbd855..99bef12e1b7f 100644 --- a/drivers/media/platform/soc_camera/tegra_camera/vi2.c +++ b/drivers/media/platform/soc_camera/tegra_camera/vi2.c @@ -710,10 +710,10 @@ static int vi2_capture_setup_csi_1(struct tegra_camera_dev *cam, #endif if (pdata->port == TEGRA_CAMERA_PORT_CSI_B) { - TC_VI_REG_WT(cam, TEGRA_CSI_PHY_CILC_CONTROL0, 0x9); - TC_VI_REG_WT(cam, TEGRA_CSI_PHY_CILD_CONTROL0, 0x9); + TC_VI_REG_WT(cam, TEGRA_CSI_PHY_CILC_CONTROL0, 0x49); + TC_VI_REG_WT(cam, TEGRA_CSI_PHY_CILD_CONTROL0, 0x49); } else if (pdata->port == TEGRA_CAMERA_PORT_CSI_C) - TC_VI_REG_WT(cam, TEGRA_CSI_PHY_CILE_CONTROL0, 0x9); + TC_VI_REG_WT(cam, TEGRA_CSI_PHY_CILE_CONTROL0, 0x49); TC_VI_REG_WT(cam, TEGRA_CSI_PIXEL_STREAM_PPB_COMMAND, 0xf007); TC_VI_REG_WT(cam, TEGRA_CSI_CSI_PIXEL_PARSER_B_INTERRUPT_MASK, 0x0); @@ -757,7 +757,9 @@ static int vi2_capture_setup_csi_1(struct tegra_camera_dev *cam, (icd->current_fmt->code == V4L2_MBUS_FMT_VYUY8_2X8) || (icd->current_fmt->code == V4L2_MBUS_FMT_YUYV8_2X8) || (icd->current_fmt->code == V4L2_MBUS_FMT_YVYU8_2X8)) { - /* TBD */ + format = TEGRA_IMAGE_FORMAT_T_U8_Y8__V8_Y8; + data_type = TEGRA_IMAGE_DT_YUV422_8; + image_size = icd->user_width * 2; } else if ((icd->current_fmt->code == V4L2_MBUS_FMT_SBGGR8_1X8) || (icd->current_fmt->code == V4L2_MBUS_FMT_SGBRG8_1X8)) { format = TEGRA_IMAGE_FORMAT_T_L8; @@ -770,8 +772,7 @@ static int vi2_capture_setup_csi_1(struct tegra_camera_dev *cam, image_size = icd->user_width * 10 / 8; } - TC_VI_REG_WT(cam, TEGRA_VI_CSI_1_IMAGE_DEF, - (cam->tpg_mode ? 0 : 1 << 24) | (format << 16) | 0x1); + TC_VI_REG_WT(cam, TEGRA_VI_CSI_1_IMAGE_DEF, ((format << 16) | 0x1)); TC_VI_REG_WT(cam, TEGRA_VI_CSI_1_CSI_IMAGE_DT, data_type); |