diff options
author | Mike Isely <isely@pobox.com> | 2009-06-20 14:55:31 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-23 03:15:13 -0300 |
commit | 81e804c9c2e38431c1c01165d06076776c6fcbd6 (patch) | |
tree | c8be43ea41c58f0ab583ac3df441fd401e7ff068 /drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c | |
parent | 6f441ed78e28ea02940e58ffa89fbbc734ab6da3 (diff) | |
download | blackbird-op-linux-81e804c9c2e38431c1c01165d06076776c6fcbd6.tar.gz blackbird-op-linux-81e804c9c2e38431c1c01165d06076776c6fcbd6.zip |
V4L/DVB (12121): pvrusb2: Improve handling of routing schemes
The pvrusb2 driver has a concept of "routing scheme" which defines
which physical inputs should be connected based on application's
choice of logical input. The correct "routing scheme" depends on the
specific device since different devices might wire up their muxes
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c b/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c index 9023adf3fdcc..41f6e009d5ef 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c +++ b/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c @@ -49,11 +49,13 @@ static const int routing_scheme1[] = { [PVR2_CVAL_INPUT_SVIDEO] = 0, }; -static const struct routing_scheme routing_schemes[] = { - [PVR2_ROUTING_SCHEME_ONAIR] = { - .def = routing_scheme1, - .cnt = ARRAY_SIZE(routing_scheme1), - }, +static const struct routing_scheme routing_def1 = { + .def = routing_scheme1, + .cnt = ARRAY_SIZE(routing_scheme1), +}; + +static const struct routing_scheme *routing_schemes[] = { + [PVR2_ROUTING_SCHEME_ONAIR] = &routing_def1, }; @@ -66,7 +68,7 @@ void pvr2_cs53l32a_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_input(%d)", hdw->input_val); if ((sid < ARRAY_SIZE(routing_schemes)) && - ((sp = routing_schemes + sid) != NULL) && + ((sp = routing_schemes[sid]) != NULL) && (hdw->input_val >= 0) && (hdw->input_val < sp->cnt)) { input = sp->def[hdw->input_val]; |