summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2009-03-06 21:37:10 -0600
committerMike Isely <isely@pobox.com>2009-03-06 21:37:10 -0600
commitd22a03cd627da69843d2a79a7587179c19df4a40 (patch)
tree0229ee03c50143fae5cb47d64b153a30a044892e /linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
parent778ae30db1fe43b100612fadbd15cf51e9bb630b (diff)
downloadmediapointer-dvb-s2-d22a03cd627da69843d2a79a7587179c19df4a40.tar.gz
mediapointer-dvb-s2-d22a03cd627da69843d2a79a7587179c19df4a40.tar.bz2
pvrusb2: Implement sub-device specific update framework
From: Mike Isely <isely@pobox.com> 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.) Priority: normal Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 96a9729e6..9aaf20acc 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -106,6 +106,13 @@ MODULE_PARM_DESC(radio_freq, "specify initial radio frequency");
/* size of a firmware chunk */
#define FIRMWARE_CHUNK_SIZE 0x2000
+typedef void (*pvr2_subdev_update_func)(struct pvr2_hdw *,
+ struct v4l2_subdev *);
+
+static const pvr2_subdev_update_func pvr2_module_update_functions[] = {
+ /* ????? */
+};
+
static const char *module_names[] = {
[PVR2_CLIENT_ID_MSP3400] = "msp3400",
[PVR2_CLIENT_ID_CX25840] = "cx25840",
@@ -2924,6 +2931,10 @@ static void pvr2_subdev_set_control(struct pvr2_hdw *hdw, int id,
sub-devices so that they match our current control values. */
static void pvr2_subdev_update(struct pvr2_hdw *hdw)
{
+ struct v4l2_subdev *sd;
+ unsigned int id;
+ pvr2_subdev_update_func fp;
+
if (hdw->input_dirty || hdw->std_dirty) {
pvr2_trace(PVR2_TRACE_CHIPS,"subdev v4l2 set_standard");
if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) {
@@ -2995,7 +3006,13 @@ static void pvr2_subdev_update(struct pvr2_hdw *hdw)
/* Unable to set crop parameters; there is apparently no equivalent
for VIDIOC_S_CROP */
- /* ????? Cover special cases for specific sub-devices. */
+ v4l2_device_for_each_subdev(sd, &hdw->v4l2_dev) {
+ id = sd->grp_id;
+ if (id >= ARRAY_SIZE(pvr2_module_update_functions)) continue;
+ fp = pvr2_module_update_functions[id];
+ if (!fp) continue;
+ (*fp)(hdw, sd);
+ }
if (hdw->tuner_signal_stale && hdw->cropcap_stale) {
pvr2_hdw_status_poll(hdw);