diff options
author | Devin Heitmueller <dheitmueller@linuxtv.org> | 2009-03-15 19:01:53 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:43:28 -0400 |
commit | 2689d3dcc6c75c0b4a05b66330db85df2c036d3e (patch) | |
tree | f97c0181d6fd325dc039ea907e517994de48c63e /drivers/media/video/au0828/au0828-video.c | |
parent | dd27ade7a9195cb3b1f56df4d0ec39763830390b (diff) |
V4L/DVB (11088): au0828: finish videodev/subdev conversion
Per Hans Verkuil <hverkuil@xs4all.nl> instruction, remove the deprecated
attach_inform/detach_inform routines, and convert over the i2c calls to
subdev calls.
Thanks to Hans Verkuil <hverkuil@xs4all.nl> for providing feedback on the
au0828 analog support.
Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/au0828/au0828-video.c')
-rw-r--r-- | drivers/media/video/au0828/au0828-video.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/drivers/media/video/au0828/au0828-video.c b/drivers/media/video/au0828/au0828-video.c index e1940467b472..5de968e128f6 100644 --- a/drivers/media/video/au0828/au0828-video.c +++ b/drivers/media/video/au0828/au0828-video.c | |||
@@ -996,7 +996,7 @@ static int vidioc_queryctrl(struct file *file, void *priv, | |||
996 | { | 996 | { |
997 | struct au0828_fh *fh = priv; | 997 | struct au0828_fh *fh = priv; |
998 | struct au0828_dev *dev = fh->dev; | 998 | struct au0828_dev *dev = fh->dev; |
999 | au0828_call_i2c_clients(dev, VIDIOC_QUERYCTRL, qc); | 999 | v4l2_device_call_all(&dev->v4l2_dev, 0, core, queryctrl, qc); |
1000 | if (qc->type) | 1000 | if (qc->type) |
1001 | return 0; | 1001 | return 0; |
1002 | else | 1002 | else |
@@ -1100,7 +1100,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id * norm) | |||
1100 | have to make the au0828 bridge adjust the size of its capture | 1100 | have to make the au0828 bridge adjust the size of its capture |
1101 | buffer, which is currently hardcoded at 720x480 */ | 1101 | buffer, which is currently hardcoded at 720x480 */ |
1102 | 1102 | ||
1103 | au0828_call_i2c_clients(dev, VIDIOC_S_STD, norm); | 1103 | v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_std, *norm); |
1104 | return 0; | 1104 | return 0; |
1105 | } | 1105 | } |
1106 | 1106 | ||
@@ -1182,7 +1182,7 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int index) | |||
1182 | 1182 | ||
1183 | route.input = AUVI_INPUT(index).vmux; | 1183 | route.input = AUVI_INPUT(index).vmux; |
1184 | route.output = 0; | 1184 | route.output = 0; |
1185 | au0828_call_i2c_clients(dev, VIDIOC_INT_S_VIDEO_ROUTING, &route); | 1185 | v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_routing, &route); |
1186 | 1186 | ||
1187 | for (i = 0; i < AU0828_MAX_INPUT; i++) { | 1187 | for (i = 0; i < AU0828_MAX_INPUT; i++) { |
1188 | int enable = 0; | 1188 | int enable = 0; |
@@ -1206,8 +1206,7 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int index) | |||
1206 | } | 1206 | } |
1207 | 1207 | ||
1208 | route.input = AUVI_INPUT(index).amux; | 1208 | route.input = AUVI_INPUT(index).amux; |
1209 | au0828_call_i2c_clients(dev, VIDIOC_INT_S_AUDIO_ROUTING, | 1209 | v4l2_device_call_all(&dev->v4l2_dev, 0, audio, s_routing, &route); |
1210 | &route); | ||
1211 | return 0; | 1210 | return 0; |
1212 | } | 1211 | } |
1213 | 1212 | ||
@@ -1246,7 +1245,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv, | |||
1246 | struct au0828_fh *fh = priv; | 1245 | struct au0828_fh *fh = priv; |
1247 | struct au0828_dev *dev = fh->dev; | 1246 | struct au0828_dev *dev = fh->dev; |
1248 | 1247 | ||
1249 | au0828_call_i2c_clients(dev, VIDIOC_G_CTRL, ctrl); | 1248 | v4l2_device_call_all(&dev->v4l2_dev, 0, core, g_ctrl, ctrl); |
1250 | return 0; | 1249 | return 0; |
1251 | 1250 | ||
1252 | } | 1251 | } |
@@ -1256,7 +1255,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv, | |||
1256 | { | 1255 | { |
1257 | struct au0828_fh *fh = priv; | 1256 | struct au0828_fh *fh = priv; |
1258 | struct au0828_dev *dev = fh->dev; | 1257 | struct au0828_dev *dev = fh->dev; |
1259 | au0828_call_i2c_clients(dev, VIDIOC_S_CTRL, ctrl); | 1258 | v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_ctrl, ctrl); |
1260 | return 0; | 1259 | return 0; |
1261 | } | 1260 | } |
1262 | 1261 | ||
@@ -1269,8 +1268,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t) | |||
1269 | return -EINVAL; | 1268 | return -EINVAL; |
1270 | 1269 | ||
1271 | strcpy(t->name, "Auvitek tuner"); | 1270 | strcpy(t->name, "Auvitek tuner"); |
1272 | 1271 | v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, g_tuner, t); | |
1273 | au0828_call_i2c_clients(dev, VIDIOC_G_TUNER, t); | ||
1274 | return 0; | 1272 | return 0; |
1275 | } | 1273 | } |
1276 | 1274 | ||
@@ -1284,7 +1282,7 @@ static int vidioc_s_tuner(struct file *file, void *priv, | |||
1284 | return -EINVAL; | 1282 | return -EINVAL; |
1285 | 1283 | ||
1286 | t->type = V4L2_TUNER_ANALOG_TV; | 1284 | t->type = V4L2_TUNER_ANALOG_TV; |
1287 | au0828_call_i2c_clients(dev, VIDIOC_S_TUNER, t); | 1285 | v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_tuner, t); |
1288 | dprintk(1, "VIDIOC_S_TUNER: signal = %x, afc = %x\n", t->signal, | 1286 | dprintk(1, "VIDIOC_S_TUNER: signal = %x, afc = %x\n", t->signal, |
1289 | t->afc); | 1287 | t->afc); |
1290 | return 0; | 1288 | return 0; |
@@ -1315,7 +1313,7 @@ static int vidioc_s_frequency(struct file *file, void *priv, | |||
1315 | 1313 | ||
1316 | dev->ctrl_freq = freq->frequency; | 1314 | dev->ctrl_freq = freq->frequency; |
1317 | 1315 | ||
1318 | au0828_call_i2c_clients(dev, VIDIOC_S_FREQUENCY, freq); | 1316 | v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, freq); |
1319 | 1317 | ||
1320 | au0828_analog_stream_reset(dev); | 1318 | au0828_analog_stream_reset(dev); |
1321 | 1319 | ||
@@ -1335,7 +1333,7 @@ static int vidioc_g_chip_ident(struct file *file, void *priv, | |||
1335 | return 0; | 1333 | return 0; |
1336 | } | 1334 | } |
1337 | 1335 | ||
1338 | au0828_call_i2c_clients(dev, VIDIOC_DBG_G_CHIP_IDENT, chip); | 1336 | v4l2_device_call_all(&dev->v4l2_dev, 0, core, g_chip_ident, chip); |
1339 | if (chip->ident == V4L2_IDENT_NONE) | 1337 | if (chip->ident == V4L2_IDENT_NONE) |
1340 | return -EINVAL; | 1338 | return -EINVAL; |
1341 | 1339 | ||
@@ -1369,7 +1367,6 @@ static int vidioc_streamon(struct file *file, void *priv, | |||
1369 | { | 1367 | { |
1370 | struct au0828_fh *fh = priv; | 1368 | struct au0828_fh *fh = priv; |
1371 | struct au0828_dev *dev = fh->dev; | 1369 | struct au0828_dev *dev = fh->dev; |
1372 | int b = V4L2_BUF_TYPE_VIDEO_CAPTURE; | ||
1373 | int rc; | 1370 | int rc; |
1374 | 1371 | ||
1375 | rc = check_dev(dev); | 1372 | rc = check_dev(dev); |
@@ -1378,7 +1375,7 @@ static int vidioc_streamon(struct file *file, void *priv, | |||
1378 | 1375 | ||
1379 | if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { | 1376 | if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { |
1380 | au0828_analog_stream_enable(dev); | 1377 | au0828_analog_stream_enable(dev); |
1381 | au0828_call_i2c_clients(dev, VIDIOC_STREAMON, &b); | 1378 | v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_stream, 1); |
1382 | } | 1379 | } |
1383 | 1380 | ||
1384 | mutex_lock(&dev->lock); | 1381 | mutex_lock(&dev->lock); |
@@ -1396,7 +1393,6 @@ static int vidioc_streamoff(struct file *file, void *priv, | |||
1396 | { | 1393 | { |
1397 | struct au0828_fh *fh = priv; | 1394 | struct au0828_fh *fh = priv; |
1398 | struct au0828_dev *dev = fh->dev; | 1395 | struct au0828_dev *dev = fh->dev; |
1399 | int b = V4L2_BUF_TYPE_VIDEO_CAPTURE; | ||
1400 | int i; | 1396 | int i; |
1401 | int ret; | 1397 | int ret; |
1402 | int rc; | 1398 | int rc; |
@@ -1411,7 +1407,7 @@ static int vidioc_streamoff(struct file *file, void *priv, | |||
1411 | return -EINVAL; | 1407 | return -EINVAL; |
1412 | 1408 | ||
1413 | if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { | 1409 | if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { |
1414 | au0828_call_i2c_clients(dev, VIDIOC_STREAMOFF, &b); | 1410 | v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_stream, 0); |
1415 | ret = au0828_stream_interrupt(dev); | 1411 | ret = au0828_stream_interrupt(dev); |
1416 | if (ret != 0) | 1412 | if (ret != 0) |
1417 | return ret; | 1413 | return ret; |
@@ -1439,7 +1435,7 @@ static int vidioc_g_register(struct file *file, void *priv, | |||
1439 | 1435 | ||
1440 | switch (reg->match.type) { | 1436 | switch (reg->match.type) { |
1441 | case V4L2_CHIP_MATCH_I2C_DRIVER: | 1437 | case V4L2_CHIP_MATCH_I2C_DRIVER: |
1442 | au0828_call_i2c_clients(dev, VIDIOC_DBG_G_REGISTER, reg); | 1438 | v4l2_device_call_all(&dev->v4l2_dev, 0, core, g_register, reg); |
1443 | return 0; | 1439 | return 0; |
1444 | default: | 1440 | default: |
1445 | return -EINVAL; | 1441 | return -EINVAL; |
@@ -1454,7 +1450,7 @@ static int vidioc_s_register(struct file *file, void *priv, | |||
1454 | 1450 | ||
1455 | switch (reg->match.type) { | 1451 | switch (reg->match.type) { |
1456 | case V4L2_CHIP_MATCH_I2C_DRIVER: | 1452 | case V4L2_CHIP_MATCH_I2C_DRIVER: |
1457 | au0828_call_i2c_clients(dev, VIDIOC_DBG_S_REGISTER, reg); | 1453 | v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_register, reg); |
1458 | return 0; | 1454 | return 0; |
1459 | default: | 1455 | default: |
1460 | return -EINVAL; | 1456 | return -EINVAL; |