aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-i2c.c
diff options
context:
space:
mode:
authorDarron Broad <darron@kewl.org>2008-10-11 10:31:41 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-17 16:23:28 -0400
commit8e739090d6cdd43ddf938a3899c4f929db8d5ba8 (patch)
tree464c3fd04768f4f6d89763367c1f27429d18432b /drivers/media/video/cx88/cx88-i2c.c
parentf972e0bd9361594071d3e68e2342c53b51a1d42b (diff)
V4L/DVB (9225): MFE: Add configurable gate control
This adds a configurable (one per card) gate control option for multi-frontend. Prior to this point gate control was assumed to be on the primary frontend, this is a fault when the gate to the analogue section is on the secondary which is the default for both the HVR-3000 and HVR-4000 in MFE. Signed-off-by: Darron Broad <darron@kewl.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx88/cx88-i2c.c')
-rw-r--r--drivers/media/video/cx88/cx88-i2c.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
index 582769de26b5..01de23007095 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -116,23 +116,25 @@ static int detach_inform(struct i2c_client *client)
116 116
117void cx88_call_i2c_clients(struct cx88_core *core, unsigned int cmd, void *arg) 117void cx88_call_i2c_clients(struct cx88_core *core, unsigned int cmd, void *arg)
118{ 118{
119 struct videobuf_dvb_frontend *fe0 = NULL; 119 struct videobuf_dvb_frontends *f = &core->dvbdev->frontends;
120 struct videobuf_dvb_frontend *fe = NULL;
120 if (0 != core->i2c_rc) 121 if (0 != core->i2c_rc)
121 return; 122 return;
122 123
123#if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE) 124#if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE)
124 if (core->dvbdev) { 125 if (core->dvbdev && f) {
125 /* Get the first frontend and assume that all I2C is routed through it */ 126 if(f->gate <= 1) /* undefined or fe0 */
126 /* TODO: Get _THIS_FE_ then find the right i2c_gate_ctrl for it */ 127 fe = videobuf_dvb_get_frontend(f, 1);
127 fe0 = videobuf_dvb_get_frontend(&core->dvbdev->frontends, 1); 128 else
129 fe = videobuf_dvb_get_frontend(f, f->gate);
128 130
129 if (fe0 && fe0->dvb.frontend && fe0->dvb.frontend->ops.i2c_gate_ctrl) 131 if (fe && fe->dvb.frontend && fe->dvb.frontend->ops.i2c_gate_ctrl)
130 fe0->dvb.frontend->ops.i2c_gate_ctrl(fe0->dvb.frontend, 1); 132 fe->dvb.frontend->ops.i2c_gate_ctrl(fe->dvb.frontend, 1);
131 133
132 i2c_clients_command(&core->i2c_adap, cmd, arg); 134 i2c_clients_command(&core->i2c_adap, cmd, arg);
133 135
134 if (fe0 && fe0->dvb.frontend && fe0->dvb.frontend->ops.i2c_gate_ctrl) 136 if (fe && fe->dvb.frontend && fe->dvb.frontend->ops.i2c_gate_ctrl)
135 fe0->dvb.frontend->ops.i2c_gate_ctrl(fe0->dvb.frontend, 0); 137 fe->dvb.frontend->ops.i2c_gate_ctrl(fe->dvb.frontend, 0);
136 } else 138 } else
137#endif 139#endif
138 i2c_clients_command(&core->i2c_adap, cmd, arg); 140 i2c_clients_command(&core->i2c_adap, cmd, arg);