aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-encoder.c3
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c7
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c5
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c31
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h1
5 files changed, 44 insertions, 3 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-encoder.c b/drivers/media/video/pvrusb2/pvrusb2-encoder.c
index c94f97b7939..d094cac9f7a 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-encoder.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-encoder.c
@@ -360,6 +360,9 @@ int pvr2_encoder_start(struct pvr2_hdw *hdw)
360 pvr2_hdw_gpio_chg_dir(hdw,0xffffffff,0x00000481); 360 pvr2_hdw_gpio_chg_dir(hdw,0xffffffff,0x00000481);
361 pvr2_hdw_gpio_chg_out(hdw,0xffffffff,0x00000000); 361 pvr2_hdw_gpio_chg_out(hdw,0xffffffff,0x00000000);
362 362
363 pvr2_encoder_vcmd(hdw,CX2341X_ENC_MUTE_VIDEO,1,
364 hdw->input_val == PVR2_CVAL_INPUT_RADIO ? 1 : 0);
365
363 if (hdw->config == pvr2_config_vbi) { 366 if (hdw->config == pvr2_config_vbi) {
364 status = pvr2_encoder_vcmd(hdw,CX2341X_ENC_START_CAPTURE,2, 367 status = pvr2_encoder_vcmd(hdw,CX2341X_ENC_START_CAPTURE,2,
365 0x01,0x14); 368 0x01,0x14);
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 503255cebc2..5f6ab998bbe 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -2260,6 +2260,13 @@ static int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw)
2260 stale_subsys_mask |= (1<<PVR2_SUBSYS_B_ENC_CFG); 2260 stale_subsys_mask |= (1<<PVR2_SUBSYS_B_ENC_CFG);
2261 } 2261 }
2262 2262
2263 if (hdw->input_dirty) {
2264 /* pk: If input changes to or from radio, then the encoder
2265 needs to be restarted (for ENC_MUTE_VIDEO to work) */
2266 stale_subsys_mask |= (1<<PVR2_SUBSYS_B_ENC_RUN);
2267 }
2268
2269
2263 if (hdw->srate_dirty) { 2270 if (hdw->srate_dirty) {
2264 /* Write new sample rate into control structure since 2271 /* Write new sample rate into control structure since
2265 * the master copy is stale. We must track srate 2272 * the master copy is stale. We must track srate
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c
index 05121666b9b..93b8d077c11 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c
@@ -39,6 +39,7 @@
39#define OP_AUDIORATE 4 39#define OP_AUDIORATE 4
40#define OP_SIZE 5 40#define OP_SIZE 5
41#define OP_LOG 6 41#define OP_LOG 6
42#define OP_RADIO 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,
@@ -47,6 +48,7 @@ static const struct pvr2_i2c_op * const ops[] = {
47 [OP_FREQ] = &pvr2_i2c_op_v4l2_frequency, 48 [OP_FREQ] = &pvr2_i2c_op_v4l2_frequency,
48 [OP_SIZE] = &pvr2_i2c_op_v4l2_size, 49 [OP_SIZE] = &pvr2_i2c_op_v4l2_size,
49 [OP_LOG] = &pvr2_i2c_op_v4l2_log, 50 [OP_LOG] = &pvr2_i2c_op_v4l2_log,
51 [OP_RADIO] = &pvr2_i2c_op_v4l2_radio,
50}; 52};
51 53
52void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) 54void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
@@ -58,7 +60,8 @@ void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
58 (1 << OP_VOLUME) | 60 (1 << OP_VOLUME) |
59 (1 << OP_FREQ) | 61 (1 << OP_FREQ) |
60 (1 << OP_SIZE) | 62 (1 << OP_SIZE) |
61 (1 << OP_LOG)); 63 (1 << OP_LOG) |
64 (1 << OP_RADIO));
62 65
63 if (id == I2C_DRIVERID_MSP3400) { 66 if (id == I2C_DRIVERID_MSP3400) {
64 if (pvr2_i2c_msp3400_setup(hdw,cp)) { 67 if (pvr2_i2c_msp3400_setup(hdw,cp)) {
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
index 05ea17afe90..50fcceb15d5 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
@@ -24,7 +24,7 @@
24#include "pvrusb2-hdw-internal.h" 24#include "pvrusb2-hdw-internal.h"
25#include "pvrusb2-debug.h" 25#include "pvrusb2-debug.h"
26#include <linux/videodev2.h> 26#include <linux/videodev2.h>
27 27#include <media/v4l2-common.h> /* AUDC_SET_RADIO */
28 28
29static void set_standard(struct pvr2_hdw *hdw) 29static void set_standard(struct pvr2_hdw *hdw)
30{ 30{
@@ -50,6 +50,32 @@ const struct pvr2_i2c_op pvr2_i2c_op_v4l2_standard = {
50}; 50};
51 51
52 52
53static void set_radio(struct pvr2_hdw *hdw)
54{
55 pvr2_trace(PVR2_TRACE_CHIPS,
56 "i2c v4l2 set_radio()");
57
58 if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) {
59 pvr2_i2c_core_cmd(hdw,AUDC_SET_RADIO,NULL);
60 } else {
61 set_standard(hdw);
62 }
63}
64
65
66static int check_radio(struct pvr2_hdw *hdw)
67{
68 return hdw->input_dirty != 0;
69}
70
71
72const struct pvr2_i2c_op pvr2_i2c_op_v4l2_radio = {
73 .check = check_radio,
74 .update = set_radio,
75 .name = "v4l2_radio",
76};
77
78
53static void set_bcsh(struct pvr2_hdw *hdw) 79static void set_bcsh(struct pvr2_hdw *hdw)
54{ 80{
55 struct v4l2_control ctrl; 81 struct v4l2_control ctrl;
@@ -145,7 +171,8 @@ static void set_frequency(struct pvr2_hdw *hdw)
145 memset(&freq,0,sizeof(freq)); 171 memset(&freq,0,sizeof(freq));
146 freq.frequency = fv / 62500; 172 freq.frequency = fv / 62500;
147 freq.tuner = 0; 173 freq.tuner = 0;
148 freq.type = V4L2_TUNER_ANALOG_TV; 174 freq.type = (hdw->input_val == PVR2_CVAL_INPUT_RADIO) ?
175 V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
149 pvr2_i2c_core_cmd(hdw,VIDIOC_S_FREQUENCY,&freq); 176 pvr2_i2c_core_cmd(hdw,VIDIOC_S_FREQUENCY,&freq);
150} 177}
151 178
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h
index ecabddba1ec..894de610893 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h
@@ -26,6 +26,7 @@
26#include "pvrusb2-i2c-core.h" 26#include "pvrusb2-i2c-core.h"
27 27
28extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_standard; 28extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_standard;
29extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_radio;
29extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_bcsh; 30extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_bcsh;
30extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_volume; 31extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_volume;
31extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_frequency; 32extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_frequency;