aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-02-08 06:50:50 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:42:42 -0400
commit18b1ae7dd83e4ec5ab28711e4b28e4b2e1c0b53c (patch)
tree1a5743292746784fcbd1659d3b029c58aea7619f /drivers
parent31063814400cd37d47f5f58a96e58596196f04b0 (diff)
V4L/DVB (10506): saa7134: move tuner init code to saa7134-cards
On certain devices, before opening a tuner, we need to open the tuner gate via i2c. This patch just moves the tuner probing code to the same place where such i2c commands are handled, to make easier to fix this trouble on later patches. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c24
-rw-r--r--drivers/media/video/saa7134/saa7134-core.c24
2 files changed, 24 insertions, 24 deletions
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index 42684d162040..99450cbd42bd 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -6197,6 +6197,30 @@ int saa7134_board_init2(struct saa7134_dev *dev)
6197 unsigned char buf; 6197 unsigned char buf;
6198 int board; 6198 int board;
6199 6199
6200 /* initialize hardware #2 */
6201 if (TUNER_ABSENT != dev->tuner_type) {
6202 int has_demod = (dev->tda9887_conf & TDA9887_PRESENT);
6203
6204 /* Note: radio tuner address is always filled in,
6205 so we do not need to probe for a radio tuner device. */
6206 if (dev->radio_type != UNSET)
6207 v4l2_i2c_new_subdev(&dev->i2c_adap,
6208 "tuner", "tuner", dev->radio_addr);
6209 if (has_demod)
6210 v4l2_i2c_new_probed_subdev(&dev->i2c_adap, "tuner",
6211 "tuner", v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
6212 if (dev->tuner_addr == ADDR_UNSET) {
6213 enum v4l2_i2c_tuner_type type =
6214 has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV;
6215
6216 v4l2_i2c_new_probed_subdev(&dev->i2c_adap, "tuner",
6217 "tuner", v4l2_i2c_tuner_addrs(type));
6218 } else {
6219 v4l2_i2c_new_subdev(&dev->i2c_adap,
6220 "tuner", "tuner", dev->tuner_addr);
6221 }
6222 }
6223
6200 switch (dev->board) { 6224 switch (dev->board) {
6201 case SAA7134_BOARD_BMK_MPEX_NOTUNER: 6225 case SAA7134_BOARD_BMK_MPEX_NOTUNER:
6202 case SAA7134_BOARD_BMK_MPEX_TUNER: 6226 case SAA7134_BOARD_BMK_MPEX_TUNER:
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index b0f886e27c60..6a1738dccda7 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -973,30 +973,6 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
973 /* wait a bit, register i2c bus */ 973 /* wait a bit, register i2c bus */
974 msleep(100); 974 msleep(100);
975 saa7134_i2c_register(dev); 975 saa7134_i2c_register(dev);
976
977 /* initialize hardware #2 */
978 if (TUNER_ABSENT != dev->tuner_type) {
979 int has_demod = (dev->tda9887_conf & TDA9887_PRESENT);
980
981 /* Note: radio tuner address is always filled in,
982 so we do not need to probe for a radio tuner device. */
983 if (dev->radio_type != UNSET)
984 v4l2_i2c_new_subdev(&dev->i2c_adap,
985 "tuner", "tuner", dev->radio_addr);
986 if (has_demod)
987 v4l2_i2c_new_probed_subdev(&dev->i2c_adap, "tuner",
988 "tuner", v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
989 if (dev->tuner_addr == ADDR_UNSET) {
990 enum v4l2_i2c_tuner_type type =
991 has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV;
992
993 v4l2_i2c_new_probed_subdev(&dev->i2c_adap, "tuner",
994 "tuner", v4l2_i2c_tuner_addrs(type));
995 } else {
996 v4l2_i2c_new_subdev(&dev->i2c_adap,
997 "tuner", "tuner", dev->tuner_addr);
998 }
999 }
1000 saa7134_board_init2(dev); 976 saa7134_board_init2(dev);
1001 977
1002 saa7134_hwinit2(dev); 978 saa7134_hwinit2(dev);