···5959static int cs53l32a_command(struct i2c_client *client, unsigned int cmd,6060 void *arg)6161{6262- struct v4l2_audio *input = arg;6262+ struct v4l2_routing *route = arg;6363 struct v4l2_control *ctrl = arg;64646565 switch (cmd) {6666- case VIDIOC_S_AUDIO:6666+ case VIDIOC_INT_G_AUDIO_ROUTING:6767+ route->input = (cs53l32a_read(client, 0x01) >> 4) & 3;6868+ route->output = 0;6969+ break;7070+7171+ case VIDIOC_INT_S_AUDIO_ROUTING:6772 /* There are 2 physical inputs, but the second input can be6873 placed in two modes, the first mode bypasses the PGA (gain),6974 the second goes through the PGA. Hence there are three7075 possible inputs to choose from. */7171- if (input->index > 2) {7272- v4l_err(client, "Invalid input %d.\n", input->index);7676+ if (route->input > 2) {7777+ v4l_err(client, "Invalid input %d.\n", route->input);7378 return -EINVAL;7479 }7575- cs53l32a_write(client, 0x01, 0x01 + (input->index << 4));8080+ cs53l32a_write(client, 0x01, 0x01 + (route->input << 4));7681 break;77827883 case VIDIOC_G_CTRL:
+10-5
drivers/media/video/wm8775.c
···7979 void *arg)8080{8181 struct wm8775_state *state = i2c_get_clientdata(client);8282- struct v4l2_audio *input = arg;8282+ struct v4l2_routing *route = arg;8383 struct v4l2_control *ctrl = arg;84848585 switch (cmd) {8686- case VIDIOC_S_AUDIO:8686+ case VIDIOC_INT_G_AUDIO_ROUTING:8787+ route->input = state->input;8888+ route->output = 0;8989+ break;9090+9191+ case VIDIOC_INT_S_AUDIO_ROUTING:8792 /* There are 4 inputs and one output. Zero or more inputs8893 are multiplexed together to the output. Hence there are8994 16 combinations.9095 If only one input is active (the normal case) then the9196 input values 1, 2, 4 or 8 should be used. */9292- if (input->index > 15) {9393- v4l_err(client, "Invalid input %d.\n", input->index);9797+ if (route->input > 15) {9898+ v4l_err(client, "Invalid input %d.\n", route->input);9499 return -EINVAL;95100 }9696- state->input = input->index;101101+ state->input = route->input;97102 if (state->muted)98103 break;99104 wm8775_write(client, R21, 0x0c0);
+34
include/media/cs53l32a.h
···11+/*22+ cs53l32a.h - definition for cs53l32a inputs and outputs33+44+ Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl)55+66+ This program is free software; you can redistribute it and/or modify77+ it under the terms of the GNU General Public License as published by88+ the Free Software Foundation; either version 2 of the License, or99+ (at your option) any later version.1010+1111+ This program is distributed in the hope that it will be useful,1212+ but WITHOUT ANY WARRANTY; without even the implied warranty of1313+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414+ GNU General Public License for more details.1515+1616+ You should have received a copy of the GNU General Public License1717+ along with this program; if not, write to the Free Software1818+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.1919+*/2020+2121+#ifndef _CS53L32A_H_2222+#define _CS53L32A_H_2323+2424+/* There are 2 physical inputs, but the second input can be2525+ placed in two modes, the first mode bypasses the PGA (gain),2626+ the second goes through the PGA. Hence there are three2727+ possible inputs to choose from. */2828+2929+/* CS53L32A HW inputs */3030+#define CS53L32A_IN0 03131+#define CS53L32A_IN1 13232+#define CS53L32A_IN2 23333+3434+#endif
+35
include/media/wm8775.h
···11+/*22+ wm8775.h - definition for wm8775 inputs and outputs33+44+ Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl)55+66+ This program is free software; you can redistribute it and/or modify77+ it under the terms of the GNU General Public License as published by88+ the Free Software Foundation; either version 2 of the License, or99+ (at your option) any later version.1010+1111+ This program is distributed in the hope that it will be useful,1212+ but WITHOUT ANY WARRANTY; without even the implied warranty of1313+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414+ GNU General Public License for more details.1515+1616+ You should have received a copy of the GNU General Public License1717+ along with this program; if not, write to the Free Software1818+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.1919+*/2020+2121+#ifndef _WM8775_H_2222+#define _WM8775_H_2323+2424+/* The WM8775 has 4 inputs and one output. Zero or more inputs2525+ are multiplexed together to the output. Hence there are2626+ 16 combinations.2727+ If only one input is active (the normal case) then the2828+ input values 1, 2, 4 or 8 should be used. */2929+3030+#define WM8775_AIN1 13131+#define WM8775_AIN2 23232+#define WM8775_AIN3 43333+#define WM8775_AIN4 83434+3535+#endif