diff options
author | Mike Isely <isely@pobox.com> | 2009-03-06 22:37:10 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:43:35 -0400 |
commit | edb9dcb885c6288813b62c20e6b578492845f9ad (patch) | |
tree | aa1b4b2b16d1857efe8393be8fda4e24a29d10a9 /drivers/media/video/pvrusb2/pvrusb2-hdw.c | |
parent | 858f910e869d1300c1ab0cadbe9908322f8bfb78 (diff) |
V4L/DVB (11175): pvrusb2: Implement sub-device specific update framework
Lay down a foundation whereby it becomes possible to send customized
updates to specific sub-devices. (This becomes useful for routing
configuration, which is a very sub-device specific operation.)
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-hdw.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index bd4e374e37f8..36285ca48808 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -105,6 +105,13 @@ MODULE_PARM_DESC(radio_freq, "specify initial radio frequency"); | |||
105 | /* size of a firmware chunk */ | 105 | /* size of a firmware chunk */ |
106 | #define FIRMWARE_CHUNK_SIZE 0x2000 | 106 | #define FIRMWARE_CHUNK_SIZE 0x2000 |
107 | 107 | ||
108 | typedef void (*pvr2_subdev_update_func)(struct pvr2_hdw *, | ||
109 | struct v4l2_subdev *); | ||
110 | |||
111 | static const pvr2_subdev_update_func pvr2_module_update_functions[] = { | ||
112 | /* ????? */ | ||
113 | }; | ||
114 | |||
108 | static const char *module_names[] = { | 115 | static const char *module_names[] = { |
109 | [PVR2_CLIENT_ID_MSP3400] = "msp3400", | 116 | [PVR2_CLIENT_ID_MSP3400] = "msp3400", |
110 | [PVR2_CLIENT_ID_CX25840] = "cx25840", | 117 | [PVR2_CLIENT_ID_CX25840] = "cx25840", |
@@ -2900,6 +2907,10 @@ static void pvr2_subdev_set_control(struct pvr2_hdw *hdw, int id, | |||
2900 | sub-devices so that they match our current control values. */ | 2907 | sub-devices so that they match our current control values. */ |
2901 | static void pvr2_subdev_update(struct pvr2_hdw *hdw) | 2908 | static void pvr2_subdev_update(struct pvr2_hdw *hdw) |
2902 | { | 2909 | { |
2910 | struct v4l2_subdev *sd; | ||
2911 | unsigned int id; | ||
2912 | pvr2_subdev_update_func fp; | ||
2913 | |||
2903 | if (hdw->input_dirty || hdw->std_dirty) { | 2914 | if (hdw->input_dirty || hdw->std_dirty) { |
2904 | pvr2_trace(PVR2_TRACE_CHIPS,"subdev v4l2 set_standard"); | 2915 | pvr2_trace(PVR2_TRACE_CHIPS,"subdev v4l2 set_standard"); |
2905 | if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) { | 2916 | if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) { |
@@ -2971,7 +2982,13 @@ static void pvr2_subdev_update(struct pvr2_hdw *hdw) | |||
2971 | /* Unable to set crop parameters; there is apparently no equivalent | 2982 | /* Unable to set crop parameters; there is apparently no equivalent |
2972 | for VIDIOC_S_CROP */ | 2983 | for VIDIOC_S_CROP */ |
2973 | 2984 | ||
2974 | /* ????? Cover special cases for specific sub-devices. */ | 2985 | v4l2_device_for_each_subdev(sd, &hdw->v4l2_dev) { |
2986 | id = sd->grp_id; | ||
2987 | if (id >= ARRAY_SIZE(pvr2_module_update_functions)) continue; | ||
2988 | fp = pvr2_module_update_functions[id]; | ||
2989 | if (!fp) continue; | ||
2990 | (*fp)(hdw, sd); | ||
2991 | } | ||
2975 | 2992 | ||
2976 | if (hdw->tuner_signal_stale && hdw->cropcap_stale) { | 2993 | if (hdw->tuner_signal_stale && hdw->cropcap_stale) { |
2977 | pvr2_hdw_status_poll(hdw); | 2994 | pvr2_hdw_status_poll(hdw); |