mutex_lock(&atv_demod_list_mutex);
- if (*state == AML_ATVDEMOD_INIT) {
+ if (*state == AML_ATVDEMOD_INIT && atvdemod_state != *state) {
atv_demod_enter_mode();
if (fe->ops.tuner_ops.init)
fe->ops.tuner_ops.init(fe);
- } else if (*state == AML_ATVDEMOD_UNINIT) {
+ } else if (*state == AML_ATVDEMOD_UNINIT && atvdemod_state != *state) {
atv_demod_leave_mode();
if (fe->ops.tuner_ops.release)
fe->ops.tuner_ops.release(fe);
- } else if (*state == AML_ATVDEMOD_RESUME) {
+ } else if (*state == AML_ATVDEMOD_RESUME && atvdemod_state != *state) {
if (get_atvdemod_state() == ATVDEMOD_STATE_SLEEP)
atv_demod_enter_mode();
if (fe->ops.tuner_ops.resume)
#endif
#else /* Now, force to NTSC_M, Ours demod only support M for NTSC.*/
audio = V4L2_STD_NTSC_M;
+ std_bk |= V4L2_COLOR_STD_NTSC;
#endif
} else if (std_bk == V4L2_STD_SECAM) {
audio = V4L2_STD_SECAM_L;
+ std_bk |= V4L2_COLOR_STD_SECAM;
} else {
/*V4L2_COLOR_STD_PAL*/
+ std_bk |= V4L2_COLOR_STD_PAL;
amlatvdemod_set_std(AML_ATV_DEMOD_VIDEO_MODE_PROP_PAL_DK);
audio = aml_audiomode_autodet(fe);
audio = demod_fmt_2_v4l2_std(audio);
return ret;
}
+static int v4l2_frontend_read_status(struct v4l2_frontend *v4l2_fe,
+ enum v4l2_status *status)
+{
+ int ret = 0;
+ struct analog_demod_ops *analog_ops = NULL;
+ struct dvb_tuner_ops *tuner_ops = NULL;
+
+ analog_ops = &v4l2_fe->v4l2_ad->fe.ops.analog_ops;
+ tuner_ops = &v4l2_fe->v4l2_ad->fe.ops.tuner_ops;
+
+ if (!status)
+ return -1;
+#if 0
+ if (analog_ops->tuner_status)
+ analog_ops->tuner_status(&v4l2_fe->v4l2_ad->fe, status);
+ else if (tuner_ops->get_status)
+ tuner_ops->get_status(&v4l2_fe->v4l2_ad->fe, status);
+#endif
+
+ return ret;
+}
+
static void v4l2_frontend_vdev_release(struct video_device *dev)
{
pr_err("%s.\n", __func__);
if (fepriv->events.eventw != fepriv->events.eventr)
return (POLLIN | POLLRDNORM | POLLPRI);
- pr_err("%s.\n", __func__);
+ pr_info("%s.\n", __func__);
return 0;
}
ret = v4l2_frontend_set_mode(v4l2_fe, (unsigned long) arg);
break;
+ case V4L2_READ_STATUS:
+ ret = v4l2_frontend_read_status(v4l2_fe,
+ (enum v4l2_status *) arg);
+ break;
+
default:
break;
}
#define V4L2_GET_FRONTEND _IOR('V', 106, struct v4l2_analog_parameters)
#define V4L2_GET_EVENT _IOR('V', 107, struct v4l2_frontend_event)
#define V4L2_SET_MODE _IO('V', 108)
+#define V4L2_READ_STATUS _IOR('V', 109, enum v4l2_status)
+
+/*COLOR MODULATION TYPE*/
+#define V4L2_COLOR_STD_PAL ((v4l2_std_id) 0x04000000)
+#define V4L2_COLOR_STD_NTSC ((v4l2_std_id) 0x08000000)
+#define V4L2_COLOR_STD_SECAM ((v4l2_std_id) 0x10000000)
struct v4l2_analog_parameters {
unsigned int frequency;