aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2009-03-06 21:30:37 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:33 -0400
commita51f5000b791003e0ab9ecebbdecb87c4024156f (patch)
tree807d99a40233d28bff50f2d1c77068a4b7166c29
parentb72b7bf5cbb2ae77b3bf748456655fc284baf04c (diff)
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: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h2
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c22
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c4
3 files changed, 19 insertions, 9 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
index 09798403e9fd..b3cb0bbd8cf5 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
@@ -408,6 +408,8 @@ struct pvr2_hdw {
408unsigned long pvr2_hdw_get_cur_freq(struct pvr2_hdw *); 408unsigned long pvr2_hdw_get_cur_freq(struct pvr2_hdw *);
409void pvr2_hdw_set_decoder(struct pvr2_hdw *,struct pvr2_decoder_ctrl *); 409void pvr2_hdw_set_decoder(struct pvr2_hdw *,struct pvr2_decoder_ctrl *);
410 410
411void pvr2_hdw_status_poll(struct pvr2_hdw *);
412
411#endif /* __PVRUSB2_HDW_INTERNAL_H */ 413#endif /* __PVRUSB2_HDW_INTERNAL_H */
412 414
413/* 415/*
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index b66ac1c49dbe..e6c4660786a6 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -643,7 +643,7 @@ static int ctrl_freq_max_get(struct pvr2_ctrl *cptr, int *vp)
643 unsigned long fv; 643 unsigned long fv;
644 struct pvr2_hdw *hdw = cptr->hdw; 644 struct pvr2_hdw *hdw = cptr->hdw;
645 if (hdw->tuner_signal_stale) { 645 if (hdw->tuner_signal_stale) {
646 pvr2_i2c_core_status_poll(hdw); 646 pvr2_hdw_status_poll(hdw);
647 } 647 }
648 fv = hdw->tuner_signal_info.rangehigh; 648 fv = hdw->tuner_signal_info.rangehigh;
649 if (!fv) { 649 if (!fv) {
@@ -665,7 +665,7 @@ static int ctrl_freq_min_get(struct pvr2_ctrl *cptr, int *vp)
665 unsigned long fv; 665 unsigned long fv;
666 struct pvr2_hdw *hdw = cptr->hdw; 666 struct pvr2_hdw *hdw = cptr->hdw;
667 if (hdw->tuner_signal_stale) { 667 if (hdw->tuner_signal_stale) {
668 pvr2_i2c_core_status_poll(hdw); 668 pvr2_hdw_status_poll(hdw);
669 } 669 }
670 fv = hdw->tuner_signal_info.rangelow; 670 fv = hdw->tuner_signal_info.rangelow;
671 if (!fv) { 671 if (!fv) {
@@ -859,7 +859,7 @@ static void ctrl_stdcur_clear_dirty(struct pvr2_ctrl *cptr)
859static int ctrl_signal_get(struct pvr2_ctrl *cptr,int *vp) 859static int ctrl_signal_get(struct pvr2_ctrl *cptr,int *vp)
860{ 860{
861 struct pvr2_hdw *hdw = cptr->hdw; 861 struct pvr2_hdw *hdw = cptr->hdw;
862 pvr2_i2c_core_status_poll(hdw); 862 pvr2_hdw_status_poll(hdw);
863 *vp = hdw->tuner_signal_info.signal; 863 *vp = hdw->tuner_signal_info.signal;
864 return 0; 864 return 0;
865} 865}
@@ -869,7 +869,7 @@ static int ctrl_audio_modes_present_get(struct pvr2_ctrl *cptr,int *vp)
869 int val = 0; 869 int val = 0;
870 unsigned int subchan; 870 unsigned int subchan;
871 struct pvr2_hdw *hdw = cptr->hdw; 871 struct pvr2_hdw *hdw = cptr->hdw;
872 pvr2_i2c_core_status_poll(hdw); 872 pvr2_hdw_status_poll(hdw);
873 subchan = hdw->tuner_signal_info.rxsubchans; 873 subchan = hdw->tuner_signal_info.rxsubchans;
874 if (subchan & V4L2_TUNER_SUB_MONO) { 874 if (subchan & V4L2_TUNER_SUB_MONO) {
875 val |= (1 << V4L2_TUNER_MODE_MONO); 875 val |= (1 << V4L2_TUNER_MODE_MONO);
@@ -3008,7 +3008,7 @@ int pvr2_hdw_is_hsm(struct pvr2_hdw *hdw)
3008void pvr2_hdw_execute_tuner_poll(struct pvr2_hdw *hdw) 3008void pvr2_hdw_execute_tuner_poll(struct pvr2_hdw *hdw)
3009{ 3009{
3010 LOCK_TAKE(hdw->big_lock); do { 3010 LOCK_TAKE(hdw->big_lock); do {
3011 pvr2_i2c_core_status_poll(hdw); 3011 pvr2_hdw_status_poll(hdw);
3012 } while (0); LOCK_GIVE(hdw->big_lock); 3012 } while (0); LOCK_GIVE(hdw->big_lock);
3013} 3013}
3014 3014
@@ -3018,7 +3018,7 @@ static int pvr2_hdw_check_cropcap(struct pvr2_hdw *hdw)
3018 if (!hdw->cropcap_stale) { 3018 if (!hdw->cropcap_stale) {
3019 return 0; 3019 return 0;
3020 } 3020 }
3021 pvr2_i2c_core_status_poll(hdw); 3021 pvr2_hdw_status_poll(hdw);
3022 if (hdw->cropcap_stale) { 3022 if (hdw->cropcap_stale) {
3023 return -EIO; 3023 return -EIO;
3024 } 3024 }
@@ -3045,7 +3045,7 @@ int pvr2_hdw_get_tuner_status(struct pvr2_hdw *hdw,struct v4l2_tuner *vtp)
3045{ 3045{
3046 LOCK_TAKE(hdw->big_lock); do { 3046 LOCK_TAKE(hdw->big_lock); do {
3047 if (hdw->tuner_signal_stale) { 3047 if (hdw->tuner_signal_stale) {
3048 pvr2_i2c_core_status_poll(hdw); 3048 pvr2_hdw_status_poll(hdw);
3049 } 3049 }
3050 memcpy(vtp,&hdw->tuner_signal_info,sizeof(struct v4l2_tuner)); 3050 memcpy(vtp,&hdw->tuner_signal_info,sizeof(struct v4l2_tuner));
3051 } while (0); LOCK_GIVE(hdw->big_lock); 3051 } while (0); LOCK_GIVE(hdw->big_lock);
@@ -3067,8 +3067,8 @@ void pvr2_hdw_trigger_module_log(struct pvr2_hdw *hdw)
3067 hdw->log_requested = !0; 3067 hdw->log_requested = !0;
3068 printk(KERN_INFO "pvrusb2: ================= START STATUS CARD #%d =================\n", nr); 3068 printk(KERN_INFO "pvrusb2: ================= START STATUS CARD #%d =================\n", nr);
3069 pvr2_i2c_core_check_stale(hdw); 3069 pvr2_i2c_core_check_stale(hdw);
3070 hdw->log_requested = 0;
3071 pvr2_i2c_core_sync(hdw); 3070 pvr2_i2c_core_sync(hdw);
3071 hdw->log_requested = 0;
3072 pvr2_trace(PVR2_TRACE_INFO,"cx2341x config:"); 3072 pvr2_trace(PVR2_TRACE_INFO,"cx2341x config:");
3073 cx2341x_log_status(&hdw->enc_ctl_state, "pvrusb2"); 3073 cx2341x_log_status(&hdw->enc_ctl_state, "pvrusb2");
3074 pvr2_hdw_state_log_state(hdw); 3074 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} 4676}
4677 4677
4678 4678
4679void pvr2_hdw_status_poll(struct pvr2_hdw *hdw)
4680{
4681 pvr2_i2c_core_status_poll(hdw);
4682}
4683
4684
4679unsigned int pvr2_hdw_get_input_available(struct pvr2_hdw *hdw) 4685unsigned int pvr2_hdw_get_input_available(struct pvr2_hdw *hdw)
4680{ 4686{
4681 return hdw->input_avail_mask; 4687 return hdw->input_avail_mask;
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
index 0f2885440f2f..7afe513bebf9 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
@@ -25,6 +25,7 @@
25#include <linux/videodev2.h> 25#include <linux/videodev2.h>
26#include <media/v4l2-common.h> 26#include <media/v4l2-common.h>
27 27
28
28static void execute_init(struct pvr2_hdw *hdw) 29static void execute_init(struct pvr2_hdw *hdw)
29{ 30{
30 u32 dummy = 0; 31 u32 dummy = 0;
@@ -184,7 +185,7 @@ static void set_frequency(struct pvr2_hdw *hdw)
184 fv = pvr2_hdw_get_cur_freq(hdw); 185 fv = pvr2_hdw_get_cur_freq(hdw);
185 pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_freq(%lu)",fv); 186 pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_freq(%lu)",fv);
186 if (hdw->tuner_signal_stale) { 187 if (hdw->tuner_signal_stale) {
187 pvr2_i2c_core_status_poll(hdw); 188 pvr2_hdw_status_poll(hdw);
188 } 189 }
189 memset(&freq,0,sizeof(freq)); 190 memset(&freq,0,sizeof(freq));
190 if (hdw->tuner_signal_info.capability & V4L2_TUNER_CAP_LOW) { 191 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} 326}
326 327
327 328
329
328/* 330/*
329 Stuff for Emacs to see, in order to encourage consistent editing style: 331 Stuff for Emacs to see, in order to encourage consistent editing style:
330 *** Local Variables: *** 332 *** Local Variables: ***