4 * Copyright (C) 2005 Mike Isely <isely@pobox.com>
5 * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "pvrusb2-audio.h"
23 #include "pvrusb2-hdw-internal.h"
24 #include "pvrusb2-debug.h"
25 #include <linux/videodev2.h>
26 #include <media/msp3400.h>
27 #include <media/v4l2-common.h>
30 struct routing_scheme {
35 static const int routing_scheme0[] = {
36 [PVR2_CVAL_INPUT_TV] = MSP_INPUT_DEFAULT,
37 [PVR2_CVAL_INPUT_RADIO] = MSP_INPUT(MSP_IN_SCART2,
41 [PVR2_CVAL_INPUT_COMPOSITE] = MSP_INPUT(MSP_IN_SCART1,
45 [PVR2_CVAL_INPUT_SVIDEO] = MSP_INPUT(MSP_IN_SCART1,
51 static const struct routing_scheme routing_schemes[] = {
52 [PVR2_ROUTING_SCHEME_HAUPPAUGE] = {
53 .def = routing_scheme0,
54 .cnt = ARRAY_SIZE(routing_scheme0),
58 void pvr2_msp3400_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
60 if (hdw->input_dirty || hdw->force_dirty) {
61 struct v4l2_routing route;
62 const struct routing_scheme *sp;
63 unsigned int sid = hdw->hdw_desc->signal_routing_scheme;
65 pvr2_trace(PVR2_TRACE_CHIPS, "subdev msp3400 v4l2 set_stereo");
67 if ((sid < ARRAY_SIZE(routing_schemes)) &&
68 ((sp = routing_schemes + sid) != NULL) &&
69 (hdw->input_val >= 0) &&
70 (hdw->input_val < sp->cnt)) {
71 route.input = sp->def[hdw->input_val];
73 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
74 "*** WARNING *** subdev msp3400 set_input:"
75 " Invalid routing scheme (%u)"
80 route.output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1);
81 sd->ops->audio->s_routing(sd, &route);
86 Stuff for Emacs to see, in order to encourage consistent editing style:
87 *** Local Variables: ***
89 *** fill-column: 70 ***
91 *** c-basic-offset: 8 ***