diff options
author | Ben Dooks <ben.dooks@codethink.co.uk> | 2014-04-14 06:36:40 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-06-17 11:04:52 -0400 |
commit | 25dfa02ce21981ef08d375be987862f96676d8ab (patch) | |
tree | 7cd205170f0816f6d597f54e840fbd4b2e14e2fb | |
parent | 057c2a2ef576a21968e838194b8b9d3b6b106769 (diff) |
[media] rcar_vin: copy flags from pdata
The platform data is a single word, so simply copy
it into the device's private data structure than
keeping a copy of the pointer.
This will make changing to device-tree binding
easier as it is one allocation instead of two.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r-- | drivers/media/platform/soc_camera/rcar_vin.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c index e594230e84d3..7c4299d9a100 100644 --- a/drivers/media/platform/soc_camera/rcar_vin.c +++ b/drivers/media/platform/soc_camera/rcar_vin.c | |||
@@ -126,13 +126,13 @@ struct rcar_vin_priv { | |||
126 | int sequence; | 126 | int sequence; |
127 | /* State of the VIN module in capturing mode */ | 127 | /* State of the VIN module in capturing mode */ |
128 | enum rcar_vin_state state; | 128 | enum rcar_vin_state state; |
129 | struct rcar_vin_platform_data *pdata; | ||
130 | struct soc_camera_host ici; | 129 | struct soc_camera_host ici; |
131 | struct list_head capture; | 130 | struct list_head capture; |
132 | #define MAX_BUFFER_NUM 3 | 131 | #define MAX_BUFFER_NUM 3 |
133 | struct vb2_buffer *queue_buf[MAX_BUFFER_NUM]; | 132 | struct vb2_buffer *queue_buf[MAX_BUFFER_NUM]; |
134 | struct vb2_alloc_ctx *alloc_ctx; | 133 | struct vb2_alloc_ctx *alloc_ctx; |
135 | enum v4l2_field field; | 134 | enum v4l2_field field; |
135 | unsigned int pdata_flags; | ||
136 | unsigned int vb_count; | 136 | unsigned int vb_count; |
137 | unsigned int nr_hw_slots; | 137 | unsigned int nr_hw_slots; |
138 | bool request_to_stop; | 138 | bool request_to_stop; |
@@ -275,12 +275,12 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv) | |||
275 | break; | 275 | break; |
276 | case V4L2_MBUS_FMT_YUYV8_2X8: | 276 | case V4L2_MBUS_FMT_YUYV8_2X8: |
277 | /* BT.656 8bit YCbCr422 or BT.601 8bit YCbCr422 */ | 277 | /* BT.656 8bit YCbCr422 or BT.601 8bit YCbCr422 */ |
278 | vnmc |= priv->pdata->flags & RCAR_VIN_BT656 ? | 278 | vnmc |= priv->pdata_flags & RCAR_VIN_BT656 ? |
279 | VNMC_INF_YUV8_BT656 : VNMC_INF_YUV8_BT601; | 279 | VNMC_INF_YUV8_BT656 : VNMC_INF_YUV8_BT601; |
280 | break; | 280 | break; |
281 | case V4L2_MBUS_FMT_YUYV10_2X10: | 281 | case V4L2_MBUS_FMT_YUYV10_2X10: |
282 | /* BT.656 10bit YCbCr422 or BT.601 10bit YCbCr422 */ | 282 | /* BT.656 10bit YCbCr422 or BT.601 10bit YCbCr422 */ |
283 | vnmc |= priv->pdata->flags & RCAR_VIN_BT656 ? | 283 | vnmc |= priv->pdata_flags & RCAR_VIN_BT656 ? |
284 | VNMC_INF_YUV10_BT656 : VNMC_INF_YUV10_BT601; | 284 | VNMC_INF_YUV10_BT656 : VNMC_INF_YUV10_BT601; |
285 | break; | 285 | break; |
286 | default: | 286 | default: |
@@ -797,7 +797,7 @@ static int rcar_vin_set_bus_param(struct soc_camera_device *icd) | |||
797 | /* Make choises, based on platform preferences */ | 797 | /* Make choises, based on platform preferences */ |
798 | if ((common_flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH) && | 798 | if ((common_flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH) && |
799 | (common_flags & V4L2_MBUS_HSYNC_ACTIVE_LOW)) { | 799 | (common_flags & V4L2_MBUS_HSYNC_ACTIVE_LOW)) { |
800 | if (priv->pdata->flags & RCAR_VIN_HSYNC_ACTIVE_LOW) | 800 | if (priv->pdata_flags & RCAR_VIN_HSYNC_ACTIVE_LOW) |
801 | common_flags &= ~V4L2_MBUS_HSYNC_ACTIVE_HIGH; | 801 | common_flags &= ~V4L2_MBUS_HSYNC_ACTIVE_HIGH; |
802 | else | 802 | else |
803 | common_flags &= ~V4L2_MBUS_HSYNC_ACTIVE_LOW; | 803 | common_flags &= ~V4L2_MBUS_HSYNC_ACTIVE_LOW; |
@@ -805,7 +805,7 @@ static int rcar_vin_set_bus_param(struct soc_camera_device *icd) | |||
805 | 805 | ||
806 | if ((common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) && | 806 | if ((common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) && |
807 | (common_flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)) { | 807 | (common_flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)) { |
808 | if (priv->pdata->flags & RCAR_VIN_VSYNC_ACTIVE_LOW) | 808 | if (priv->pdata_flags & RCAR_VIN_VSYNC_ACTIVE_LOW) |
809 | common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_HIGH; | 809 | common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_HIGH; |
810 | else | 810 | else |
811 | common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_LOW; | 811 | common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_LOW; |
@@ -1445,7 +1445,7 @@ static int rcar_vin_probe(struct platform_device *pdev) | |||
1445 | priv->ici.drv_name = dev_name(&pdev->dev); | 1445 | priv->ici.drv_name = dev_name(&pdev->dev); |
1446 | priv->ici.ops = &rcar_vin_host_ops; | 1446 | priv->ici.ops = &rcar_vin_host_ops; |
1447 | 1447 | ||
1448 | priv->pdata = pdata; | 1448 | priv->pdata_flags = pdata->flags; |
1449 | priv->chip = pdev->id_entry->driver_data; | 1449 | priv->chip = pdev->id_entry->driver_data; |
1450 | spin_lock_init(&priv->lock); | 1450 | spin_lock_init(&priv->lock); |
1451 | INIT_LIST_HEAD(&priv->capture); | 1451 | INIT_LIST_HEAD(&priv->capture); |