diff options
author | Mike Isely <isely@pobox.com> | 2006-06-25 19:04:44 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-26 23:17:28 -0400 |
commit | a761f4311b3e31008c7d168c3a8c254a9c7e35ac (patch) | |
tree | 03817e0334a6e019251a3483dc8147a418caabb5 /drivers/media/video/pvrusb2/pvrusb2-hdw.c | |
parent | 332139635a8c0431cc2eb67adf1e983eb96728e3 (diff) |
V4L/DVB (4240): Various V4L control enhancements in pvrusb2
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-hdw.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 7d46bc10179a..f461830c64c9 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -1988,7 +1988,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_by_id(struct pvr2_hdw *hdw, | |||
1988 | } | 1988 | } |
1989 | 1989 | ||
1990 | 1990 | ||
1991 | /* Given an ID, retrieve the control structure associated with it. */ | 1991 | /* Given a V4L ID, retrieve the control structure associated with it. */ |
1992 | struct pvr2_ctrl *pvr2_hdw_get_ctrl_v4l(struct pvr2_hdw *hdw,unsigned int ctl_id) | 1992 | struct pvr2_ctrl *pvr2_hdw_get_ctrl_v4l(struct pvr2_hdw *hdw,unsigned int ctl_id) |
1993 | { | 1993 | { |
1994 | struct pvr2_ctrl *cptr; | 1994 | struct pvr2_ctrl *cptr; |
@@ -2005,6 +2005,30 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_v4l(struct pvr2_hdw *hdw,unsigned int ctl_id | |||
2005 | } | 2005 | } |
2006 | 2006 | ||
2007 | 2007 | ||
2008 | /* Given a V4L ID for its immediate predecessor, retrieve the control | ||
2009 | structure associated with it. */ | ||
2010 | struct pvr2_ctrl *pvr2_hdw_get_ctrl_nextv4l(struct pvr2_hdw *hdw, | ||
2011 | unsigned int ctl_id) | ||
2012 | { | ||
2013 | struct pvr2_ctrl *cptr,*cp2; | ||
2014 | unsigned int idx; | ||
2015 | int i; | ||
2016 | |||
2017 | /* This could be made a lot more efficient, but for now... */ | ||
2018 | cp2 = 0; | ||
2019 | for (idx = 0; idx < hdw->control_cnt; idx++) { | ||
2020 | cptr = hdw->controls + idx; | ||
2021 | i = cptr->info->v4l_id; | ||
2022 | if (!i) continue; | ||
2023 | if (i <= ctl_id) continue; | ||
2024 | if (cp2 && (cp2->info->v4l_id < i)) continue; | ||
2025 | cp2 = cptr; | ||
2026 | } | ||
2027 | return cp2; | ||
2028 | return 0; | ||
2029 | } | ||
2030 | |||
2031 | |||
2008 | static const char *get_ctrl_typename(enum pvr2_ctl_type tp) | 2032 | static const char *get_ctrl_typename(enum pvr2_ctl_type tp) |
2009 | { | 2033 | { |
2010 | switch (tp) { | 2034 | switch (tp) { |