.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | cx231xx_avcore.c - driver for Conexant Cx23100/101/102 |
---|
3 | 4 | USB video capture devices |
---|
.. | .. |
---|
7 | 8 | This program contains the specific code to control the avdecoder chip and |
---|
8 | 9 | other related usb control functions for cx231xx based chipset. |
---|
9 | 10 | |
---|
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. |
---|
23 | 11 | */ |
---|
24 | 12 | |
---|
25 | 13 | #include "cx231xx.h" |
---|
.. | .. |
---|
599 | 587 | return status; |
---|
600 | 588 | } |
---|
601 | 589 | } |
---|
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: |
---|
603 | 596 | status = cx231xx_set_decoder_video_input(dev, |
---|
604 | 597 | CX231XX_VMUX_TELEVISION, |
---|
605 | 598 | 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, |
---|
608 | 607 | CX231XX_VMUX_COMPOSITE1, |
---|
609 | 608 | INPUT(input)->vmux); |
---|
| 609 | + break; |
---|
| 610 | + } |
---|
610 | 611 | |
---|
611 | 612 | break; |
---|
612 | 613 | default: |
---|
.. | .. |
---|
1205 | 1206 | cx231xx_set_field(FLD_SIF_EN, 0)); |
---|
1206 | 1207 | break; |
---|
1207 | 1208 | 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: |
---|
1208 | 1218 | /* This is just a casual suggestion to people adding |
---|
1209 | 1219 | new boards in case they use a tuner type we don't |
---|
1210 | 1220 | 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 | + } |
---|
1214 | 1225 | } |
---|
1215 | 1226 | break; |
---|
1216 | 1227 | |
---|
.. | .. |
---|
1252 | 1263 | int cx231xx_set_agc_analog_digital_mux_select(struct cx231xx *dev, |
---|
1253 | 1264 | u8 analog_or_digital) |
---|
1254 | 1265 | { |
---|
1255 | | - int status = 0; |
---|
| 1266 | + int status; |
---|
1256 | 1267 | |
---|
1257 | 1268 | /* first set the direction to output */ |
---|
1258 | 1269 | status = cx231xx_set_gpio_direction(dev, |
---|
.. | .. |
---|
2987 | 2998 | { |
---|
2988 | 2999 | int status = 0; |
---|
2989 | 3000 | |
---|
2990 | | - /* set SDA to ouput */ |
---|
| 3001 | + /* set SDA to output */ |
---|
2991 | 3002 | dev->gpio_dir |= 1 << dev->board.tuner_sda_gpio; |
---|
2992 | 3003 | status = cx231xx_set_gpio_bit(dev, dev->gpio_dir, dev->gpio_val); |
---|
2993 | 3004 | |
---|