From 1a4aa920d0b49af2c0d9bbedb3bb75be4e174218 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 26 Sep 2010 20:01:51 -0300 Subject: [PATCH] [media] cx231xx: properly use the right tuner i2c address The driver has a field to indicate what bus is used by tuner and by demod. However, this field were never used. On Pixelview, it uses I2C 2 for tuner, instead of I2C 1. drivers/media/video/cx231xx/cx231xx-cards.c Acked-by: Sri Deevi Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx231xx/cx231xx-cards.c | 2 +- drivers/media/video/cx231xx/cx231xx-dvb.c | 24 ++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c b/drivers/media/video/cx231xx/cx231xx-cards.c index b516068b6edb..8e088db1a568 100644 --- a/drivers/media/video/cx231xx/cx231xx-cards.c +++ b/drivers/media/video/cx231xx/cx231xx-cards.c @@ -569,7 +569,7 @@ void cx231xx_card_setup(struct cx231xx *dev) /* Initialize the tuner */ if (dev->board.tuner_type != TUNER_ABSENT) { dev->sd_tuner = v4l2_i2c_new_subdev(&dev->v4l2_dev, - &dev->i2c_bus[1].i2c_adap, + &dev->i2c_bus[dev->board.tuner_i2c_master].i2c_adap, "tuner", "tuner", dev->tuner_addr, NULL); if (dev->sd_tuner == NULL) diff --git a/drivers/media/video/cx231xx/cx231xx-dvb.c b/drivers/media/video/cx231xx/cx231xx-dvb.c index 879eacb2c9c4..4efd3d3a6a73 100644 --- a/drivers/media/video/cx231xx/cx231xx-dvb.c +++ b/drivers/media/video/cx231xx/cx231xx-dvb.c @@ -347,7 +347,7 @@ static int attach_xc5000(u8 addr, struct cx231xx *dev) struct xc5000_config cfg; memset(&cfg, 0, sizeof(cfg)); - cfg.i2c_adap = &dev->i2c_bus[1].i2c_adap; + cfg.i2c_adap = &dev->i2c_bus[dev->board.tuner_i2c_master].i2c_adap; cfg.i2c_addr = addr; if (!dev->dvb->frontend) { @@ -573,7 +573,7 @@ static int dvb_init(struct cx231xx *dev) dev->dvb->frontend = dvb_attach(s5h1432_attach, &dvico_s5h1432_config, - &dev->i2c_bus[2].i2c_adap); + &dev->i2c_bus[dev->board.demod_i2c_master].i2c_adap); if (dev->dvb->frontend == NULL) { printk(DRIVER_NAME @@ -586,7 +586,7 @@ static int dvb_init(struct cx231xx *dev) dvb->frontend->callback = cx231xx_tuner_callback; if (!dvb_attach(xc5000_attach, dev->dvb->frontend, - &dev->i2c_bus[1].i2c_adap, + &dev->i2c_bus[dev->board.tuner_i2c_master].i2c_adap, &cnxt_rde250_tunerconfig)) { result = -EINVAL; goto out_free; @@ -598,7 +598,7 @@ static int dvb_init(struct cx231xx *dev) dev->dvb->frontend = dvb_attach(s5h1411_attach, &xc5000_s5h1411_config, - &dev->i2c_bus[2].i2c_adap); + &dev->i2c_bus[dev->board.demod_i2c_master].i2c_adap); if (dev->dvb->frontend == NULL) { printk(DRIVER_NAME @@ -611,7 +611,7 @@ static int dvb_init(struct cx231xx *dev) dvb->frontend->callback = cx231xx_tuner_callback; if (!dvb_attach(xc5000_attach, dev->dvb->frontend, - &dev->i2c_bus[1].i2c_adap, + &dev->i2c_bus[dev->board.tuner_i2c_master].i2c_adap, &cnxt_rdu250_tunerconfig)) { result = -EINVAL; goto out_free; @@ -621,7 +621,7 @@ static int dvb_init(struct cx231xx *dev) dev->dvb->frontend = dvb_attach(s5h1432_attach, &dvico_s5h1432_config, - &dev->i2c_bus[2].i2c_adap); + &dev->i2c_bus[dev->board.demod_i2c_master].i2c_adap); if (dev->dvb->frontend == NULL) { printk(DRIVER_NAME @@ -634,7 +634,7 @@ static int dvb_init(struct cx231xx *dev) dvb->frontend->callback = cx231xx_tuner_callback; if (!dvb_attach(tda18271_attach, dev->dvb->frontend, - 0x60, &dev->i2c_bus[1].i2c_adap, + 0x60, &dev->i2c_bus[dev->board.tuner_i2c_master].i2c_adap, &cnxt_rde253s_tunerconfig)) { result = -EINVAL; goto out_free; @@ -644,7 +644,7 @@ static int dvb_init(struct cx231xx *dev) dev->dvb->frontend = dvb_attach(s5h1411_attach, &tda18271_s5h1411_config, - &dev->i2c_bus[2].i2c_adap); + &dev->i2c_bus[dev->board.demod_i2c_master].i2c_adap); if (dev->dvb->frontend == NULL) { printk(DRIVER_NAME @@ -657,7 +657,7 @@ static int dvb_init(struct cx231xx *dev) dvb->frontend->callback = cx231xx_tuner_callback; if (!dvb_attach(tda18271_attach, dev->dvb->frontend, - 0x60, &dev->i2c_bus[1].i2c_adap, + 0x60, &dev->i2c_bus[dev->board.tuner_i2c_master].i2c_adap, &cnxt_rde253s_tunerconfig)) { result = -EINVAL; goto out_free; @@ -666,11 +666,11 @@ static int dvb_init(struct cx231xx *dev) case CX231XX_BOARD_HAUPPAUGE_EXETER: printk(KERN_INFO "%s: looking for tuner / demod on i2c bus: %d\n", - __func__, i2c_adapter_id(&dev->i2c_bus[1].i2c_adap)); + __func__, i2c_adapter_id(&dev->i2c_bus[dev->board.tuner_i2c_master].i2c_adap)); dev->dvb->frontend = dvb_attach(lgdt3305_attach, &hcw_lgdt3305_config, - &dev->i2c_bus[1].i2c_adap); + &dev->i2c_bus[dev->board.tuner_i2c_master].i2c_adap); if (dev->dvb->frontend == NULL) { printk(DRIVER_NAME @@ -683,7 +683,7 @@ static int dvb_init(struct cx231xx *dev) dvb->frontend->callback = cx231xx_tuner_callback; dvb_attach(tda18271_attach, dev->dvb->frontend, - 0x60, &dev->i2c_bus[1].i2c_adap, + 0x60, &dev->i2c_bus[dev->board.tuner_i2c_master].i2c_adap, &hcw_tda18271_config); break; -- 2.39.5