aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2007-01-19 23:56:04 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-02-21 10:34:41 -0500
commit606cf9caeb3b908426757924bfdce85cb854aa81 (patch)
treef7236b01b9d8e3af4b12116a9c0ebe055f1ac60c /drivers
parent27c7b710a4010e10b14500c0b27bb4c2a806de1b (diff)
V4L/DVB (5093): Pvrusb2: Emit VIDIOC_S_TUNER correctly
Audio mode changes are not private to the audio chip - other I2C modules need to see this as well. And since the command in question is VIDIOC_S_TUNER which is a standard v4l2 command, we really should be broadcasting it out. This change sets up a broadcast pathway for VIDIOC_S_TUNER and also eliminates the now redundant code from the audio chip handler. This fix enables stereo reception for the FM radio Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-audio.c10
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c15
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c23
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h1
4 files changed, 34 insertions, 15 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-audio.c b/drivers/media/video/pvrusb2/pvrusb2-audio.c
index a45ede0a8cf1..379645e481c6 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-audio.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-audio.c
@@ -43,13 +43,6 @@ static void set_stereo(struct pvr2_msp3400_handler *ctxt)
43 43
44 pvr2_trace(PVR2_TRACE_CHIPS,"i2c msp3400 v4l2 set_stereo"); 44 pvr2_trace(PVR2_TRACE_CHIPS,"i2c msp3400 v4l2 set_stereo");
45 45
46 if (hdw->input_val == PVR2_CVAL_INPUT_TV) {
47 struct v4l2_tuner vt;
48 memset(&vt,0,sizeof(vt));
49 vt.audmode = hdw->audiomode_val;
50 pvr2_i2c_client_cmd(ctxt->client,VIDIOC_S_TUNER,&vt);
51 }
52
53 route.input = MSP_INPUT_DEFAULT; 46 route.input = MSP_INPUT_DEFAULT;
54 route.output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1); 47 route.output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1);
55 switch (hdw->input_val) { 48 switch (hdw->input_val) {
@@ -77,8 +70,7 @@ static void set_stereo(struct pvr2_msp3400_handler *ctxt)
77static int check_stereo(struct pvr2_msp3400_handler *ctxt) 70static int check_stereo(struct pvr2_msp3400_handler *ctxt)
78{ 71{
79 struct pvr2_hdw *hdw = ctxt->hdw; 72 struct pvr2_hdw *hdw = ctxt->hdw;
80 return (hdw->input_dirty || 73 return hdw->input_dirty;
81 hdw->audiomode_dirty);
82} 74}
83 75
84 76
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c
index 16fa075a1eec..49773764383b 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c
@@ -33,15 +33,17 @@
33#define trace_i2c(...) pvr2_trace(PVR2_TRACE_I2C,__VA_ARGS__) 33#define trace_i2c(...) pvr2_trace(PVR2_TRACE_I2C,__VA_ARGS__)
34 34
35#define OP_STANDARD 0 35#define OP_STANDARD 0
36#define OP_BCSH 1 36#define OP_AUDIOMODE 1
37#define OP_VOLUME 2 37#define OP_BCSH 2
38#define OP_FREQ 3 38#define OP_VOLUME 3
39#define OP_AUDIORATE 4 39#define OP_FREQ 4
40#define OP_SIZE 5 40#define OP_AUDIORATE 5
41#define OP_LOG 6 41#define OP_SIZE 6
42#define OP_LOG 7
42 43
43static const struct pvr2_i2c_op * const ops[] = { 44static const struct pvr2_i2c_op * const ops[] = {
44 [OP_STANDARD] = &pvr2_i2c_op_v4l2_standard, 45 [OP_STANDARD] = &pvr2_i2c_op_v4l2_standard,
46 [OP_AUDIOMODE] = &pvr2_i2c_op_v4l2_audiomode,
45 [OP_BCSH] = &pvr2_i2c_op_v4l2_bcsh, 47 [OP_BCSH] = &pvr2_i2c_op_v4l2_bcsh,
46 [OP_VOLUME] = &pvr2_i2c_op_v4l2_volume, 48 [OP_VOLUME] = &pvr2_i2c_op_v4l2_volume,
47 [OP_FREQ] = &pvr2_i2c_op_v4l2_frequency, 49 [OP_FREQ] = &pvr2_i2c_op_v4l2_frequency,
@@ -54,6 +56,7 @@ void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
54 int id; 56 int id;
55 id = cp->client->driver->id; 57 id = cp->client->driver->id;
56 cp->ctl_mask = ((1 << OP_STANDARD) | 58 cp->ctl_mask = ((1 << OP_STANDARD) |
59 (1 << OP_AUDIOMODE) |
57 (1 << OP_BCSH) | 60 (1 << OP_BCSH) |
58 (1 << OP_VOLUME) | 61 (1 << OP_VOLUME) |
59 (1 << OP_FREQ) | 62 (1 << OP_FREQ) |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
index b1f6809625e8..c650e02ccd00 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
@@ -140,6 +140,29 @@ const struct pvr2_i2c_op pvr2_i2c_op_v4l2_volume = {
140}; 140};
141 141
142 142
143static void set_audiomode(struct pvr2_hdw *hdw)
144{
145 struct v4l2_tuner vt;
146 memset(&vt,0,sizeof(vt));
147 vt.audmode = hdw->audiomode_val;
148 pvr2_i2c_core_cmd(hdw,VIDIOC_S_TUNER,&vt);
149}
150
151
152static int check_audiomode(struct pvr2_hdw *hdw)
153{
154 return (hdw->input_dirty ||
155 hdw->audiomode_dirty);
156}
157
158
159const struct pvr2_i2c_op pvr2_i2c_op_v4l2_audiomode = {
160 .check = check_audiomode,
161 .update = set_audiomode,
162 .name = "v4l2_audiomode",
163};
164
165
143static void set_frequency(struct pvr2_hdw *hdw) 166static void set_frequency(struct pvr2_hdw *hdw)
144{ 167{
145 unsigned long fv; 168 unsigned long fv;
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h
index 6a9bb46d0654..c838df6167f9 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h
@@ -31,6 +31,7 @@ extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_bcsh;
31extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_volume; 31extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_volume;
32extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_frequency; 32extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_frequency;
33extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_size; 33extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_size;
34extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_audiomode;
34extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_log; 35extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_log;
35 36
36void pvr2_v4l2_cmd_stream(struct pvr2_i2c_client *,int); 37void pvr2_v4l2_cmd_stream(struct pvr2_i2c_client *,int);