diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-03-29 07:26:01 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:43:48 -0400 |
commit | b8341e1d2acadf3935fb299a325f569a1c20daa6 (patch) | |
tree | c0146a06908fc673e74e727336d869cf0c553b18 /drivers/media/video/cx88/cx88-video.c | |
parent | b6198ade556add7a6f1dd1d38dd489b0484cab2d (diff) |
V4L/DVB (11300): cx88: convert to v4l2_subdev.
Convert cx88 to use v4l2_subdev since the old i2c autoprobing mechanism
will be removed.
Added code to explicitly load tvaudio where needed. Also fix the rtc-isl1208
support: since that driver no longer supports autoprobing it has to be
loaded using the new i2c API.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx88/cx88-video.c')
-rw-r--r-- | drivers/media/video/cx88/cx88-video.c | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 5b0fbc602f3e..434237af5184 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -431,8 +431,7 @@ int cx88_video_mux(struct cx88_core *core, unsigned int input) | |||
431 | struct v4l2_routing route; | 431 | struct v4l2_routing route; |
432 | 432 | ||
433 | route.input = INPUT(input).audioroute; | 433 | route.input = INPUT(input).audioroute; |
434 | cx88_call_i2c_clients(core, | 434 | call_all(core, audio, s_routing, &route); |
435 | VIDIOC_INT_S_AUDIO_ROUTING, &route); | ||
436 | } | 435 | } |
437 | /* cx2388's C-ADC is connected to the tuner only. | 436 | /* cx2388's C-ADC is connected to the tuner only. |
438 | When used with S-Video, that ADC is busy dealing with | 437 | When used with S-Video, that ADC is busy dealing with |
@@ -827,8 +826,7 @@ static int video_open(struct file *file) | |||
827 | struct v4l2_routing route; | 826 | struct v4l2_routing route; |
828 | 827 | ||
829 | route.input = core->board.radio.audioroute; | 828 | route.input = core->board.radio.audioroute; |
830 | cx88_call_i2c_clients(core, | 829 | call_all(core, audio, s_routing, &route); |
831 | VIDIOC_INT_S_AUDIO_ROUTING, &route); | ||
832 | } | 830 | } |
833 | /* "I2S ADC mode" */ | 831 | /* "I2S ADC mode" */ |
834 | core->tvaudio = WW_I2SADC; | 832 | core->tvaudio = WW_I2SADC; |
@@ -839,7 +837,7 @@ static int video_open(struct file *file) | |||
839 | cx88_set_tvaudio(core); | 837 | cx88_set_tvaudio(core); |
840 | cx88_set_stereo(core,V4L2_TUNER_MODE_STEREO,1); | 838 | cx88_set_stereo(core,V4L2_TUNER_MODE_STEREO,1); |
841 | } | 839 | } |
842 | cx88_call_i2c_clients(core,AUDC_SET_RADIO,NULL); | 840 | call_all(core, tuner, s_radio); |
843 | } | 841 | } |
844 | unlock_kernel(); | 842 | unlock_kernel(); |
845 | 843 | ||
@@ -933,7 +931,7 @@ static int video_release(struct file *file) | |||
933 | kfree(fh); | 931 | kfree(fh); |
934 | 932 | ||
935 | if(atomic_dec_and_test(&dev->core->users)) | 933 | if(atomic_dec_and_test(&dev->core->users)) |
936 | cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL); | 934 | call_all(dev->core, core, s_standby, 0); |
937 | 935 | ||
938 | return 0; | 936 | return 0; |
939 | } | 937 | } |
@@ -1395,7 +1393,7 @@ static int vidioc_g_frequency (struct file *file, void *priv, | |||
1395 | f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; | 1393 | f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; |
1396 | f->frequency = core->freq; | 1394 | f->frequency = core->freq; |
1397 | 1395 | ||
1398 | cx88_call_i2c_clients(core,VIDIOC_G_FREQUENCY,f); | 1396 | call_all(core, tuner, g_frequency, f); |
1399 | 1397 | ||
1400 | return 0; | 1398 | return 0; |
1401 | } | 1399 | } |
@@ -1411,7 +1409,7 @@ int cx88_set_freq (struct cx88_core *core, | |||
1411 | mutex_lock(&core->lock); | 1409 | mutex_lock(&core->lock); |
1412 | core->freq = f->frequency; | 1410 | core->freq = f->frequency; |
1413 | cx88_newstation(core); | 1411 | cx88_newstation(core); |
1414 | cx88_call_i2c_clients(core,VIDIOC_S_FREQUENCY,f); | 1412 | call_all(core, tuner, s_frequency, f); |
1415 | 1413 | ||
1416 | /* When changing channels it is required to reset TVAUDIO */ | 1414 | /* When changing channels it is required to reset TVAUDIO */ |
1417 | msleep (10); | 1415 | msleep (10); |
@@ -1493,7 +1491,7 @@ static int radio_g_tuner (struct file *file, void *priv, | |||
1493 | strcpy(t->name, "Radio"); | 1491 | strcpy(t->name, "Radio"); |
1494 | t->type = V4L2_TUNER_RADIO; | 1492 | t->type = V4L2_TUNER_RADIO; |
1495 | 1493 | ||
1496 | cx88_call_i2c_clients(core,VIDIOC_G_TUNER,t); | 1494 | call_all(core, tuner, g_tuner, t); |
1497 | return 0; | 1495 | return 0; |
1498 | } | 1496 | } |
1499 | 1497 | ||
@@ -1527,7 +1525,7 @@ static int radio_s_tuner (struct file *file, void *priv, | |||
1527 | if (0 != t->index) | 1525 | if (0 != t->index) |
1528 | return -EINVAL; | 1526 | return -EINVAL; |
1529 | 1527 | ||
1530 | cx88_call_i2c_clients(core,VIDIOC_S_TUNER,t); | 1528 | call_all(core, tuner, s_tuner, t); |
1531 | 1529 | ||
1532 | return 0; | 1530 | return 0; |
1533 | } | 1531 | } |
@@ -1884,12 +1882,30 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, | |||
1884 | /* load and configure helper modules */ | 1882 | /* load and configure helper modules */ |
1885 | 1883 | ||
1886 | if (core->board.audio_chip == V4L2_IDENT_WM8775) | 1884 | if (core->board.audio_chip == V4L2_IDENT_WM8775) |
1887 | request_module("wm8775"); | 1885 | v4l2_i2c_new_subdev(&core->i2c_adap, |
1886 | "wm8775", "wm8775", 0x36 >> 1); | ||
1887 | |||
1888 | if (core->board.audio_chip == V4L2_IDENT_TVAUDIO) { | ||
1889 | /* This probes for a tda9874 as is used on some | ||
1890 | Pixelview Ultra boards. */ | ||
1891 | static const unsigned short i2c_addr[] = { | ||
1892 | 0xb0 >> 1, I2C_CLIENT_END | ||
1893 | }; | ||
1894 | |||
1895 | v4l2_i2c_new_probed_subdev(&core->i2c_adap, | ||
1896 | "tvaudio", "tvaudio", i2c_addr); | ||
1897 | } | ||
1888 | 1898 | ||
1889 | switch (core->boardnr) { | 1899 | switch (core->boardnr) { |
1890 | case CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD: | 1900 | case CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD: |
1891 | case CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD: | 1901 | case CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD: { |
1902 | static struct i2c_board_info rtc_info = { | ||
1903 | I2C_BOARD_INFO("isl1208", 0x6f) | ||
1904 | }; | ||
1905 | |||
1892 | request_module("rtc-isl1208"); | 1906 | request_module("rtc-isl1208"); |
1907 | core->i2c_rtc = i2c_new_device(&core->i2c_adap, &rtc_info); | ||
1908 | } | ||
1893 | /* break intentionally omitted */ | 1909 | /* break intentionally omitted */ |
1894 | case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO: | 1910 | case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO: |
1895 | request_module("ir-kbd-i2c"); | 1911 | request_module("ir-kbd-i2c"); |