pvr2_hdw_gpio_chg_dir(hdw,0xffffffff,0x00000481);
pvr2_hdw_gpio_chg_out(hdw,0xffffffff,0x00000000);
+ pvr2_encoder_vcmd(hdw,CX2341X_ENC_MUTE_VIDEO,1,
+ hdw->input_val == PVR2_CVAL_INPUT_RADIO ? 1 : 0);
+
if (hdw->config == pvr2_config_vbi) {
status = pvr2_encoder_vcmd(hdw,CX2341X_ENC_START_CAPTURE,2,
0x01,0x14);
stale_subsys_mask |= (1<<PVR2_SUBSYS_B_ENC_CFG);
}
+ if (hdw->input_dirty) {
+ /* pk: If input changes to or from radio, then the encoder
+ needs to be restarted (for ENC_MUTE_VIDEO to work) */
+ stale_subsys_mask |= (1<<PVR2_SUBSYS_B_ENC_RUN);
+ }
+
+
if (hdw->srate_dirty) {
/* Write new sample rate into control structure since
* the master copy is stale. We must track srate
#define OP_AUDIORATE 4
#define OP_SIZE 5
#define OP_LOG 6
+#define OP_RADIO 7
static const struct pvr2_i2c_op * const ops[] = {
[OP_STANDARD] = &pvr2_i2c_op_v4l2_standard,
[OP_FREQ] = &pvr2_i2c_op_v4l2_frequency,
[OP_SIZE] = &pvr2_i2c_op_v4l2_size,
[OP_LOG] = &pvr2_i2c_op_v4l2_log,
+ [OP_RADIO] = &pvr2_i2c_op_v4l2_radio,
};
void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
(1 << OP_VOLUME) |
(1 << OP_FREQ) |
(1 << OP_SIZE) |
- (1 << OP_LOG));
+ (1 << OP_LOG) |
+ (1 << OP_RADIO));
if (id == I2C_DRIVERID_MSP3400) {
if (pvr2_i2c_msp3400_setup(hdw,cp)) {
#include "pvrusb2-hdw-internal.h"
#include "pvrusb2-debug.h"
#include <linux/videodev2.h>
-
+#include <media/v4l2-common.h> /* AUDC_SET_RADIO */
static void set_standard(struct pvr2_hdw *hdw)
{
};
+static void set_radio(struct pvr2_hdw *hdw)
+{
+ pvr2_trace(PVR2_TRACE_CHIPS,
+ "i2c v4l2 set_radio()");
+
+ if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) {
+ pvr2_i2c_core_cmd(hdw,AUDC_SET_RADIO,NULL);
+ } else {
+ set_standard(hdw);
+ }
+}
+
+
+static int check_radio(struct pvr2_hdw *hdw)
+{
+ return hdw->input_dirty != 0;
+}
+
+
+const struct pvr2_i2c_op pvr2_i2c_op_v4l2_radio = {
+ .check = check_radio,
+ .update = set_radio,
+ .name = "v4l2_radio",
+};
+
+
static void set_bcsh(struct pvr2_hdw *hdw)
{
struct v4l2_control ctrl;
memset(&freq,0,sizeof(freq));
freq.frequency = fv / 62500;
freq.tuner = 0;
- freq.type = V4L2_TUNER_ANALOG_TV;
+ freq.type = (hdw->input_val == PVR2_CVAL_INPUT_RADIO) ?
+ V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
pvr2_i2c_core_cmd(hdw,VIDIOC_S_FREQUENCY,&freq);
}
#include "pvrusb2-i2c-core.h"
extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_standard;
+extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_radio;
extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_bcsh;
extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_volume;
extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_frequency;