linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / media / video / wm8775.c
index d81a88b..8cb64f8 100644 (file)
@@ -79,26 +79,21 @@ static int wm8775_command(struct i2c_client *client, unsigned int cmd,
                          void *arg)
 {
        struct wm8775_state *state = i2c_get_clientdata(client);
-       struct v4l2_routing *route = arg;
+       struct v4l2_audio *input = arg;
        struct v4l2_control *ctrl = arg;
 
        switch (cmd) {
-       case VIDIOC_INT_G_AUDIO_ROUTING:
-               route->input = state->input;
-               route->output = 0;
-               break;
-
-       case VIDIOC_INT_S_AUDIO_ROUTING:
+       case VIDIOC_S_AUDIO:
                /* There are 4 inputs and one output. Zero or more inputs
                   are multiplexed together to the output. Hence there are
                   16 combinations.
                   If only one input is active (the normal case) then the
                   input values 1, 2, 4 or 8 should be used. */
-               if (route->input > 15) {
-                       v4l_err(client, "Invalid input %d.\n", route->input);
+               if (input->index > 15) {
+                       v4l_err(client, "Invalid input %d.\n", input->index);
                        return -EINVAL;
                }
-               state->input = route->input;
+               state->input = input->index;
                if (state->muted)
                        break;
                wm8775_write(client, R21, 0x0c0);
@@ -107,6 +102,11 @@ static int wm8775_command(struct i2c_client *client, unsigned int cmd,
                wm8775_write(client, R21, 0x100 + state->input);
                break;
 
+       case VIDIOC_G_AUDIO:
+               memset(input, 0, sizeof(*input));
+               input->index = state->input;
+               break;
+
        case VIDIOC_G_CTRL:
                if (ctrl->id != V4L2_CID_AUDIO_MUTE)
                        return -EINVAL;