aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@iki.fi>2015-03-25 18:57:30 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-02 15:41:01 -0400
commit6890874772e4c5e2925187f262893df0eb0322ba (patch)
tree474cac6b5ec549f201648746b428a6fa8b6df1ef
parent4c8f14861cccb7b19cfd582e135847aa772f3854 (diff)
[media] omap3isp: Refactor device configuration structs for Device Tree
Make omap3isp configuration data structures more suitable for consumption by the DT by separating the I2C bus information of all the sub-devices in a group and the ISP bus information from each other. The ISP bus information is made a pointer instead of being directly embedded in the struct. In the case of the DT only the sensor specific information on the ISP bus configuration is retained. The structs are renamed to reflect that. After this change the structs needed to describe device configuration can be allocated and accessed separately without those needed only in the case of platform data. The platform data related structs can be later removed once the support for platform data can be removed. Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Acked-by: Igor Grinberg <grinberg@compulab.co.il> (for cm-t35) Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c57
-rw-r--r--drivers/media/platform/omap3isp/isp.c86
-rw-r--r--drivers/media/platform/omap3isp/isp.h2
-rw-r--r--drivers/media/platform/omap3isp/ispccdc.c26
-rw-r--r--drivers/media/platform/omap3isp/ispccp2.c22
-rw-r--r--drivers/media/platform/omap3isp/ispcsi2.c8
-rw-r--r--drivers/media/platform/omap3isp/ispcsiphy.c21
-rw-r--r--include/media/omap3isp.h34
8 files changed, 119 insertions, 137 deletions
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 91738a14ecbe..b5dfbc1b1fc6 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -492,51 +492,36 @@ static struct twl4030_platform_data cm_t35_twldata = {
492#include <media/omap3isp.h> 492#include <media/omap3isp.h>
493#include "devices.h" 493#include "devices.h"
494 494
495static struct i2c_board_info cm_t35_isp_i2c_boardinfo[] = { 495static struct isp_platform_subdev cm_t35_isp_subdevs[] = {
496 { 496 {
497 I2C_BOARD_INFO("mt9t001", 0x5d), 497 .board_info = &(struct i2c_board_info){
498 }, 498 I2C_BOARD_INFO("mt9t001", 0x5d)
499 { 499 },
500 I2C_BOARD_INFO("tvp5150", 0x5c),
501 },
502};
503
504static struct isp_subdev_i2c_board_info cm_t35_isp_primary_subdevs[] = {
505 {
506 .board_info = &cm_t35_isp_i2c_boardinfo[0],
507 .i2c_adapter_id = 3,
508 },
509 { NULL, 0, },
510};
511
512static struct isp_subdev_i2c_board_info cm_t35_isp_secondary_subdevs[] = {
513 {
514 .board_info = &cm_t35_isp_i2c_boardinfo[1],
515 .i2c_adapter_id = 3, 500 .i2c_adapter_id = 3,
516 }, 501 .bus = &(struct isp_bus_cfg){
517 { NULL, 0, }, 502 .interface = ISP_INTERFACE_PARALLEL,
518}; 503 .bus = {
519 504 .parallel = {
520static struct isp_v4l2_subdevs_group cm_t35_isp_subdevs[] = { 505 .clk_pol = 1,
521 { 506 },
522 .subdevs = cm_t35_isp_primary_subdevs,
523 .interface = ISP_INTERFACE_PARALLEL,
524 .bus = {
525 .parallel = {
526 .clk_pol = 1,
527 }, 507 },
528 }, 508 },
529 }, 509 },
530 { 510 {
531 .subdevs = cm_t35_isp_secondary_subdevs, 511 .board_info = &(struct i2c_board_info){
532 .interface = ISP_INTERFACE_PARALLEL, 512 I2C_BOARD_INFO("tvp5150", 0x5c),
533 .bus = { 513 },
534 .parallel = { 514 .i2c_adapter_id = 3,
535 .clk_pol = 0, 515 .bus = &(struct isp_bus_cfg){
516 .interface = ISP_INTERFACE_PARALLEL,
517 .bus = {
518 .parallel = {
519 .clk_pol = 0,
520 },
536 }, 521 },
537 }, 522 },
538 }, 523 },
539 { NULL, 0, }, 524 { 0 },
540}; 525};
541 526
542static struct isp_platform_data cm_t35_isp_pdata = { 527static struct isp_platform_data cm_t35_isp_pdata = {
diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index 537377b43083..1b5c6df3b645 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -447,7 +447,7 @@ static void isp_core_init(struct isp_device *isp, int idle)
447 */ 447 */
448void omap3isp_configure_bridge(struct isp_device *isp, 448void omap3isp_configure_bridge(struct isp_device *isp,
449 enum ccdc_input_entity input, 449 enum ccdc_input_entity input,
450 const struct isp_parallel_platform_data *pdata, 450 const struct isp_parallel_cfg *parcfg,
451 unsigned int shift, unsigned int bridge) 451 unsigned int shift, unsigned int bridge)
452{ 452{
453 u32 ispctrl_val; 453 u32 ispctrl_val;
@@ -462,8 +462,8 @@ void omap3isp_configure_bridge(struct isp_device *isp,
462 switch (input) { 462 switch (input) {
463 case CCDC_INPUT_PARALLEL: 463 case CCDC_INPUT_PARALLEL:
464 ispctrl_val |= ISPCTRL_PAR_SER_CLK_SEL_PARALLEL; 464 ispctrl_val |= ISPCTRL_PAR_SER_CLK_SEL_PARALLEL;
465 ispctrl_val |= pdata->clk_pol << ISPCTRL_PAR_CLK_POL_SHIFT; 465 ispctrl_val |= parcfg->clk_pol << ISPCTRL_PAR_CLK_POL_SHIFT;
466 shift += pdata->data_lane_shift * 2; 466 shift += parcfg->data_lane_shift * 2;
467 break; 467 break;
468 468
469 case CCDC_INPUT_CSI2A: 469 case CCDC_INPUT_CSI2A:
@@ -1809,52 +1809,44 @@ static void isp_unregister_entities(struct isp_device *isp)
1809} 1809}
1810 1810
1811/* 1811/*
1812 * isp_register_subdev_group - Register a group of subdevices 1812 * isp_register_subdev - Register a sub-device
1813 * @isp: OMAP3 ISP device 1813 * @isp: OMAP3 ISP device
1814 * @board_info: I2C subdevs board information array 1814 * @isp_subdev: platform data related to a sub-device
1815 * 1815 *
1816 * Register all I2C subdevices in the board_info array. The array must be 1816 * Register an I2C sub-device which has not been registered by other
1817 * terminated by a NULL entry, and the first entry must be the sensor. 1817 * means (such as the Device Tree).
1818 * 1818 *
1819 * Return a pointer to the sensor media entity if it has been successfully 1819 * Return a pointer to the sub-device if it has been successfully
1820 * registered, or NULL otherwise. 1820 * registered, or NULL otherwise.
1821 */ 1821 */
1822static struct v4l2_subdev * 1822static struct v4l2_subdev *
1823isp_register_subdev_group(struct isp_device *isp, 1823isp_register_subdev(struct isp_device *isp,
1824 struct isp_subdev_i2c_board_info *board_info) 1824 struct isp_platform_subdev *isp_subdev)
1825{ 1825{
1826 struct v4l2_subdev *sensor = NULL; 1826 struct i2c_adapter *adapter;
1827 unsigned int first; 1827 struct v4l2_subdev *sd;
1828 1828
1829 if (board_info->board_info == NULL) 1829 if (isp_subdev->board_info == NULL)
1830 return NULL; 1830 return NULL;
1831 1831
1832 for (first = 1; board_info->board_info; ++board_info, first = 0) { 1832 adapter = i2c_get_adapter(isp_subdev->i2c_adapter_id);
1833 struct v4l2_subdev *subdev; 1833 if (adapter == NULL) {
1834 struct i2c_adapter *adapter; 1834 dev_err(isp->dev,
1835 1835 "%s: Unable to get I2C adapter %d for device %s\n",
1836 adapter = i2c_get_adapter(board_info->i2c_adapter_id); 1836 __func__, isp_subdev->i2c_adapter_id,
1837 if (adapter == NULL) { 1837 isp_subdev->board_info->type);
1838 dev_err(isp->dev, "%s: Unable to get I2C adapter %d for " 1838 return NULL;
1839 "device %s\n", __func__, 1839 }
1840 board_info->i2c_adapter_id,
1841 board_info->board_info->type);
1842 continue;
1843 }
1844
1845 subdev = v4l2_i2c_new_subdev_board(&isp->v4l2_dev, adapter,
1846 board_info->board_info, NULL);
1847 if (subdev == NULL) {
1848 dev_err(isp->dev, "%s: Unable to register subdev %s\n",
1849 __func__, board_info->board_info->type);
1850 continue;
1851 }
1852 1840
1853 if (first) 1841 sd = v4l2_i2c_new_subdev_board(&isp->v4l2_dev, adapter,
1854 sensor = subdev; 1842 isp_subdev->board_info, NULL);
1843 if (sd == NULL) {
1844 dev_err(isp->dev, "%s: Unable to register subdev %s\n",
1845 __func__, isp_subdev->board_info->type);
1846 return NULL;
1855 } 1847 }
1856 1848
1857 return sensor; 1849 return sd;
1858} 1850}
1859 1851
1860static int isp_link_entity( 1852static int isp_link_entity(
@@ -1931,7 +1923,7 @@ static int isp_link_entity(
1931static int isp_register_entities(struct isp_device *isp) 1923static int isp_register_entities(struct isp_device *isp)
1932{ 1924{
1933 struct isp_platform_data *pdata = isp->pdata; 1925 struct isp_platform_data *pdata = isp->pdata;
1934 struct isp_v4l2_subdevs_group *subdevs; 1926 struct isp_platform_subdev *isp_subdev;
1935 int ret; 1927 int ret;
1936 1928
1937 isp->media_dev.dev = isp->dev; 1929 isp->media_dev.dev = isp->dev;
@@ -1989,17 +1981,23 @@ static int isp_register_entities(struct isp_device *isp)
1989 goto done; 1981 goto done;
1990 1982
1991 /* Register external entities */ 1983 /* Register external entities */
1992 for (subdevs = pdata ? pdata->subdevs : NULL; 1984 for (isp_subdev = pdata ? pdata->subdevs : NULL;
1993 subdevs && subdevs->subdevs; ++subdevs) { 1985 isp_subdev && isp_subdev->board_info; isp_subdev++) {
1994 struct v4l2_subdev *sensor; 1986 struct v4l2_subdev *sd;
1995 1987
1996 sensor = isp_register_subdev_group(isp, subdevs->subdevs); 1988 sd = isp_register_subdev(isp, isp_subdev);
1997 if (sensor == NULL) 1989
1990 /*
1991 * No bus information --- this is either a flash or a
1992 * lens subdev.
1993 */
1994 if (!sd || !isp_subdev->bus)
1998 continue; 1995 continue;
1999 1996
2000 sensor->host_priv = subdevs; 1997 sd->host_priv = isp_subdev->bus;
2001 1998
2002 ret = isp_link_entity(isp, &sensor->entity, subdevs->interface); 1999 ret = isp_link_entity(isp, &sd->entity,
2000 isp_subdev->bus->interface);
2003 if (ret < 0) 2001 if (ret < 0)
2004 goto done; 2002 goto done;
2005 } 2003 }
diff --git a/drivers/media/platform/omap3isp/isp.h b/drivers/media/platform/omap3isp/isp.h
index cfdfc8714b6b..b932a6f22b52 100644
--- a/drivers/media/platform/omap3isp/isp.h
+++ b/drivers/media/platform/omap3isp/isp.h
@@ -229,7 +229,7 @@ int omap3isp_pipeline_set_stream(struct isp_pipeline *pipe,
229void omap3isp_pipeline_cancel_stream(struct isp_pipeline *pipe); 229void omap3isp_pipeline_cancel_stream(struct isp_pipeline *pipe);
230void omap3isp_configure_bridge(struct isp_device *isp, 230void omap3isp_configure_bridge(struct isp_device *isp,
231 enum ccdc_input_entity input, 231 enum ccdc_input_entity input,
232 const struct isp_parallel_platform_data *pdata, 232 const struct isp_parallel_cfg *buscfg,
233 unsigned int shift, unsigned int bridge); 233 unsigned int shift, unsigned int bridge);
234 234
235struct isp_device *omap3isp_get(struct isp_device *isp); 235struct isp_device *omap3isp_get(struct isp_device *isp);
diff --git a/drivers/media/platform/omap3isp/ispccdc.c b/drivers/media/platform/omap3isp/ispccdc.c
index 6e0291bca73f..a6a61cce43dd 100644
--- a/drivers/media/platform/omap3isp/ispccdc.c
+++ b/drivers/media/platform/omap3isp/ispccdc.c
@@ -958,11 +958,11 @@ void omap3isp_ccdc_max_rate(struct isp_ccdc_device *ccdc,
958/* 958/*
959 * ccdc_config_sync_if - Set CCDC sync interface configuration 959 * ccdc_config_sync_if - Set CCDC sync interface configuration
960 * @ccdc: Pointer to ISP CCDC device. 960 * @ccdc: Pointer to ISP CCDC device.
961 * @pdata: Parallel interface platform data (may be NULL) 961 * @parcfg: Parallel interface platform data (may be NULL)
962 * @data_size: Data size 962 * @data_size: Data size
963 */ 963 */
964static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc, 964static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc,
965 struct isp_parallel_platform_data *pdata, 965 struct isp_parallel_cfg *parcfg,
966 unsigned int data_size) 966 unsigned int data_size)
967{ 967{
968 struct isp_device *isp = to_isp_device(ccdc); 968 struct isp_device *isp = to_isp_device(ccdc);
@@ -1000,19 +1000,19 @@ static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc,
1000 break; 1000 break;
1001 } 1001 }
1002 1002
1003 if (pdata && pdata->data_pol) 1003 if (parcfg && parcfg->data_pol)
1004 syn_mode |= ISPCCDC_SYN_MODE_DATAPOL; 1004 syn_mode |= ISPCCDC_SYN_MODE_DATAPOL;
1005 1005
1006 if (pdata && pdata->hs_pol) 1006 if (parcfg && parcfg->hs_pol)
1007 syn_mode |= ISPCCDC_SYN_MODE_HDPOL; 1007 syn_mode |= ISPCCDC_SYN_MODE_HDPOL;
1008 1008
1009 /* The polarity of the vertical sync signal output by the BT.656 1009 /* The polarity of the vertical sync signal output by the BT.656
1010 * decoder is not documented and seems to be active low. 1010 * decoder is not documented and seems to be active low.
1011 */ 1011 */
1012 if ((pdata && pdata->vs_pol) || ccdc->bt656) 1012 if ((parcfg && parcfg->vs_pol) || ccdc->bt656)
1013 syn_mode |= ISPCCDC_SYN_MODE_VDPOL; 1013 syn_mode |= ISPCCDC_SYN_MODE_VDPOL;
1014 1014
1015 if (pdata && pdata->fld_pol) 1015 if (parcfg && parcfg->fld_pol)
1016 syn_mode |= ISPCCDC_SYN_MODE_FLDPOL; 1016 syn_mode |= ISPCCDC_SYN_MODE_FLDPOL;
1017 1017
1018 isp_reg_writel(isp, syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); 1018 isp_reg_writel(isp, syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE);
@@ -1115,7 +1115,7 @@ static const u32 ccdc_sgbrg_pattern =
1115static void ccdc_configure(struct isp_ccdc_device *ccdc) 1115static void ccdc_configure(struct isp_ccdc_device *ccdc)
1116{ 1116{
1117 struct isp_device *isp = to_isp_device(ccdc); 1117 struct isp_device *isp = to_isp_device(ccdc);
1118 struct isp_parallel_platform_data *pdata = NULL; 1118 struct isp_parallel_cfg *parcfg = NULL;
1119 struct v4l2_subdev *sensor; 1119 struct v4l2_subdev *sensor;
1120 struct v4l2_mbus_framefmt *format; 1120 struct v4l2_mbus_framefmt *format;
1121 const struct v4l2_rect *crop; 1121 const struct v4l2_rect *crop;
@@ -1145,7 +1145,7 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc)
1145 if (!ret) 1145 if (!ret)
1146 ccdc->bt656 = cfg.type == V4L2_MBUS_BT656; 1146 ccdc->bt656 = cfg.type == V4L2_MBUS_BT656;
1147 1147
1148 pdata = &((struct isp_v4l2_subdevs_group *)sensor->host_priv) 1148 parcfg = &((struct isp_bus_cfg *)sensor->host_priv)
1149 ->bus.parallel; 1149 ->bus.parallel;
1150 } 1150 }
1151 1151
@@ -1175,10 +1175,10 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc)
1175 else 1175 else
1176 bridge = ISPCTRL_PAR_BRIDGE_DISABLE; 1176 bridge = ISPCTRL_PAR_BRIDGE_DISABLE;
1177 1177
1178 omap3isp_configure_bridge(isp, ccdc->input, pdata, shift, bridge); 1178 omap3isp_configure_bridge(isp, ccdc->input, parcfg, shift, bridge);
1179 1179
1180 /* Configure the sync interface. */ 1180 /* Configure the sync interface. */
1181 ccdc_config_sync_if(ccdc, pdata, depth_out); 1181 ccdc_config_sync_if(ccdc, parcfg, depth_out);
1182 1182
1183 syn_mode = isp_reg_readl(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); 1183 syn_mode = isp_reg_readl(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE);
1184 1184
@@ -2417,11 +2417,11 @@ static int ccdc_link_validate(struct v4l2_subdev *sd,
2417 2417
2418 /* We've got a parallel sensor here. */ 2418 /* We've got a parallel sensor here. */
2419 if (ccdc->input == CCDC_INPUT_PARALLEL) { 2419 if (ccdc->input == CCDC_INPUT_PARALLEL) {
2420 struct isp_parallel_platform_data *pdata = 2420 struct isp_parallel_cfg *parcfg =
2421 &((struct isp_v4l2_subdevs_group *) 2421 &((struct isp_bus_cfg *)
2422 media_entity_to_v4l2_subdev(link->source->entity) 2422 media_entity_to_v4l2_subdev(link->source->entity)
2423 ->host_priv)->bus.parallel; 2423 ->host_priv)->bus.parallel;
2424 parallel_shift = pdata->data_lane_shift * 2; 2424 parallel_shift = parcfg->data_lane_shift * 2;
2425 } else { 2425 } else {
2426 parallel_shift = 0; 2426 parallel_shift = 0;
2427 } 2427 }
diff --git a/drivers/media/platform/omap3isp/ispccp2.c b/drivers/media/platform/omap3isp/ispccp2.c
index 44c20fa8501a..38e6a974c5b1 100644
--- a/drivers/media/platform/omap3isp/ispccp2.c
+++ b/drivers/media/platform/omap3isp/ispccp2.c
@@ -201,14 +201,14 @@ static void ccp2_mem_enable(struct isp_ccp2_device *ccp2, u8 enable)
201/* 201/*
202 * ccp2_phyif_config - Initialize CCP2 phy interface config 202 * ccp2_phyif_config - Initialize CCP2 phy interface config
203 * @ccp2: Pointer to ISP CCP2 device 203 * @ccp2: Pointer to ISP CCP2 device
204 * @pdata: CCP2 platform data 204 * @buscfg: CCP2 platform data
205 * 205 *
206 * Configure the CCP2 physical interface module from platform data. 206 * Configure the CCP2 physical interface module from platform data.
207 * 207 *
208 * Returns -EIO if strobe is chosen in CSI1 mode, or 0 on success. 208 * Returns -EIO if strobe is chosen in CSI1 mode, or 0 on success.
209 */ 209 */
210static int ccp2_phyif_config(struct isp_ccp2_device *ccp2, 210static int ccp2_phyif_config(struct isp_ccp2_device *ccp2,
211 const struct isp_ccp2_platform_data *pdata) 211 const struct isp_ccp2_cfg *buscfg)
212{ 212{
213 struct isp_device *isp = to_isp_device(ccp2); 213 struct isp_device *isp = to_isp_device(ccp2);
214 u32 val; 214 u32 val;
@@ -218,16 +218,16 @@ static int ccp2_phyif_config(struct isp_ccp2_device *ccp2,
218 ISPCCP2_CTRL_IO_OUT_SEL | ISPCCP2_CTRL_MODE; 218 ISPCCP2_CTRL_IO_OUT_SEL | ISPCCP2_CTRL_MODE;
219 /* Data/strobe physical layer */ 219 /* Data/strobe physical layer */
220 BIT_SET(val, ISPCCP2_CTRL_PHY_SEL_SHIFT, ISPCCP2_CTRL_PHY_SEL_MASK, 220 BIT_SET(val, ISPCCP2_CTRL_PHY_SEL_SHIFT, ISPCCP2_CTRL_PHY_SEL_MASK,
221 pdata->phy_layer); 221 buscfg->phy_layer);
222 BIT_SET(val, ISPCCP2_CTRL_INV_SHIFT, ISPCCP2_CTRL_INV_MASK, 222 BIT_SET(val, ISPCCP2_CTRL_INV_SHIFT, ISPCCP2_CTRL_INV_MASK,
223 pdata->strobe_clk_pol); 223 buscfg->strobe_clk_pol);
224 isp_reg_writel(isp, val, OMAP3_ISP_IOMEM_CCP2, ISPCCP2_CTRL); 224 isp_reg_writel(isp, val, OMAP3_ISP_IOMEM_CCP2, ISPCCP2_CTRL);
225 225
226 val = isp_reg_readl(isp, OMAP3_ISP_IOMEM_CCP2, ISPCCP2_CTRL); 226 val = isp_reg_readl(isp, OMAP3_ISP_IOMEM_CCP2, ISPCCP2_CTRL);
227 if (!(val & ISPCCP2_CTRL_MODE)) { 227 if (!(val & ISPCCP2_CTRL_MODE)) {
228 if (pdata->ccp2_mode == ISP_CCP2_MODE_CCP2) 228 if (buscfg->ccp2_mode == ISP_CCP2_MODE_CCP2)
229 dev_warn(isp->dev, "OMAP3 CCP2 bus not available\n"); 229 dev_warn(isp->dev, "OMAP3 CCP2 bus not available\n");
230 if (pdata->phy_layer == ISP_CCP2_PHY_DATA_STROBE) 230 if (buscfg->phy_layer == ISP_CCP2_PHY_DATA_STROBE)
231 /* Strobe mode requires CCP2 */ 231 /* Strobe mode requires CCP2 */
232 return -EIO; 232 return -EIO;
233 } 233 }
@@ -347,7 +347,7 @@ static void ccp2_lcx_config(struct isp_ccp2_device *ccp2,
347 */ 347 */
348static int ccp2_if_configure(struct isp_ccp2_device *ccp2) 348static int ccp2_if_configure(struct isp_ccp2_device *ccp2)
349{ 349{
350 const struct isp_v4l2_subdevs_group *pdata; 350 const struct isp_bus_cfg *buscfg;
351 struct v4l2_mbus_framefmt *format; 351 struct v4l2_mbus_framefmt *format;
352 struct media_pad *pad; 352 struct media_pad *pad;
353 struct v4l2_subdev *sensor; 353 struct v4l2_subdev *sensor;
@@ -358,20 +358,20 @@ static int ccp2_if_configure(struct isp_ccp2_device *ccp2)
358 358
359 pad = media_entity_remote_pad(&ccp2->pads[CCP2_PAD_SINK]); 359 pad = media_entity_remote_pad(&ccp2->pads[CCP2_PAD_SINK]);
360 sensor = media_entity_to_v4l2_subdev(pad->entity); 360 sensor = media_entity_to_v4l2_subdev(pad->entity);
361 pdata = sensor->host_priv; 361 buscfg = sensor->host_priv;
362 362
363 ret = ccp2_phyif_config(ccp2, &pdata->bus.ccp2); 363 ret = ccp2_phyif_config(ccp2, &buscfg->bus.ccp2);
364 if (ret < 0) 364 if (ret < 0)
365 return ret; 365 return ret;
366 366
367 ccp2_vp_config(ccp2, pdata->bus.ccp2.vpclk_div + 1); 367 ccp2_vp_config(ccp2, buscfg->bus.ccp2.vpclk_div + 1);
368 368
369 v4l2_subdev_call(sensor, sensor, g_skip_top_lines, &lines); 369 v4l2_subdev_call(sensor, sensor, g_skip_top_lines, &lines);
370 370
371 format = &ccp2->formats[CCP2_PAD_SINK]; 371 format = &ccp2->formats[CCP2_PAD_SINK];
372 372
373 ccp2->if_cfg.data_start = lines; 373 ccp2->if_cfg.data_start = lines;
374 ccp2->if_cfg.crc = pdata->bus.ccp2.crc; 374 ccp2->if_cfg.crc = buscfg->bus.ccp2.crc;
375 ccp2->if_cfg.format = format->code; 375 ccp2->if_cfg.format = format->code;
376 ccp2->if_cfg.data_size = format->height; 376 ccp2->if_cfg.data_size = format->height;
377 377
diff --git a/drivers/media/platform/omap3isp/ispcsi2.c b/drivers/media/platform/omap3isp/ispcsi2.c
index bbadf6653db7..45ac90a49889 100644
--- a/drivers/media/platform/omap3isp/ispcsi2.c
+++ b/drivers/media/platform/omap3isp/ispcsi2.c
@@ -548,7 +548,7 @@ int omap3isp_csi2_reset(struct isp_csi2_device *csi2)
548 548
549static int csi2_configure(struct isp_csi2_device *csi2) 549static int csi2_configure(struct isp_csi2_device *csi2)
550{ 550{
551 const struct isp_v4l2_subdevs_group *pdata; 551 const struct isp_bus_cfg *buscfg;
552 struct isp_device *isp = csi2->isp; 552 struct isp_device *isp = csi2->isp;
553 struct isp_csi2_timing_cfg *timing = &csi2->timing[0]; 553 struct isp_csi2_timing_cfg *timing = &csi2->timing[0];
554 struct v4l2_subdev *sensor; 554 struct v4l2_subdev *sensor;
@@ -565,14 +565,14 @@ static int csi2_configure(struct isp_csi2_device *csi2)
565 565
566 pad = media_entity_remote_pad(&csi2->pads[CSI2_PAD_SINK]); 566 pad = media_entity_remote_pad(&csi2->pads[CSI2_PAD_SINK]);
567 sensor = media_entity_to_v4l2_subdev(pad->entity); 567 sensor = media_entity_to_v4l2_subdev(pad->entity);
568 pdata = sensor->host_priv; 568 buscfg = sensor->host_priv;
569 569
570 csi2->frame_skip = 0; 570 csi2->frame_skip = 0;
571 v4l2_subdev_call(sensor, sensor, g_skip_frames, &csi2->frame_skip); 571 v4l2_subdev_call(sensor, sensor, g_skip_frames, &csi2->frame_skip);
572 572
573 csi2->ctrl.vp_out_ctrl = pdata->bus.csi2.vpclk_div; 573 csi2->ctrl.vp_out_ctrl = buscfg->bus.csi2.vpclk_div;
574 csi2->ctrl.frame_mode = ISP_CSI2_FRAME_IMMEDIATE; 574 csi2->ctrl.frame_mode = ISP_CSI2_FRAME_IMMEDIATE;
575 csi2->ctrl.ecc_enable = pdata->bus.csi2.crc; 575 csi2->ctrl.ecc_enable = buscfg->bus.csi2.crc;
576 576
577 timing->ionum = 1; 577 timing->ionum = 1;
578 timing->force_rx_mode = 1; 578 timing->force_rx_mode = 1;
diff --git a/drivers/media/platform/omap3isp/ispcsiphy.c b/drivers/media/platform/omap3isp/ispcsiphy.c
index e033f2237a72..4486e9f492df 100644
--- a/drivers/media/platform/omap3isp/ispcsiphy.c
+++ b/drivers/media/platform/omap3isp/ispcsiphy.c
@@ -168,18 +168,18 @@ static int omap3isp_csiphy_config(struct isp_csiphy *phy)
168{ 168{
169 struct isp_csi2_device *csi2 = phy->csi2; 169 struct isp_csi2_device *csi2 = phy->csi2;
170 struct isp_pipeline *pipe = to_isp_pipeline(&csi2->subdev.entity); 170 struct isp_pipeline *pipe = to_isp_pipeline(&csi2->subdev.entity);
171 struct isp_v4l2_subdevs_group *subdevs = pipe->external->host_priv; 171 struct isp_bus_cfg *buscfg = pipe->external->host_priv;
172 struct isp_csiphy_lanes_cfg *lanes; 172 struct isp_csiphy_lanes_cfg *lanes;
173 int csi2_ddrclk_khz; 173 int csi2_ddrclk_khz;
174 unsigned int used_lanes = 0; 174 unsigned int used_lanes = 0;
175 unsigned int i; 175 unsigned int i;
176 u32 reg; 176 u32 reg;
177 177
178 if (subdevs->interface == ISP_INTERFACE_CCP2B_PHY1 178 if (buscfg->interface == ISP_INTERFACE_CCP2B_PHY1
179 || subdevs->interface == ISP_INTERFACE_CCP2B_PHY2) 179 || buscfg->interface == ISP_INTERFACE_CCP2B_PHY2)
180 lanes = &subdevs->bus.ccp2.lanecfg; 180 lanes = &buscfg->bus.ccp2.lanecfg;
181 else 181 else
182 lanes = &subdevs->bus.csi2.lanecfg; 182 lanes = &buscfg->bus.csi2.lanecfg;
183 183
184 /* Clock and data lanes verification */ 184 /* Clock and data lanes verification */
185 for (i = 0; i < phy->num_data_lanes; i++) { 185 for (i = 0; i < phy->num_data_lanes; i++) {
@@ -203,8 +203,8 @@ static int omap3isp_csiphy_config(struct isp_csiphy *phy)
203 * issue since the MPU power domain is forced on whilst the 203 * issue since the MPU power domain is forced on whilst the
204 * ISP is in use. 204 * ISP is in use.
205 */ 205 */
206 csiphy_routing_cfg(phy, subdevs->interface, true, 206 csiphy_routing_cfg(phy, buscfg->interface, true,
207 subdevs->bus.ccp2.phy_layer); 207 buscfg->bus.ccp2.phy_layer);
208 208
209 /* DPHY timing configuration */ 209 /* DPHY timing configuration */
210 /* CSI-2 is DDR and we only count used lanes. */ 210 /* CSI-2 is DDR and we only count used lanes. */
@@ -302,11 +302,10 @@ void omap3isp_csiphy_release(struct isp_csiphy *phy)
302 struct isp_csi2_device *csi2 = phy->csi2; 302 struct isp_csi2_device *csi2 = phy->csi2;
303 struct isp_pipeline *pipe = 303 struct isp_pipeline *pipe =
304 to_isp_pipeline(&csi2->subdev.entity); 304 to_isp_pipeline(&csi2->subdev.entity);
305 struct isp_v4l2_subdevs_group *subdevs = 305 struct isp_bus_cfg *buscfg = pipe->external->host_priv;
306 pipe->external->host_priv;
307 306
308 csiphy_routing_cfg(phy, subdevs->interface, false, 307 csiphy_routing_cfg(phy, buscfg->interface, false,
309 subdevs->bus.ccp2.phy_layer); 308 buscfg->bus.ccp2.phy_layer);
310 csiphy_power_autoswitch_enable(phy, false); 309 csiphy_power_autoswitch_enable(phy, false);
311 csiphy_set_power(phy, ISPCSI2_PHY_CFG_PWR_CMD_OFF); 310 csiphy_set_power(phy, ISPCSI2_PHY_CFG_PWR_CMD_OFF);
312 regulator_disable(phy->vdd); 311 regulator_disable(phy->vdd);
diff --git a/include/media/omap3isp.h b/include/media/omap3isp.h
index 398279dd1922..39e0748b0d31 100644
--- a/include/media/omap3isp.h
+++ b/include/media/omap3isp.h
@@ -45,7 +45,7 @@ enum {
45}; 45};
46 46
47/** 47/**
48 * struct isp_parallel_platform_data - Parallel interface platform data 48 * struct isp_parallel_cfg - Parallel interface configuration
49 * @data_lane_shift: Data lane shifter 49 * @data_lane_shift: Data lane shifter
50 * ISP_LANE_SHIFT_0 - CAMEXT[13:0] -> CAM[13:0] 50 * ISP_LANE_SHIFT_0 - CAMEXT[13:0] -> CAM[13:0]
51 * ISP_LANE_SHIFT_2 - CAMEXT[13:2] -> CAM[11:0] 51 * ISP_LANE_SHIFT_2 - CAMEXT[13:2] -> CAM[11:0]
@@ -62,7 +62,7 @@ enum {
62 * @data_pol: Data polarity 62 * @data_pol: Data polarity
63 * 0 - Normal, 1 - One's complement 63 * 0 - Normal, 1 - One's complement
64 */ 64 */
65struct isp_parallel_platform_data { 65struct isp_parallel_cfg {
66 unsigned int data_lane_shift:2; 66 unsigned int data_lane_shift:2;
67 unsigned int clk_pol:1; 67 unsigned int clk_pol:1;
68 unsigned int hs_pol:1; 68 unsigned int hs_pol:1;
@@ -105,7 +105,7 @@ struct isp_csiphy_lanes_cfg {
105}; 105};
106 106
107/** 107/**
108 * struct isp_ccp2_platform_data - CCP2 interface platform data 108 * struct isp_ccp2_cfg - CCP2 interface configuration
109 * @strobe_clk_pol: Strobe/clock polarity 109 * @strobe_clk_pol: Strobe/clock polarity
110 * 0 - Non Inverted, 1 - Inverted 110 * 0 - Non Inverted, 1 - Inverted
111 * @crc: Enable the cyclic redundancy check 111 * @crc: Enable the cyclic redundancy check
@@ -117,7 +117,7 @@ struct isp_csiphy_lanes_cfg {
117 * ISP_CCP2_PHY_DATA_STROBE - Data/strobe physical layer 117 * ISP_CCP2_PHY_DATA_STROBE - Data/strobe physical layer
118 * @vpclk_div: Video port output clock control 118 * @vpclk_div: Video port output clock control
119 */ 119 */
120struct isp_ccp2_platform_data { 120struct isp_ccp2_cfg {
121 unsigned int strobe_clk_pol:1; 121 unsigned int strobe_clk_pol:1;
122 unsigned int crc:1; 122 unsigned int crc:1;
123 unsigned int ccp2_mode:1; 123 unsigned int ccp2_mode:1;
@@ -127,31 +127,31 @@ struct isp_ccp2_platform_data {
127}; 127};
128 128
129/** 129/**
130 * struct isp_csi2_platform_data - CSI2 interface platform data 130 * struct isp_csi2_cfg - CSI2 interface configuration
131 * @crc: Enable the cyclic redundancy check 131 * @crc: Enable the cyclic redundancy check
132 * @vpclk_div: Video port output clock control 132 * @vpclk_div: Video port output clock control
133 */ 133 */
134struct isp_csi2_platform_data { 134struct isp_csi2_cfg {
135 unsigned crc:1; 135 unsigned crc:1;
136 unsigned vpclk_div:2; 136 unsigned vpclk_div:2;
137 struct isp_csiphy_lanes_cfg lanecfg; 137 struct isp_csiphy_lanes_cfg lanecfg;
138}; 138};
139 139
140struct isp_subdev_i2c_board_info { 140struct isp_bus_cfg {
141 struct i2c_board_info *board_info;
142 int i2c_adapter_id;
143};
144
145struct isp_v4l2_subdevs_group {
146 struct isp_subdev_i2c_board_info *subdevs;
147 enum isp_interface_type interface; 141 enum isp_interface_type interface;
148 union { 142 union {
149 struct isp_parallel_platform_data parallel; 143 struct isp_parallel_cfg parallel;
150 struct isp_ccp2_platform_data ccp2; 144 struct isp_ccp2_cfg ccp2;
151 struct isp_csi2_platform_data csi2; 145 struct isp_csi2_cfg csi2;
152 } bus; /* gcc < 4.6.0 chokes on anonymous union initializers */ 146 } bus; /* gcc < 4.6.0 chokes on anonymous union initializers */
153}; 147};
154 148
149struct isp_platform_subdev {
150 struct i2c_board_info *board_info;
151 int i2c_adapter_id;
152 struct isp_bus_cfg *bus;
153};
154
155struct isp_platform_xclk { 155struct isp_platform_xclk {
156 const char *dev_id; 156 const char *dev_id;
157 const char *con_id; 157 const char *con_id;
@@ -159,7 +159,7 @@ struct isp_platform_xclk {
159 159
160struct isp_platform_data { 160struct isp_platform_data {
161 struct isp_platform_xclk xclks[2]; 161 struct isp_platform_xclk xclks[2];
162 struct isp_v4l2_subdevs_group *subdevs; 162 struct isp_platform_subdev *subdevs;
163 void (*set_constraints)(struct isp_device *isp, bool enable); 163 void (*set_constraints)(struct isp_device *isp, bool enable);
164}; 164};
165 165