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-cards.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-cards.c')
-rw-r--r-- | drivers/media/video/cx88/cx88-cards.c | 40 |
1 files changed, 32 insertions, 8 deletions
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); |