Commit a51f5000 authored by Mike Isely's avatar Mike Isely Committed by Mauro Carvalho Chehab

V4L/DVB (11156): pvrusb2: Changes to further isolate old i2c layer

This introduces some additional isolation in the pvrusb2 from the old
i2c layer, a step along the way to separate the driver from that layer
and to make it easier to introduce the common v4l2-subdev framework as
the eventual replacement.
Signed-off-by: default avatarMike Isely <isely@pobox.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent b72b7bf5
...@@ -408,6 +408,8 @@ struct pvr2_hdw { ...@@ -408,6 +408,8 @@ struct pvr2_hdw {
unsigned long pvr2_hdw_get_cur_freq(struct pvr2_hdw *); unsigned long pvr2_hdw_get_cur_freq(struct pvr2_hdw *);
void pvr2_hdw_set_decoder(struct pvr2_hdw *,struct pvr2_decoder_ctrl *); void pvr2_hdw_set_decoder(struct pvr2_hdw *,struct pvr2_decoder_ctrl *);
void pvr2_hdw_status_poll(struct pvr2_hdw *);
#endif /* __PVRUSB2_HDW_INTERNAL_H */ #endif /* __PVRUSB2_HDW_INTERNAL_H */
/* /*
......
...@@ -643,7 +643,7 @@ static int ctrl_freq_max_get(struct pvr2_ctrl *cptr, int *vp) ...@@ -643,7 +643,7 @@ static int ctrl_freq_max_get(struct pvr2_ctrl *cptr, int *vp)
unsigned long fv; unsigned long fv;
struct pvr2_hdw *hdw = cptr->hdw; struct pvr2_hdw *hdw = cptr->hdw;
if (hdw->tuner_signal_stale) { if (hdw->tuner_signal_stale) {
pvr2_i2c_core_status_poll(hdw); pvr2_hdw_status_poll(hdw);
} }
fv = hdw->tuner_signal_info.rangehigh; fv = hdw->tuner_signal_info.rangehigh;
if (!fv) { if (!fv) {
...@@ -665,7 +665,7 @@ static int ctrl_freq_min_get(struct pvr2_ctrl *cptr, int *vp) ...@@ -665,7 +665,7 @@ static int ctrl_freq_min_get(struct pvr2_ctrl *cptr, int *vp)
unsigned long fv; unsigned long fv;
struct pvr2_hdw *hdw = cptr->hdw; struct pvr2_hdw *hdw = cptr->hdw;
if (hdw->tuner_signal_stale) { if (hdw->tuner_signal_stale) {
pvr2_i2c_core_status_poll(hdw); pvr2_hdw_status_poll(hdw);
} }
fv = hdw->tuner_signal_info.rangelow; fv = hdw->tuner_signal_info.rangelow;
if (!fv) { if (!fv) {
...@@ -859,7 +859,7 @@ static void ctrl_stdcur_clear_dirty(struct pvr2_ctrl *cptr) ...@@ -859,7 +859,7 @@ static void ctrl_stdcur_clear_dirty(struct pvr2_ctrl *cptr)
static int ctrl_signal_get(struct pvr2_ctrl *cptr,int *vp) static int ctrl_signal_get(struct pvr2_ctrl *cptr,int *vp)
{ {
struct pvr2_hdw *hdw = cptr->hdw; struct pvr2_hdw *hdw = cptr->hdw;
pvr2_i2c_core_status_poll(hdw); pvr2_hdw_status_poll(hdw);
*vp = hdw->tuner_signal_info.signal; *vp = hdw->tuner_signal_info.signal;
return 0; return 0;
} }
...@@ -869,7 +869,7 @@ static int ctrl_audio_modes_present_get(struct pvr2_ctrl *cptr,int *vp) ...@@ -869,7 +869,7 @@ static int ctrl_audio_modes_present_get(struct pvr2_ctrl *cptr,int *vp)
int val = 0; int val = 0;
unsigned int subchan; unsigned int subchan;
struct pvr2_hdw *hdw = cptr->hdw; struct pvr2_hdw *hdw = cptr->hdw;
pvr2_i2c_core_status_poll(hdw); pvr2_hdw_status_poll(hdw);
subchan = hdw->tuner_signal_info.rxsubchans; subchan = hdw->tuner_signal_info.rxsubchans;
if (subchan & V4L2_TUNER_SUB_MONO) { if (subchan & V4L2_TUNER_SUB_MONO) {
val |= (1 << V4L2_TUNER_MODE_MONO); val |= (1 << V4L2_TUNER_MODE_MONO);
...@@ -3008,7 +3008,7 @@ int pvr2_hdw_is_hsm(struct pvr2_hdw *hdw) ...@@ -3008,7 +3008,7 @@ int pvr2_hdw_is_hsm(struct pvr2_hdw *hdw)
void pvr2_hdw_execute_tuner_poll(struct pvr2_hdw *hdw) void pvr2_hdw_execute_tuner_poll(struct pvr2_hdw *hdw)
{ {
LOCK_TAKE(hdw->big_lock); do { LOCK_TAKE(hdw->big_lock); do {
pvr2_i2c_core_status_poll(hdw); pvr2_hdw_status_poll(hdw);
} while (0); LOCK_GIVE(hdw->big_lock); } while (0); LOCK_GIVE(hdw->big_lock);
} }
...@@ -3018,7 +3018,7 @@ static int pvr2_hdw_check_cropcap(struct pvr2_hdw *hdw) ...@@ -3018,7 +3018,7 @@ static int pvr2_hdw_check_cropcap(struct pvr2_hdw *hdw)
if (!hdw->cropcap_stale) { if (!hdw->cropcap_stale) {
return 0; return 0;
} }
pvr2_i2c_core_status_poll(hdw); pvr2_hdw_status_poll(hdw);
if (hdw->cropcap_stale) { if (hdw->cropcap_stale) {
return -EIO; return -EIO;
} }
...@@ -3045,7 +3045,7 @@ int pvr2_hdw_get_tuner_status(struct pvr2_hdw *hdw,struct v4l2_tuner *vtp) ...@@ -3045,7 +3045,7 @@ int pvr2_hdw_get_tuner_status(struct pvr2_hdw *hdw,struct v4l2_tuner *vtp)
{ {
LOCK_TAKE(hdw->big_lock); do { LOCK_TAKE(hdw->big_lock); do {
if (hdw->tuner_signal_stale) { if (hdw->tuner_signal_stale) {
pvr2_i2c_core_status_poll(hdw); pvr2_hdw_status_poll(hdw);
} }
memcpy(vtp,&hdw->tuner_signal_info,sizeof(struct v4l2_tuner)); memcpy(vtp,&hdw->tuner_signal_info,sizeof(struct v4l2_tuner));
} while (0); LOCK_GIVE(hdw->big_lock); } while (0); LOCK_GIVE(hdw->big_lock);
...@@ -3067,8 +3067,8 @@ void pvr2_hdw_trigger_module_log(struct pvr2_hdw *hdw) ...@@ -3067,8 +3067,8 @@ void pvr2_hdw_trigger_module_log(struct pvr2_hdw *hdw)
hdw->log_requested = !0; hdw->log_requested = !0;
printk(KERN_INFO "pvrusb2: ================= START STATUS CARD #%d =================\n", nr); printk(KERN_INFO "pvrusb2: ================= START STATUS CARD #%d =================\n", nr);
pvr2_i2c_core_check_stale(hdw); pvr2_i2c_core_check_stale(hdw);
hdw->log_requested = 0;
pvr2_i2c_core_sync(hdw); pvr2_i2c_core_sync(hdw);
hdw->log_requested = 0;
pvr2_trace(PVR2_TRACE_INFO,"cx2341x config:"); pvr2_trace(PVR2_TRACE_INFO,"cx2341x config:");
cx2341x_log_status(&hdw->enc_ctl_state, "pvrusb2"); cx2341x_log_status(&hdw->enc_ctl_state, "pvrusb2");
pvr2_hdw_state_log_state(hdw); pvr2_hdw_state_log_state(hdw);
...@@ -4676,6 +4676,12 @@ int pvr2_hdw_gpio_chg_out(struct pvr2_hdw *hdw,u32 msk,u32 val) ...@@ -4676,6 +4676,12 @@ int pvr2_hdw_gpio_chg_out(struct pvr2_hdw *hdw,u32 msk,u32 val)
} }
void pvr2_hdw_status_poll(struct pvr2_hdw *hdw)
{
pvr2_i2c_core_status_poll(hdw);
}
unsigned int pvr2_hdw_get_input_available(struct pvr2_hdw *hdw) unsigned int pvr2_hdw_get_input_available(struct pvr2_hdw *hdw)
{ {
return hdw->input_avail_mask; return hdw->input_avail_mask;
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
static void execute_init(struct pvr2_hdw *hdw) static void execute_init(struct pvr2_hdw *hdw)
{ {
u32 dummy = 0; u32 dummy = 0;
...@@ -184,7 +185,7 @@ static void set_frequency(struct pvr2_hdw *hdw) ...@@ -184,7 +185,7 @@ static void set_frequency(struct pvr2_hdw *hdw)
fv = pvr2_hdw_get_cur_freq(hdw); fv = pvr2_hdw_get_cur_freq(hdw);
pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_freq(%lu)",fv); pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_freq(%lu)",fv);
if (hdw->tuner_signal_stale) { if (hdw->tuner_signal_stale) {
pvr2_i2c_core_status_poll(hdw); pvr2_hdw_status_poll(hdw);
} }
memset(&freq,0,sizeof(freq)); memset(&freq,0,sizeof(freq));
if (hdw->tuner_signal_info.capability & V4L2_TUNER_CAP_LOW) { if (hdw->tuner_signal_info.capability & V4L2_TUNER_CAP_LOW) {
...@@ -325,6 +326,7 @@ void pvr2_v4l2_cmd_status_poll(struct pvr2_i2c_client *cp) ...@@ -325,6 +326,7 @@ void pvr2_v4l2_cmd_status_poll(struct pvr2_i2c_client *cp)
} }
/* /*
Stuff for Emacs to see, in order to encourage consistent editing style: Stuff for Emacs to see, in order to encourage consistent editing style:
*** Local Variables: *** *** Local Variables: ***
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment