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 | |
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>
-rw-r--r-- | drivers/media/video/cx88/cx88-blackbird.c | 4 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-cards.c | 40 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-core.c | 7 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-dvb.c | 2 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-i2c.c | 41 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-video.c | 40 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88.h | 14 |
7 files changed, 80 insertions, 68 deletions
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c index 484df549345c..44eacfb0d0d6 100644 --- a/drivers/media/video/cx88/cx88-blackbird.c +++ b/drivers/media/video/cx88/cx88-blackbird.c | |||
@@ -915,7 +915,7 @@ static int vidioc_log_status (struct file *file, void *priv) | |||
915 | snprintf(name, sizeof(name), "%s/2", core->name); | 915 | snprintf(name, sizeof(name), "%s/2", core->name); |
916 | printk("%s/2: ============ START LOG STATUS ============\n", | 916 | printk("%s/2: ============ START LOG STATUS ============\n", |
917 | core->name); | 917 | core->name); |
918 | cx88_call_i2c_clients(core, VIDIOC_LOG_STATUS, NULL); | 918 | call_all(core, core, log_status); |
919 | cx2341x_log_status(&dev->params, name); | 919 | cx2341x_log_status(&dev->params, name); |
920 | printk("%s/2: ============= END LOG STATUS =============\n", | 920 | printk("%s/2: ============= END LOG STATUS =============\n", |
921 | core->name); | 921 | core->name); |
@@ -970,7 +970,7 @@ static int vidioc_g_frequency (struct file *file, void *priv, | |||
970 | 970 | ||
971 | f->type = V4L2_TUNER_ANALOG_TV; | 971 | f->type = V4L2_TUNER_ANALOG_TV; |
972 | f->frequency = core->freq; | 972 | f->frequency = core->freq; |
973 | cx88_call_i2c_clients(core,VIDIOC_G_FREQUENCY,f); | 973 | call_all(core, tuner, g_frequency, f); |
974 | 974 | ||
975 | return 0; | 975 | return 0; |
976 | } | 976 | } |
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 348f6ef08b2a..c226fff49f23 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c | |||
@@ -732,6 +732,8 @@ static const struct cx88_board cx88_boards[] = { | |||
732 | .radio_type = UNSET, | 732 | .radio_type = UNSET, |
733 | .tuner_addr = ADDR_UNSET, | 733 | .tuner_addr = ADDR_UNSET, |
734 | .radio_addr = ADDR_UNSET, | 734 | .radio_addr = ADDR_UNSET, |
735 | /* Some variants use a tda9874 and so need the tvaudio module. */ | ||
736 | .audio_chip = V4L2_IDENT_TVAUDIO, | ||
735 | .input = {{ | 737 | .input = {{ |
736 | .type = CX88_VMUX_TELEVISION, | 738 | .type = CX88_VMUX_TELEVISION, |
737 | .vmux = 0, | 739 | .vmux = 0, |
@@ -2985,7 +2987,7 @@ static void cx88_card_setup(struct cx88_core *core) | |||
2985 | tea5767_cfg.tuner = TUNER_TEA5767; | 2987 | tea5767_cfg.tuner = TUNER_TEA5767; |
2986 | tea5767_cfg.priv = &ctl; | 2988 | tea5767_cfg.priv = &ctl; |
2987 | 2989 | ||
2988 | cx88_call_i2c_clients(core, TUNER_SET_CONFIG, &tea5767_cfg); | 2990 | call_all(core, tuner, s_config, &tea5767_cfg); |
2989 | break; | 2991 | break; |
2990 | } | 2992 | } |
2991 | case CX88_BOARD_TEVII_S420: | 2993 | case CX88_BOARD_TEVII_S420: |
@@ -3010,7 +3012,7 @@ static void cx88_card_setup(struct cx88_core *core) | |||
3010 | tun_setup.type = core->board.radio_type; | 3012 | tun_setup.type = core->board.radio_type; |
3011 | tun_setup.addr = core->board.radio_addr; | 3013 | tun_setup.addr = core->board.radio_addr; |
3012 | tun_setup.tuner_callback = cx88_tuner_callback; | 3014 | tun_setup.tuner_callback = cx88_tuner_callback; |
3013 | cx88_call_i2c_clients(core, TUNER_SET_TYPE_ADDR, &tun_setup); | 3015 | call_all(core, tuner, s_type_addr, &tun_setup); |
3014 | mode_mask &= ~T_RADIO; | 3016 | mode_mask &= ~T_RADIO; |
3015 | } | 3017 | } |
3016 | 3018 | ||
@@ -3020,7 +3022,7 @@ static void cx88_card_setup(struct cx88_core *core) | |||
3020 | tun_setup.addr = core->board.tuner_addr; | 3022 | tun_setup.addr = core->board.tuner_addr; |
3021 | tun_setup.tuner_callback = cx88_tuner_callback; | 3023 | tun_setup.tuner_callback = cx88_tuner_callback; |
3022 | 3024 | ||
3023 | cx88_call_i2c_clients(core, TUNER_SET_TYPE_ADDR, &tun_setup); | 3025 | call_all(core, tuner, s_type_addr, &tun_setup); |
3024 | } | 3026 | } |
3025 | 3027 | ||
3026 | if (core->board.tda9887_conf) { | 3028 | if (core->board.tda9887_conf) { |
@@ -3029,7 +3031,7 @@ static void cx88_card_setup(struct cx88_core *core) | |||
3029 | tda9887_cfg.tuner = TUNER_TDA9887; | 3031 | tda9887_cfg.tuner = TUNER_TDA9887; |
3030 | tda9887_cfg.priv = &core->board.tda9887_conf; | 3032 | tda9887_cfg.priv = &core->board.tda9887_conf; |
3031 | 3033 | ||
3032 | cx88_call_i2c_clients(core, TUNER_SET_CONFIG, &tda9887_cfg); | 3034 | call_all(core, tuner, s_config, &tda9887_cfg); |
3033 | } | 3035 | } |
3034 | 3036 | ||
3035 | if (core->board.tuner_type == TUNER_XC2028) { | 3037 | if (core->board.tuner_type == TUNER_XC2028) { |
@@ -3045,9 +3047,9 @@ static void cx88_card_setup(struct cx88_core *core) | |||
3045 | xc2028_cfg.priv = &ctl; | 3047 | xc2028_cfg.priv = &ctl; |
3046 | info_printk(core, "Asking xc2028/3028 to load firmware %s\n", | 3048 | info_printk(core, "Asking xc2028/3028 to load firmware %s\n", |
3047 | ctl.fname); | 3049 | ctl.fname); |
3048 | cx88_call_i2c_clients(core, TUNER_SET_CONFIG, &xc2028_cfg); | 3050 | call_all(core, tuner, s_config, &xc2028_cfg); |
3049 | } | 3051 | } |
3050 | cx88_call_i2c_clients (core, TUNER_SET_STANDBY, NULL); | 3052 | call_all(core, core, s_standby, 0); |
3051 | } | 3053 | } |
3052 | 3054 | ||
3053 | /* ------------------------------------------------------------------ */ | 3055 | /* ------------------------------------------------------------------ */ |
@@ -3202,8 +3204,30 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) | |||
3202 | cx88_i2c_init(core, pci); | 3204 | cx88_i2c_init(core, pci); |
3203 | 3205 | ||
3204 | /* load tuner module, if needed */ | 3206 | /* load tuner module, if needed */ |
3205 | if (TUNER_ABSENT != core->board.tuner_type) | 3207 | if (TUNER_ABSENT != core->board.tuner_type) { |
3206 | request_module("tuner"); | 3208 | int has_demod = (core->board.tda9887_conf & TDA9887_PRESENT); |
3209 | |||
3210 | /* I don't trust the radio_type as is stored in the card | ||
3211 | definitions, so we just probe for it. | ||
3212 | The radio_type is sometimes missing, or set to UNSET but | ||
3213 | later code configures a tea5767. | ||
3214 | */ | ||
3215 | v4l2_i2c_new_probed_subdev(&core->i2c_adap, "tuner", "tuner", | ||
3216 | v4l2_i2c_tuner_addrs(ADDRS_RADIO)); | ||
3217 | if (has_demod) | ||
3218 | v4l2_i2c_new_probed_subdev(&core->i2c_adap, "tuner", | ||
3219 | "tuner", v4l2_i2c_tuner_addrs(ADDRS_DEMOD)); | ||
3220 | if (core->board.tuner_addr == ADDR_UNSET) { | ||
3221 | enum v4l2_i2c_tuner_type type = | ||
3222 | has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV; | ||
3223 | |||
3224 | v4l2_i2c_new_probed_subdev(&core->i2c_adap, "tuner", | ||
3225 | "tuner", v4l2_i2c_tuner_addrs(type)); | ||
3226 | } else { | ||
3227 | v4l2_i2c_new_subdev(&core->i2c_adap, | ||
3228 | "tuner", "tuner", core->board.tuner_addr); | ||
3229 | } | ||
3230 | } | ||
3207 | 3231 | ||
3208 | cx88_card_setup(core); | 3232 | cx88_card_setup(core); |
3209 | cx88_ir_init(core, pci); | 3233 | cx88_ir_init(core, pci); |
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c index 17c7dad42617..f2fb9f30bfc1 100644 --- a/drivers/media/video/cx88/cx88-core.c +++ b/drivers/media/video/cx88/cx88-core.c | |||
@@ -991,7 +991,7 @@ int cx88_set_tvnorm(struct cx88_core *core, v4l2_std_id norm) | |||
991 | set_tvaudio(core); | 991 | set_tvaudio(core); |
992 | 992 | ||
993 | // tell i2c chips | 993 | // tell i2c chips |
994 | cx88_call_i2c_clients(core,VIDIOC_S_STD,&norm); | 994 | call_all(core, tuner, s_std, norm); |
995 | 995 | ||
996 | // done | 996 | // done |
997 | return 0; | 997 | return 0; |
@@ -1059,8 +1059,11 @@ void cx88_core_put(struct cx88_core *core, struct pci_dev *pci) | |||
1059 | 1059 | ||
1060 | mutex_lock(&devlist); | 1060 | mutex_lock(&devlist); |
1061 | cx88_ir_fini(core); | 1061 | cx88_ir_fini(core); |
1062 | if (0 == core->i2c_rc) | 1062 | if (0 == core->i2c_rc) { |
1063 | if (core->i2c_rtc) | ||
1064 | i2c_unregister_device(core->i2c_rtc); | ||
1063 | i2c_del_adapter(&core->i2c_adap); | 1065 | i2c_del_adapter(&core->i2c_adap); |
1066 | } | ||
1064 | list_del(&core->devlist); | 1067 | list_del(&core->devlist); |
1065 | iounmap(core->lmmio); | 1068 | iounmap(core->lmmio); |
1066 | cx88_devcount--; | 1069 | cx88_devcount--; |
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 08346fa05cd7..4ff4d9fe0355 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c | |||
@@ -1168,7 +1168,7 @@ static int dvb_register(struct cx8802_dev *dev) | |||
1168 | fe1->dvb.frontend->ops.ts_bus_ctrl = cx88_dvb_bus_ctrl; | 1168 | fe1->dvb.frontend->ops.ts_bus_ctrl = cx88_dvb_bus_ctrl; |
1169 | 1169 | ||
1170 | /* Put the analog decoder in standby to keep it quiet */ | 1170 | /* Put the analog decoder in standby to keep it quiet */ |
1171 | cx88_call_i2c_clients(core, TUNER_SET_STANDBY, NULL); | 1171 | call_all(core, core, s_standby, 0); |
1172 | 1172 | ||
1173 | /* register everything */ | 1173 | /* register everything */ |
1174 | return videobuf_dvb_register_bus(&dev->frontends, THIS_MODULE, dev, | 1174 | return videobuf_dvb_register_bus(&dev->frontends, THIS_MODULE, dev, |
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c index 4a17a7579323..996b4ed5a4fc 100644 --- a/drivers/media/video/cx88/cx88-i2c.c +++ b/drivers/media/video/cx88/cx88-i2c.c | |||
@@ -97,39 +97,6 @@ static int cx8800_bit_getsda(void *data) | |||
97 | 97 | ||
98 | /* ----------------------------------------------------------------------- */ | 98 | /* ----------------------------------------------------------------------- */ |
99 | 99 | ||
100 | static int attach_inform(struct i2c_client *client) | ||
101 | { | ||
102 | struct v4l2_device *v4l2_dev = i2c_get_adapdata(client->adapter); | ||
103 | struct cx88_core *core = to_core(v4l2_dev); | ||
104 | |||
105 | dprintk(1, "%s i2c attach [addr=0x%x,client=%s]\n", | ||
106 | client->driver->driver.name, client->addr, client->name); | ||
107 | return 0; | ||
108 | } | ||
109 | |||
110 | static int detach_inform(struct i2c_client *client) | ||
111 | { | ||
112 | struct v4l2_device *v4l2_dev = i2c_get_adapdata(client->adapter); | ||
113 | struct cx88_core *core = to_core(v4l2_dev); | ||
114 | |||
115 | dprintk(1, "i2c detach [client=%s]\n", client->name); | ||
116 | return 0; | ||
117 | } | ||
118 | |||
119 | void cx88_call_i2c_clients(struct cx88_core *core, unsigned int cmd, void *arg) | ||
120 | { | ||
121 | if (0 != core->i2c_rc) | ||
122 | return; | ||
123 | |||
124 | if (core->gate_ctrl) | ||
125 | core->gate_ctrl(core, 1); | ||
126 | |||
127 | i2c_clients_command(&core->i2c_adap, cmd, arg); | ||
128 | |||
129 | if (core->gate_ctrl) | ||
130 | core->gate_ctrl(core, 0); | ||
131 | } | ||
132 | |||
133 | static const struct i2c_algo_bit_data cx8800_i2c_algo_template = { | 100 | static const struct i2c_algo_bit_data cx8800_i2c_algo_template = { |
134 | .setsda = cx8800_bit_setsda, | 101 | .setsda = cx8800_bit_setsda, |
135 | .setscl = cx8800_bit_setscl, | 102 | .setscl = cx8800_bit_setscl, |
@@ -175,17 +142,11 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci) | |||
175 | memcpy(&core->i2c_algo, &cx8800_i2c_algo_template, | 142 | memcpy(&core->i2c_algo, &cx8800_i2c_algo_template, |
176 | sizeof(core->i2c_algo)); | 143 | sizeof(core->i2c_algo)); |
177 | 144 | ||
178 | if (core->board.tuner_type != TUNER_ABSENT) | ||
179 | core->i2c_adap.class |= I2C_CLASS_TV_ANALOG; | ||
180 | if (core->board.mpeg & CX88_MPEG_DVB) | ||
181 | core->i2c_adap.class |= I2C_CLASS_TV_DIGITAL; | ||
182 | 145 | ||
183 | core->i2c_adap.dev.parent = &pci->dev; | 146 | core->i2c_adap.dev.parent = &pci->dev; |
184 | strlcpy(core->i2c_adap.name,core->name,sizeof(core->i2c_adap.name)); | 147 | strlcpy(core->i2c_adap.name,core->name,sizeof(core->i2c_adap.name)); |
185 | core->i2c_adap.owner = THIS_MODULE; | 148 | core->i2c_adap.owner = THIS_MODULE; |
186 | core->i2c_adap.id = I2C_HW_B_CX2388x; | 149 | core->i2c_adap.id = I2C_HW_B_CX2388x; |
187 | core->i2c_adap.client_register = attach_inform; | ||
188 | core->i2c_adap.client_unregister = detach_inform; | ||
189 | core->i2c_algo.udelay = i2c_udelay; | 150 | core->i2c_algo.udelay = i2c_udelay; |
190 | core->i2c_algo.data = core; | 151 | core->i2c_algo.data = core; |
191 | i2c_set_adapdata(&core->i2c_adap, &core->v4l2_dev); | 152 | i2c_set_adapdata(&core->i2c_adap, &core->v4l2_dev); |
@@ -224,8 +185,6 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci) | |||
224 | 185 | ||
225 | /* ----------------------------------------------------------------------- */ | 186 | /* ----------------------------------------------------------------------- */ |
226 | 187 | ||
227 | EXPORT_SYMBOL(cx88_call_i2c_clients); | ||
228 | |||
229 | /* | 188 | /* |
230 | * Local variables: | 189 | * Local variables: |
231 | * c-basic-offset: 8 | 190 | * c-basic-offset: 8 |
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"); |
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index 890018c48cd8..9a43fdf20fae 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h | |||
@@ -328,6 +328,7 @@ struct cx88_core { | |||
328 | 328 | ||
329 | /* config info -- analog */ | 329 | /* config info -- analog */ |
330 | struct v4l2_device v4l2_dev; | 330 | struct v4l2_device v4l2_dev; |
331 | struct i2c_client *i2c_rtc; | ||
331 | unsigned int boardnr; | 332 | unsigned int boardnr; |
332 | struct cx88_board board; | 333 | struct cx88_board board; |
333 | 334 | ||
@@ -371,6 +372,17 @@ static inline struct cx88_core *to_core(struct v4l2_device *v4l2_dev) | |||
371 | return container_of(v4l2_dev, struct cx88_core, v4l2_dev); | 372 | return container_of(v4l2_dev, struct cx88_core, v4l2_dev); |
372 | } | 373 | } |
373 | 374 | ||
375 | #define call_all(core, o, f, args...) \ | ||
376 | do { \ | ||
377 | if (!core->i2c_rc) { \ | ||
378 | if (core->gate_ctrl) \ | ||
379 | core->gate_ctrl(core, 1); \ | ||
380 | v4l2_device_call_all(&core->v4l2_dev, 0, o, f, ##args); \ | ||
381 | if (core->gate_ctrl) \ | ||
382 | core->gate_ctrl(core, 0); \ | ||
383 | } \ | ||
384 | } while (0) | ||
385 | |||
374 | struct cx8800_dev; | 386 | struct cx8800_dev; |
375 | struct cx8802_dev; | 387 | struct cx8802_dev; |
376 | 388 | ||
@@ -616,8 +628,6 @@ extern struct videobuf_queue_ops cx8800_vbi_qops; | |||
616 | /* cx88-i2c.c */ | 628 | /* cx88-i2c.c */ |
617 | 629 | ||
618 | extern int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci); | 630 | extern int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci); |
619 | extern void cx88_call_i2c_clients(struct cx88_core *core, | ||
620 | unsigned int cmd, void *arg); | ||
621 | 631 | ||
622 | 632 | ||
623 | /* ----------------------------------------------------------- */ | 633 | /* ----------------------------------------------------------- */ |