Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (3610): Added the new routing commands to cx25840.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
31bc09b5 11cda107

+87 -56
+2 -1
drivers/media/video/cx25840/cx25840-audio.c
··· 19 19 #include <linux/videodev2.h> 20 20 #include <linux/i2c.h> 21 21 #include <media/v4l2-common.h> 22 + #include <media/cx25840.h> 22 23 23 - #include "cx25840.h" 24 + #include "cx25840-core.h" 24 25 25 26 static int set_audclk_freq(struct i2c_client *client, u32 freq) 26 27 {
+14 -10
drivers/media/video/cx25840/cx25840-core.c
··· 32 32 #include <linux/videodev2.h> 33 33 #include <linux/i2c.h> 34 34 #include <media/v4l2-common.h> 35 + #include <media/cx25840.h> 35 36 36 - #include "cx25840.h" 37 + #include "cx25840-core.h" 37 38 38 39 MODULE_DESCRIPTION("Conexant CX25840 audio/video decoder driver"); 39 40 MODULE_AUTHOR("Ulf Eklund, Chris Kennedy, Hans Verkuil, Tyler Trafford"); ··· 669 668 { 670 669 struct cx25840_state *state = i2c_get_clientdata(client); 671 670 struct v4l2_tuner *vt = arg; 671 + struct v4l2_routing *route = arg; 672 672 673 673 switch (cmd) { 674 674 #ifdef CONFIG_VIDEO_ADV_DEBUG ··· 751 749 state->radio = 1; 752 750 break; 753 751 754 - case VIDIOC_G_INPUT: 755 - *(int *)arg = state->vid_input; 752 + case VIDIOC_INT_G_VIDEO_ROUTING: 753 + route->input = state->vid_input; 754 + route->output = 0; 756 755 break; 757 756 758 - case VIDIOC_S_INPUT: 759 - return set_input(client, *(enum cx25840_video_input *)arg, state->aud_input); 757 + case VIDIOC_INT_S_VIDEO_ROUTING: 758 + return set_input(client, route->input, state->aud_input); 760 759 761 - case VIDIOC_S_AUDIO: 762 - { 763 - struct v4l2_audio *input = arg; 760 + case VIDIOC_INT_G_AUDIO_ROUTING: 761 + route->input = state->aud_input; 762 + route->output = 0; 763 + break; 764 764 765 - return set_input(client, state->vid_input, input->index); 766 - } 765 + case VIDIOC_INT_S_AUDIO_ROUTING: 766 + return set_input(client, state->vid_input, route->input); 767 767 768 768 case VIDIOC_S_FREQUENCY: 769 769 input_change(client);
+2 -1
drivers/media/video/cx25840/cx25840-firmware.c
··· 20 20 #include <linux/i2c-algo-bit.h> 21 21 #include <linux/firmware.h> 22 22 #include <media/v4l2-common.h> 23 + #include <media/cx25840.h> 23 24 24 - #include "cx25840.h" 25 + #include "cx25840-core.h" 25 26 26 27 #define FWFILE "v4l-cx25840.fw" 27 28 #define FWSEND 1024
+2 -1
drivers/media/video/cx25840/cx25840-vbi.c
··· 19 19 #include <linux/videodev2.h> 20 20 #include <linux/i2c.h> 21 21 #include <media/v4l2-common.h> 22 + #include <media/cx25840.h> 22 23 23 - #include "cx25840.h" 24 + #include "cx25840-core.h" 24 25 25 26 static int odd_parity(u8 c) 26 27 {
+3 -43
drivers/media/video/cx25840/cx25840.h drivers/media/video/cx25840/cx25840-core.h
··· 1 - /* cx25840 API header 1 + /* cx25840 internal API header 2 2 * 3 3 * Copyright (C) 2003-2004 Chris Kennedy 4 4 * ··· 17 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 18 */ 19 19 20 - #ifndef _CX25840_H_ 21 - #define _CX25840_H_ 20 + #ifndef _CX25840_CORE_H_ 21 + #define _CX25840_CORE_H_ 22 22 23 23 24 24 #include <linux/videodev2.h> ··· 31 31 is to select the audio standard explicitly. Many thanks to Hauppauge for 32 32 providing this information. */ 33 33 #define CX25840_CID_ENABLE_PVR150_WORKAROUND (V4L2_CID_PRIVATE_BASE+0) 34 - 35 - enum cx25840_video_input { 36 - /* Composite video inputs In1-In8 */ 37 - CX25840_COMPOSITE1 = 1, 38 - CX25840_COMPOSITE2, 39 - CX25840_COMPOSITE3, 40 - CX25840_COMPOSITE4, 41 - CX25840_COMPOSITE5, 42 - CX25840_COMPOSITE6, 43 - CX25840_COMPOSITE7, 44 - CX25840_COMPOSITE8, 45 - 46 - /* S-Video inputs consist of one luma input (In1-In4) ORed with one 47 - chroma input (In5-In8) */ 48 - CX25840_SVIDEO_LUMA1 = 0x10, 49 - CX25840_SVIDEO_LUMA2 = 0x20, 50 - CX25840_SVIDEO_LUMA3 = 0x30, 51 - CX25840_SVIDEO_LUMA4 = 0x40, 52 - CX25840_SVIDEO_CHROMA4 = 0x400, 53 - CX25840_SVIDEO_CHROMA5 = 0x500, 54 - CX25840_SVIDEO_CHROMA6 = 0x600, 55 - CX25840_SVIDEO_CHROMA7 = 0x700, 56 - CX25840_SVIDEO_CHROMA8 = 0x800, 57 - 58 - /* S-Video aliases for common luma/chroma combinations */ 59 - CX25840_SVIDEO1 = 0x510, 60 - CX25840_SVIDEO2 = 0x620, 61 - CX25840_SVIDEO3 = 0x730, 62 - CX25840_SVIDEO4 = 0x840, 63 - }; 64 - 65 - enum cx25840_audio_input { 66 - /* Audio inputs: serial or In4-In8 */ 67 - CX25840_AUDIO_SERIAL, 68 - CX25840_AUDIO4 = 4, 69 - CX25840_AUDIO5, 70 - CX25840_AUDIO6, 71 - CX25840_AUDIO7, 72 - CX25840_AUDIO8, 73 - }; 74 34 75 35 struct cx25840_state { 76 36 int pvr150_workaround;
+64
include/media/cx25840.h
··· 1 + /* 2 + cx25840.h - definition for cx25840/1/2/3 inputs 3 + 4 + Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl) 5 + 6 + This program is free software; you can redistribute it and/or modify 7 + it under the terms of the GNU General Public License as published by 8 + the Free Software Foundation; either version 2 of the License, or 9 + (at your option) any later version. 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., 675 Mass Ave, Cambridge, MA 02139, USA. 19 + */ 20 + 21 + #ifndef _CX25840_H_ 22 + #define _CX25840_H_ 23 + 24 + enum cx25840_video_input { 25 + /* Composite video inputs In1-In8 */ 26 + CX25840_COMPOSITE1 = 1, 27 + CX25840_COMPOSITE2, 28 + CX25840_COMPOSITE3, 29 + CX25840_COMPOSITE4, 30 + CX25840_COMPOSITE5, 31 + CX25840_COMPOSITE6, 32 + CX25840_COMPOSITE7, 33 + CX25840_COMPOSITE8, 34 + 35 + /* S-Video inputs consist of one luma input (In1-In4) ORed with one 36 + chroma input (In5-In8) */ 37 + CX25840_SVIDEO_LUMA1 = 0x10, 38 + CX25840_SVIDEO_LUMA2 = 0x20, 39 + CX25840_SVIDEO_LUMA3 = 0x30, 40 + CX25840_SVIDEO_LUMA4 = 0x40, 41 + CX25840_SVIDEO_CHROMA4 = 0x400, 42 + CX25840_SVIDEO_CHROMA5 = 0x500, 43 + CX25840_SVIDEO_CHROMA6 = 0x600, 44 + CX25840_SVIDEO_CHROMA7 = 0x700, 45 + CX25840_SVIDEO_CHROMA8 = 0x800, 46 + 47 + /* S-Video aliases for common luma/chroma combinations */ 48 + CX25840_SVIDEO1 = 0x510, 49 + CX25840_SVIDEO2 = 0x620, 50 + CX25840_SVIDEO3 = 0x730, 51 + CX25840_SVIDEO4 = 0x840, 52 + }; 53 + 54 + enum cx25840_audio_input { 55 + /* Audio inputs: serial or In4-In8 */ 56 + CX25840_AUDIO_SERIAL, 57 + CX25840_AUDIO4 = 4, 58 + CX25840_AUDIO5, 59 + CX25840_AUDIO6, 60 + CX25840_AUDIO7, 61 + CX25840_AUDIO8, 62 + }; 63 + 64 + #endif