aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2012-09-17 05:00:48 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-10-01 19:27:52 -0400
commit6612a08268a5efcc05e4a27dffde33f1b2b3a3eb (patch)
treeb9523f5cd5f1923eb8900d1043539bef858d024e /drivers/media
parent99c6902cdd66153ef6f0a272d0442d31bb5f6eb1 (diff)
[media] s5p-fimc: Keep local copy of sensors platform data
Use a copy of sensor platform data structure, rather than referencing external platform data from the driver. This allows to fill the local copy with values parsed from device tree when needed. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/s5p-fimc/fimc-capture.c6
-rw-r--r--drivers/media/platform/s5p-fimc/fimc-lite.c2
-rw-r--r--drivers/media/platform/s5p-fimc/fimc-mdevice.c18
-rw-r--r--drivers/media/platform/s5p-fimc/fimc-mdevice.h2
4 files changed, 14 insertions, 14 deletions
diff --git a/drivers/media/platform/s5p-fimc/fimc-capture.c b/drivers/media/platform/s5p-fimc/fimc-capture.c
index d7df8fb14889..dded98815220 100644
--- a/drivers/media/platform/s5p-fimc/fimc-capture.c
+++ b/drivers/media/platform/s5p-fimc/fimc-capture.c
@@ -50,9 +50,9 @@ static int fimc_capture_hw_init(struct fimc_dev *fimc)
50 fimc_prepare_dma_offset(ctx, &ctx->d_frame); 50 fimc_prepare_dma_offset(ctx, &ctx->d_frame);
51 fimc_set_yuv_order(ctx); 51 fimc_set_yuv_order(ctx);
52 52
53 fimc_hw_set_camera_polarity(fimc, sensor->pdata); 53 fimc_hw_set_camera_polarity(fimc, &sensor->pdata);
54 fimc_hw_set_camera_type(fimc, sensor->pdata); 54 fimc_hw_set_camera_type(fimc, &sensor->pdata);
55 fimc_hw_set_camera_source(fimc, sensor->pdata); 55 fimc_hw_set_camera_source(fimc, &sensor->pdata);
56 fimc_hw_set_camera_offset(fimc, &ctx->s_frame); 56 fimc_hw_set_camera_offset(fimc, &ctx->s_frame);
57 57
58 ret = fimc_set_scaler_info(ctx); 58 ret = fimc_set_scaler_info(ctx);
diff --git a/drivers/media/platform/s5p-fimc/fimc-lite.c b/drivers/media/platform/s5p-fimc/fimc-lite.c
index bef8d3ef79cc..5e6c704f1085 100644
--- a/drivers/media/platform/s5p-fimc/fimc-lite.c
+++ b/drivers/media/platform/s5p-fimc/fimc-lite.c
@@ -135,7 +135,7 @@ static int fimc_lite_hw_init(struct fimc_lite *fimc)
135 sensor = v4l2_get_subdev_hostdata(pipeline->subdevs[IDX_SENSOR]); 135 sensor = v4l2_get_subdev_hostdata(pipeline->subdevs[IDX_SENSOR]);
136 spin_lock_irqsave(&fimc->slock, flags); 136 spin_lock_irqsave(&fimc->slock, flags);
137 137
138 flite_hw_set_camera_bus(fimc, sensor->pdata); 138 flite_hw_set_camera_bus(fimc, &sensor->pdata);
139 flite_hw_set_source_format(fimc, &fimc->inp_frame); 139 flite_hw_set_source_format(fimc, &fimc->inp_frame);
140 flite_hw_set_window_offset(fimc, &fimc->inp_frame); 140 flite_hw_set_window_offset(fimc, &fimc->inp_frame);
141 flite_hw_set_output_dma(fimc, &fimc->out_frame, true); 141 flite_hw_set_output_dma(fimc, &fimc->out_frame, true);
diff --git a/drivers/media/platform/s5p-fimc/fimc-mdevice.c b/drivers/media/platform/s5p-fimc/fimc-mdevice.c
index 223fcfe2e1b3..80ada5882f62 100644
--- a/drivers/media/platform/s5p-fimc/fimc-mdevice.c
+++ b/drivers/media/platform/s5p-fimc/fimc-mdevice.c
@@ -252,27 +252,27 @@ static struct v4l2_subdev *fimc_md_register_sensor(struct fimc_md *fmd,
252 if (!s_info || !fmd) 252 if (!s_info || !fmd)
253 return NULL; 253 return NULL;
254 254
255 adapter = i2c_get_adapter(s_info->pdata->i2c_bus_num); 255 adapter = i2c_get_adapter(s_info->pdata.i2c_bus_num);
256 if (!adapter) { 256 if (!adapter) {
257 v4l2_warn(&fmd->v4l2_dev, 257 v4l2_warn(&fmd->v4l2_dev,
258 "Failed to get I2C adapter %d, deferring probe\n", 258 "Failed to get I2C adapter %d, deferring probe\n",
259 s_info->pdata->i2c_bus_num); 259 s_info->pdata.i2c_bus_num);
260 return ERR_PTR(-EPROBE_DEFER); 260 return ERR_PTR(-EPROBE_DEFER);
261 } 261 }
262 sd = v4l2_i2c_new_subdev_board(&fmd->v4l2_dev, adapter, 262 sd = v4l2_i2c_new_subdev_board(&fmd->v4l2_dev, adapter,
263 s_info->pdata->board_info, NULL); 263 s_info->pdata.board_info, NULL);
264 if (IS_ERR_OR_NULL(sd)) { 264 if (IS_ERR_OR_NULL(sd)) {
265 i2c_put_adapter(adapter); 265 i2c_put_adapter(adapter);
266 v4l2_warn(&fmd->v4l2_dev, 266 v4l2_warn(&fmd->v4l2_dev,
267 "Failed to acquire subdev %s, deferring probe\n", 267 "Failed to acquire subdev %s, deferring probe\n",
268 s_info->pdata->board_info->type); 268 s_info->pdata.board_info->type);
269 return ERR_PTR(-EPROBE_DEFER); 269 return ERR_PTR(-EPROBE_DEFER);
270 } 270 }
271 v4l2_set_subdev_hostdata(sd, s_info); 271 v4l2_set_subdev_hostdata(sd, s_info);
272 sd->grp_id = SENSOR_GROUP_ID; 272 sd->grp_id = SENSOR_GROUP_ID;
273 273
274 v4l2_info(&fmd->v4l2_dev, "Registered sensor subdevice %s\n", 274 v4l2_info(&fmd->v4l2_dev, "Registered sensor subdevice %s\n",
275 s_info->pdata->board_info->type); 275 s_info->pdata.board_info->type);
276 return sd; 276 return sd;
277} 277}
278 278
@@ -316,7 +316,7 @@ static int fimc_md_register_sensor_entities(struct fimc_md *fmd)
316 for (i = 0; i < num_clients; i++) { 316 for (i = 0; i < num_clients; i++) {
317 struct v4l2_subdev *sd; 317 struct v4l2_subdev *sd;
318 318
319 fmd->sensor[i].pdata = &pdata->isp_info[i]; 319 fmd->sensor[i].pdata = pdata->isp_info[i];
320 ret = __fimc_md_set_camclk(fmd, &fmd->sensor[i], true); 320 ret = __fimc_md_set_camclk(fmd, &fmd->sensor[i], true);
321 if (ret) 321 if (ret)
322 break; 322 break;
@@ -641,11 +641,11 @@ static int fimc_md_create_links(struct fimc_md *fmd)
641 641
642 sensor = fmd->sensor[i].subdev; 642 sensor = fmd->sensor[i].subdev;
643 s_info = v4l2_get_subdev_hostdata(sensor); 643 s_info = v4l2_get_subdev_hostdata(sensor);
644 if (!s_info || !s_info->pdata) 644 if (!s_info)
645 continue; 645 continue;
646 646
647 source = NULL; 647 source = NULL;
648 pdata = s_info->pdata; 648 pdata = &s_info->pdata;
649 649
650 switch (pdata->bus_type) { 650 switch (pdata->bus_type) {
651 case FIMC_MIPI_CSI2: 651 case FIMC_MIPI_CSI2:
@@ -757,7 +757,7 @@ static int __fimc_md_set_camclk(struct fimc_md *fmd,
757 struct fimc_sensor_info *s_info, 757 struct fimc_sensor_info *s_info,
758 bool on) 758 bool on)
759{ 759{
760 struct s5p_fimc_isp_info *pdata = s_info->pdata; 760 struct s5p_fimc_isp_info *pdata = &s_info->pdata;
761 struct fimc_camclk_info *camclk; 761 struct fimc_camclk_info *camclk;
762 int ret = 0; 762 int ret = 0;
763 763
diff --git a/drivers/media/platform/s5p-fimc/fimc-mdevice.h b/drivers/media/platform/s5p-fimc/fimc-mdevice.h
index 0135386457ee..2d8d41d82620 100644
--- a/drivers/media/platform/s5p-fimc/fimc-mdevice.h
+++ b/drivers/media/platform/s5p-fimc/fimc-mdevice.h
@@ -51,7 +51,7 @@ struct fimc_camclk_info {
51 * This data structure applies to image sensor and the writeback subdevs. 51 * This data structure applies to image sensor and the writeback subdevs.
52 */ 52 */
53struct fimc_sensor_info { 53struct fimc_sensor_info {
54 struct s5p_fimc_isp_info *pdata; 54 struct s5p_fimc_isp_info pdata;
55 struct v4l2_subdev *subdev; 55 struct v4l2_subdev *subdev;
56 struct fimc_dev *host; 56 struct fimc_dev *host;
57}; 57};