diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-01-06 14:06:07 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-01-07 19:18:56 -0500 |
commit | e32fadc4c2e5975a8e40541e2ba72a7032ed4cf4 (patch) | |
tree | 7718a6d3d28f6e70d8c51e8ef0eef72022935c19 /drivers/media/video/cx88/cx88-i2c.c | |
parent | 571d864c68d429a82fd61e97404a2de210ffc72d (diff) |
V4L/DVB (10190): cx88: Fix some Kbuild troubles
As Randy Dunlap <randy.dunlap@oracle.com> reported, cx88 has some compilation issues:
drivers/built-in.o: In function `cx88_call_i2c_clients':
(.text+0x20af17): undefined reference to `videobuf_dvb_get_frontend'
drivers/built-in.o: In function `cx8802_probe':
cx88-mpeg.c:(.devinit.text+0x268c4): undefined reference to `videobuf_dvb_alloc_frontend'
cx88-mpeg.c:(.devinit.text+0x268ea): undefined reference to `videobuf_dvb_dealloc_frontends'
With those configs:
CONFIG_VIDEO_CX88=y
CONFIG_VIDEO_CX88_BLACKBIRD=y
CONFIG_VIDEO_CX88_DVB=m
CONFIG_DVB_CORE=m
After carefully examining the code, with the current code, several cx88 drivers
(cx8800, cx8802, cx88_dvb and cx88_blackbird) should be compiled as a module,
if one of them is marked as such. Just fixing Kconfig could create a very complex
set of rules. Also, this hides a problem with the current approach where the dvb
functionality weren't confined inside dvb module.
What happens is that:
- cx88-i2c (part of cx8800) has some special rules if DVB;
- cx88-mpeg (cx8802 module) has also part of DVB init code;
- cx88-dvb has the rest of the dvb code;
- cx88-blackbird can be used with cx88-mpeg, having cx88-dvb or not.
So, instead of doing some tricks at Kconfig and wait for a next breakage,
this patch moves the dvb code inside cx88-i2c and cx88-mpeg into cx88-dvb.
Another problem is that cx8802 were being compiled, even without cx88-dvb
and cx88-blackbird modules.
While on this code, let's fix also a reported problem:
http://www.linuxtv.org/pipermail/linux-dvb/2009-January/031225.html
A solution for the issue were proposed here:
http://www.mail-archive.com/linux-media@vger.kernel.org/msg00021.html
Thanks to Randy, Andy, Gregoire and Thomas for helping us to detect
and solve the issues.
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.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c index 1ab691d20692..c0ff2305d804 100644 --- a/drivers/media/video/cx88/cx88-i2c.c +++ b/drivers/media/video/cx88/cx88-i2c.c | |||
@@ -116,30 +116,16 @@ static int detach_inform(struct i2c_client *client) | |||
116 | 116 | ||
117 | void cx88_call_i2c_clients(struct cx88_core *core, unsigned int cmd, void *arg) | 117 | void cx88_call_i2c_clients(struct cx88_core *core, unsigned int cmd, void *arg) |
118 | { | 118 | { |
119 | #if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE) | ||
120 | struct videobuf_dvb_frontends *f = &core->dvbdev->frontends; | ||
121 | struct videobuf_dvb_frontend *fe = NULL; | ||
122 | #endif | ||
123 | if (0 != core->i2c_rc) | 119 | if (0 != core->i2c_rc) |
124 | return; | 120 | return; |
125 | 121 | ||
126 | #if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE) | 122 | if (core->gate_ctrl) |
127 | if (core->dvbdev && f) { | 123 | core->gate_ctrl(core, 1); |
128 | if(f->gate <= 1) /* undefined or fe0 */ | ||
129 | fe = videobuf_dvb_get_frontend(f, 1); | ||
130 | else | ||
131 | fe = videobuf_dvb_get_frontend(f, f->gate); | ||
132 | 124 | ||
133 | if (fe && fe->dvb.frontend && fe->dvb.frontend->ops.i2c_gate_ctrl) | 125 | i2c_clients_command(&core->i2c_adap, cmd, arg); |
134 | fe->dvb.frontend->ops.i2c_gate_ctrl(fe->dvb.frontend, 1); | ||
135 | 126 | ||
136 | i2c_clients_command(&core->i2c_adap, cmd, arg); | 127 | if (core->gate_ctrl) |
137 | 128 | core->gate_ctrl(core, 0); | |
138 | if (fe && fe->dvb.frontend && fe->dvb.frontend->ops.i2c_gate_ctrl) | ||
139 | fe->dvb.frontend->ops.i2c_gate_ctrl(fe->dvb.frontend, 0); | ||
140 | } else | ||
141 | #endif | ||
142 | i2c_clients_command(&core->i2c_adap, cmd, arg); | ||
143 | } | 129 | } |
144 | 130 | ||
145 | static const struct i2c_algo_bit_data cx8800_i2c_algo_template = { | 131 | static const struct i2c_algo_bit_data cx8800_i2c_algo_template = { |