aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx25840/cx25840-core.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2010-08-06 09:53:19 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-08 22:43:05 -0400
commit72c851b00f6c86353c54fdd9f1ef88d82e8df6c5 (patch)
treedc6a86897e06b9ad5b576ef5d75a3c5ddab9815b /drivers/media/video/cx25840/cx25840-core.c
parent59b8311a9b4cdd3e11d1c7d434bb9abf1ae3bc5c (diff)
V4L/DVB: cx25840/ivtv: replace ugly priv control with s_config
The cx25840 used a private control CX25840_CID_ENABLE_PVR150_WORKAROUND to be told whether to enable a workaround for certain pvr150 cards. This is really config data that it needs to get at load time. Implemented this in cx25840 and ivtv. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx25840/cx25840-core.c')
-rw-r--r--drivers/media/video/cx25840/cx25840-core.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c
index 9fab0b17084..69763729ccc 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -1127,11 +1127,6 @@ static int cx25840_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
1127 struct i2c_client *client = v4l2_get_subdevdata(sd); 1127 struct i2c_client *client = v4l2_get_subdevdata(sd);
1128 1128
1129 switch (ctrl->id) { 1129 switch (ctrl->id) {
1130 case CX25840_CID_ENABLE_PVR150_WORKAROUND:
1131 state->pvr150_workaround = ctrl->value;
1132 set_input(client, state->vid_input, state->aud_input);
1133 break;
1134
1135 case V4L2_CID_BRIGHTNESS: 1130 case V4L2_CID_BRIGHTNESS:
1136 if (ctrl->value < 0 || ctrl->value > 255) { 1131 if (ctrl->value < 0 || ctrl->value > 255) {
1137 v4l_err(client, "invalid brightness setting %d\n", 1132 v4l_err(client, "invalid brightness setting %d\n",
@@ -1194,9 +1189,6 @@ static int cx25840_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
1194 struct i2c_client *client = v4l2_get_subdevdata(sd); 1189 struct i2c_client *client = v4l2_get_subdevdata(sd);
1195 1190
1196 switch (ctrl->id) { 1191 switch (ctrl->id) {
1197 case CX25840_CID_ENABLE_PVR150_WORKAROUND:
1198 ctrl->value = state->pvr150_workaround;
1199 break;
1200 case V4L2_CID_BRIGHTNESS: 1192 case V4L2_CID_BRIGHTNESS:
1201 ctrl->value = (s8)cx25840_read(client, 0x414) + 128; 1193 ctrl->value = (s8)cx25840_read(client, 0x414) + 128;
1202 break; 1194 break;
@@ -1792,6 +1784,20 @@ static int cx25840_log_status(struct v4l2_subdev *sd)
1792 return 0; 1784 return 0;
1793} 1785}
1794 1786
1787static int cx25840_s_config(struct v4l2_subdev *sd, int irq, void *platform_data)
1788{
1789 struct cx25840_state *state = to_state(sd);
1790 struct i2c_client *client = v4l2_get_subdevdata(sd);
1791
1792 if (platform_data) {
1793 struct cx25840_platform_data *pdata = platform_data;
1794
1795 state->pvr150_workaround = pdata->pvr150_workaround;
1796 set_input(client, state->vid_input, state->aud_input);
1797 }
1798 return 0;
1799}
1800
1795static int cx23885_irq_handler(struct v4l2_subdev *sd, u32 status, 1801static int cx23885_irq_handler(struct v4l2_subdev *sd, u32 status,
1796 bool *handled) 1802 bool *handled)
1797{ 1803{
@@ -1879,6 +1885,7 @@ static int cx25840_irq_handler(struct v4l2_subdev *sd, u32 status,
1879 1885
1880static const struct v4l2_subdev_core_ops cx25840_core_ops = { 1886static const struct v4l2_subdev_core_ops cx25840_core_ops = {
1881 .log_status = cx25840_log_status, 1887 .log_status = cx25840_log_status,
1888 .s_config = cx25840_s_config,
1882 .g_chip_ident = cx25840_g_chip_ident, 1889 .g_chip_ident = cx25840_g_chip_ident,
1883 .g_ctrl = cx25840_g_ctrl, 1890 .g_ctrl = cx25840_g_ctrl,
1884 .s_ctrl = cx25840_s_ctrl, 1891 .s_ctrl = cx25840_s_ctrl,