Mike Isely | d855497 | 2006-06-26 20:58:46 -0300 | [diff] [blame] | 1 | /* |
| 2 | * |
Mike Isely | d855497 | 2006-06-26 20:58:46 -0300 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2005 Mike Isely <isely@pobox.com> |
| 5 | * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> |
| 6 | * |
| 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 |
| 10 | * |
| 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. |
| 15 | * |
| 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 |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | |
| 24 | This source file is specifically designed to interface with the |
| 25 | wm8775. |
| 26 | |
| 27 | */ |
| 28 | |
| 29 | #include "pvrusb2-wm8775.h" |
Mike Isely | d855497 | 2006-06-26 20:58:46 -0300 | [diff] [blame] | 30 | |
| 31 | |
| 32 | #include "pvrusb2-hdw-internal.h" |
| 33 | #include "pvrusb2-debug.h" |
| 34 | #include <linux/videodev2.h> |
| 35 | #include <media/v4l2-common.h> |
| 36 | #include <linux/errno.h> |
Mike Isely | d855497 | 2006-06-26 20:58:46 -0300 | [diff] [blame] | 37 | |
Mike Isely | 4ecbc28 | 2009-03-07 00:49:19 -0300 | [diff] [blame] | 38 | void pvr2_wm8775_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) |
Mike Isely | 5f6dae8 | 2009-03-07 00:39:34 -0300 | [diff] [blame] | 39 | { |
Mike Isely | 2776472 | 2009-03-07 01:57:25 -0300 | [diff] [blame] | 40 | if (hdw->input_dirty || hdw->force_dirty) { |
Hans Verkuil | 5325b42 | 2009-04-02 11:26:22 -0300 | [diff] [blame] | 41 | u32 input; |
Mike Isely | 5f6dae8 | 2009-03-07 00:39:34 -0300 | [diff] [blame] | 42 | |
| 43 | switch (hdw->input_val) { |
| 44 | case PVR2_CVAL_INPUT_RADIO: |
Hans Verkuil | 5325b42 | 2009-04-02 11:26:22 -0300 | [diff] [blame] | 45 | input = 1; |
Mike Isely | 5f6dae8 | 2009-03-07 00:39:34 -0300 | [diff] [blame] | 46 | break; |
| 47 | default: |
| 48 | /* All other cases just use the second input */ |
Hans Verkuil | 5325b42 | 2009-04-02 11:26:22 -0300 | [diff] [blame] | 49 | input = 2; |
Mike Isely | 5f6dae8 | 2009-03-07 00:39:34 -0300 | [diff] [blame] | 50 | break; |
| 51 | } |
| 52 | pvr2_trace(PVR2_TRACE_CHIPS, "subdev wm8775" |
| 53 | " set_input(val=%d route=0x%x)", |
Hans Verkuil | 5325b42 | 2009-04-02 11:26:22 -0300 | [diff] [blame] | 54 | hdw->input_val, input); |
Mike Isely | 5f6dae8 | 2009-03-07 00:39:34 -0300 | [diff] [blame] | 55 | |
Hans Verkuil | 5325b42 | 2009-04-02 11:26:22 -0300 | [diff] [blame] | 56 | sd->ops->audio->s_routing(sd, input, 0, 0); |
Mike Isely | 5f6dae8 | 2009-03-07 00:39:34 -0300 | [diff] [blame] | 57 | } |
| 58 | } |
| 59 | |
Mike Isely | d855497 | 2006-06-26 20:58:46 -0300 | [diff] [blame] | 60 | |
| 61 | |
| 62 | /* |
| 63 | Stuff for Emacs to see, in order to encourage consistent editing style: |
| 64 | *** Local Variables: *** |
| 65 | *** mode: c *** |
| 66 | *** fill-column: 70 *** |
| 67 | *** tab-width: 8 *** |
| 68 | *** c-basic-offset: 8 *** |
| 69 | *** End: *** |
| 70 | */ |