aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2/pvrusb2-audio.c
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2007-01-19 22:09:47 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-02-21 10:34:38 -0500
commit18103c57b0168ebc0401702d483fe131f0aecc7a (patch)
tree1d57e73217254121f0c023009c510a4936332d64 /drivers/media/video/pvrusb2/pvrusb2-audio.c
parentaf78a48b69231e129db0e1db24053da22f8eed6d (diff)
V4L/DVB (5081): Pvrusb2: VIDIOC_G_TUNER cleanup
Clean up use of VIDIOC_G_TUNER; we now correctly gather info from all the I2C client modules. Also abide by V4L2_TUNER_CAP_LOW appropriately. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-audio.c')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-audio.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-audio.c b/drivers/media/video/pvrusb2/pvrusb2-audio.c
index 122496f36845..5d30c9366144 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-audio.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-audio.c
@@ -31,7 +31,6 @@ struct pvr2_msp3400_handler {
31 struct pvr2_hdw *hdw; 31 struct pvr2_hdw *hdw;
32 struct pvr2_i2c_client *client; 32 struct pvr2_i2c_client *client;
33 struct pvr2_i2c_handler i2c_handler; 33 struct pvr2_i2c_handler i2c_handler;
34 struct pvr2_audio_stat astat;
35 unsigned long stale_mask; 34 unsigned long stale_mask;
36}; 35};
37 36
@@ -126,27 +125,9 @@ static void msp3400_update(struct pvr2_msp3400_handler *ctxt)
126} 125}
127 126
128 127
129/* This reads back the current signal type */
130static int get_audio_status(struct pvr2_msp3400_handler *ctxt)
131{
132 struct v4l2_tuner vt;
133 int stat;
134
135 memset(&vt,0,sizeof(vt));
136 stat = pvr2_i2c_client_cmd(ctxt->client,VIDIOC_G_TUNER,&vt);
137 if (stat < 0) return stat;
138
139 ctxt->hdw->flag_stereo = (vt.audmode & V4L2_TUNER_MODE_STEREO) != 0;
140 ctxt->hdw->flag_bilingual =
141 (vt.audmode & V4L2_TUNER_MODE_LANG2) != 0;
142 return 0;
143}
144
145
146static void pvr2_msp3400_detach(struct pvr2_msp3400_handler *ctxt) 128static void pvr2_msp3400_detach(struct pvr2_msp3400_handler *ctxt)
147{ 129{
148 ctxt->client->handler = NULL; 130 ctxt->client->handler = NULL;
149 ctxt->hdw->audio_stat = NULL;
150 kfree(ctxt); 131 kfree(ctxt);
151} 132}
152 133
@@ -169,7 +150,6 @@ static const struct pvr2_i2c_handler_functions msp3400_funcs = {
169int pvr2_i2c_msp3400_setup(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) 150int pvr2_i2c_msp3400_setup(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
170{ 151{
171 struct pvr2_msp3400_handler *ctxt; 152 struct pvr2_msp3400_handler *ctxt;
172 if (hdw->audio_stat) return 0;
173 if (cp->handler) return 0; 153 if (cp->handler) return 0;
174 154
175 ctxt = kmalloc(sizeof(*ctxt),GFP_KERNEL); 155 ctxt = kmalloc(sizeof(*ctxt),GFP_KERNEL);
@@ -180,13 +160,9 @@ int pvr2_i2c_msp3400_setup(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
180 ctxt->i2c_handler.func_table = &msp3400_funcs; 160 ctxt->i2c_handler.func_table = &msp3400_funcs;
181 ctxt->client = cp; 161 ctxt->client = cp;
182 ctxt->hdw = hdw; 162 ctxt->hdw = hdw;
183 ctxt->astat.ctxt = ctxt;
184 ctxt->astat.status = (int (*)(void *))get_audio_status;
185 ctxt->astat.detach = (void (*)(void *))pvr2_msp3400_detach;
186 ctxt->stale_mask = (1 << (sizeof(msp3400_ops)/ 163 ctxt->stale_mask = (1 << (sizeof(msp3400_ops)/
187 sizeof(msp3400_ops[0]))) - 1; 164 sizeof(msp3400_ops[0]))) - 1;
188 cp->handler = &ctxt->i2c_handler; 165 cp->handler = &ctxt->i2c_handler;
189 hdw->audio_stat = &ctxt->astat;
190 pvr2_trace(PVR2_TRACE_CHIPS,"i2c 0x%x msp3400 V4L2 handler set up", 166 pvr2_trace(PVR2_TRACE_CHIPS,"i2c 0x%x msp3400 V4L2 handler set up",
191 cp->client->addr); 167 cp->client->addr);
192 return !0; 168 return !0;