hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/media/usb/cx231xx/cx231xx-avcore.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 cx231xx_avcore.c - driver for Conexant Cx23100/101/102
34 USB video capture devices
....@@ -7,19 +8,6 @@
78 This program contains the specific code to control the avdecoder chip and
89 other related usb control functions for cx231xx based chipset.
910
10
- This program is free software; you can redistribute it and/or modify
11
- it under the terms of the GNU General Public License as published by
12
- the Free Software Foundation; either version 2 of the License, or
13
- (at your option) any later version.
14
-
15
- This program is distributed in the hope that it will be useful,
16
- but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- GNU General Public License for more details.
19
-
20
- You should have received a copy of the GNU General Public License
21
- along with this program; if not, write to the Free Software
22
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2311 */
2412
2513 #include "cx231xx.h"
....@@ -599,14 +587,27 @@
599587 return status;
600588 }
601589 }
602
- if (dev->tuner_type == TUNER_NXP_TDA18271)
590
+ switch (dev->model) { /* i2c device tuners */
591
+ case CX231XX_BOARD_HAUPPAUGE_930C_HD_1114xx:
592
+ case CX231XX_BOARD_HAUPPAUGE_935C:
593
+ case CX231XX_BOARD_HAUPPAUGE_955Q:
594
+ case CX231XX_BOARD_HAUPPAUGE_975:
595
+ case CX231XX_BOARD_EVROMEDIA_FULL_HYBRID_FULLHD:
603596 status = cx231xx_set_decoder_video_input(dev,
604597 CX231XX_VMUX_TELEVISION,
605598 INPUT(input)->vmux);
606
- else
607
- status = cx231xx_set_decoder_video_input(dev,
599
+ break;
600
+ default:
601
+ if (dev->tuner_type == TUNER_NXP_TDA18271)
602
+ status = cx231xx_set_decoder_video_input(dev,
603
+ CX231XX_VMUX_TELEVISION,
604
+ INPUT(input)->vmux);
605
+ else
606
+ status = cx231xx_set_decoder_video_input(dev,
608607 CX231XX_VMUX_COMPOSITE1,
609608 INPUT(input)->vmux);
609
+ break;
610
+ }
610611
611612 break;
612613 default:
....@@ -1205,12 +1206,22 @@
12051206 cx231xx_set_field(FLD_SIF_EN, 0));
12061207 break;
12071208 default:
1209
+ switch (dev->model) { /* i2c device tuners */
1210
+ case CX231XX_BOARD_HAUPPAUGE_930C_HD_1114xx:
1211
+ case CX231XX_BOARD_HAUPPAUGE_935C:
1212
+ case CX231XX_BOARD_HAUPPAUGE_955Q:
1213
+ case CX231XX_BOARD_HAUPPAUGE_975:
1214
+ case CX231XX_BOARD_EVROMEDIA_FULL_HYBRID_FULLHD:
1215
+ /* TODO: Normal mode: SIF passthrough at 14.32 MHz?? */
1216
+ break;
1217
+ default:
12081218 /* This is just a casual suggestion to people adding
12091219 new boards in case they use a tuner type we don't
12101220 currently know about */
1211
- dev_info(dev->dev,
1212
- "Unknown tuner type configuring SIF");
1213
- break;
1221
+ dev_info(dev->dev,
1222
+ "Unknown tuner type configuring SIF");
1223
+ break;
1224
+ }
12141225 }
12151226 break;
12161227
....@@ -1252,7 +1263,7 @@
12521263 int cx231xx_set_agc_analog_digital_mux_select(struct cx231xx *dev,
12531264 u8 analog_or_digital)
12541265 {
1255
- int status = 0;
1266
+ int status;
12561267
12571268 /* first set the direction to output */
12581269 status = cx231xx_set_gpio_direction(dev,
....@@ -2987,7 +2998,7 @@
29872998 {
29882999 int status = 0;
29893000
2990
- /* set SDA to ouput */
3001
+ /* set SDA to output */
29913002 dev->gpio_dir |= 1 << dev->board.tuner_sda_gpio;
29923003 status = cx231xx_set_gpio_bit(dev, dev->gpio_dir, dev->gpio_val);
29933004