aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-09-09 02:55:34 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:14:29 -0400
commitf139fa71c03d80c1d1ee60aa4b0a3ec7a14d45f9 (patch)
treec97ab64b129867effec0d7485f711d680f8d7598
parenta6a3f14035fe94c0925fea62f3d3a7a1ab44c1f1 (diff)
V4L/DVB (6200): cx23885: use a pointer to the required i2c bus in dvb_register function
Store a pointer to the required i2c_bus so that we do not put the wrong analog demod into standby. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Steven Toth <stoth@hauppauge.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/video/cx23885/cx23885-dvb.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c
index e0dc1495b8c..d952f3a6753 100644
--- a/drivers/media/video/cx23885/cx23885-dvb.c
+++ b/drivers/media/video/cx23885/cx23885-dvb.c
@@ -112,6 +112,7 @@ static struct lgdt330x_config fusionhdtv_5_express = {
112static int dvb_register(struct cx23885_tsport *port) 112static int dvb_register(struct cx23885_tsport *port)
113{ 113{
114 struct cx23885_dev *dev = port->dev; 114 struct cx23885_dev *dev = port->dev;
115 struct cx23885_i2c *i2c_bus = NULL;
115 116
116 /* init struct videobuf_dvb */ 117 /* init struct videobuf_dvb */
117 port->dvb.name = dev->name; 118 port->dvb.name = dev->name;
@@ -120,33 +121,35 @@ static int dvb_register(struct cx23885_tsport *port)
120 switch (dev->board) { 121 switch (dev->board) {
121 case CX23885_BOARD_HAUPPAUGE_HVR1250: 122 case CX23885_BOARD_HAUPPAUGE_HVR1250:
122 case CX23885_BOARD_HAUPPAUGE_HVR1800: 123 case CX23885_BOARD_HAUPPAUGE_HVR1800:
124 i2c_bus = &dev->i2c_bus[0];
123 port->dvb.frontend = dvb_attach(s5h1409_attach, 125 port->dvb.frontend = dvb_attach(s5h1409_attach,
124 &hauppauge_generic_config, 126 &hauppauge_generic_config,
125 &dev->i2c_bus[0].i2c_adap); 127 &i2c_bus->i2c_adap);
126 if (port->dvb.frontend != NULL) { 128 if (port->dvb.frontend != NULL) {
127 dvb_attach(mt2131_attach, port->dvb.frontend, 129 dvb_attach(mt2131_attach, port->dvb.frontend,
128 &dev->i2c_bus[0].i2c_adap, 130 &i2c_bus->i2c_adap,
129 &hauppauge_generic_tunerconfig, 0); 131 &hauppauge_generic_tunerconfig, 0);
130 } 132 }
131 break; 133 break;
132 case CX23885_BOARD_HAUPPAUGE_HVR1800lp: 134 case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
135 i2c_bus = &dev->i2c_bus[0];
133 port->dvb.frontend = dvb_attach(s5h1409_attach, 136 port->dvb.frontend = dvb_attach(s5h1409_attach,
134 &hauppauge_hvr1800lp_config, 137 &hauppauge_hvr1800lp_config,
135 &dev->i2c_bus[0].i2c_adap); 138 &i2c_bus->i2c_adap);
136 if (port->dvb.frontend != NULL) { 139 if (port->dvb.frontend != NULL) {
137 dvb_attach(mt2131_attach, port->dvb.frontend, 140 dvb_attach(mt2131_attach, port->dvb.frontend,
138 &dev->i2c_bus[0].i2c_adap, 141 &i2c_bus->i2c_adap,
139 &hauppauge_generic_tunerconfig, 0); 142 &hauppauge_generic_tunerconfig, 0);
140 } 143 }
141 break; 144 break;
142 case CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP: 145 case CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP:
146 i2c_bus = &dev->i2c_bus[0];
143 port->dvb.frontend = dvb_attach(lgdt330x_attach, 147 port->dvb.frontend = dvb_attach(lgdt330x_attach,
144 &fusionhdtv_5_express, 148 &fusionhdtv_5_express,
145 &dev->i2c_bus[0].i2c_adap); 149 &i2c_bus->i2c_adap);
146 if (port->dvb.frontend != NULL) { 150 if (port->dvb.frontend != NULL) {
147 dvb_attach(dvb_pll_attach, port->dvb.frontend, 151 dvb_attach(dvb_pll_attach, port->dvb.frontend, 0x61,
148 0x61, &dev->i2c_bus[0].i2c_adap, 152 &i2c_bus->i2c_adap, DVB_PLL_LG_TDVS_H06XF);
149 DVB_PLL_LG_TDVS_H06XF);
150 } 153 }
151 break; 154 break;
152 default: 155 default:
@@ -160,8 +163,7 @@ static int dvb_register(struct cx23885_tsport *port)
160 } 163 }
161 164
162 /* Put the analog decoder in standby to keep it quiet */ 165 /* Put the analog decoder in standby to keep it quiet */
163 /* Assumption here: analog decoder is only on i2c bus 0 */ 166 cx23885_call_i2c_clients(i2c_bus, TUNER_SET_STANDBY, NULL);
164 cx23885_call_i2c_clients (&dev->i2c_bus[0], TUNER_SET_STANDBY, NULL);
165 167
166 /* register everything */ 168 /* register everything */
167 return videobuf_dvb_register(&port->dvb, THIS_MODULE, port, 169 return videobuf_dvb_register(&port->dvb, THIS_MODULE, port,