Mauro Carvalho Chehab | 1a9fc85 | 2009-09-13 11:30:11 -0300 | [diff] [blame] | 1 | /* |
| 2 | * Driver for the Conexant CX25821 PCIe bridge |
| 3 | * |
| 4 | * Copyright (C) 2009 Conexant Systems Inc. |
| 5 | * Authors <shu.lin@conexant.com>, <hiep.huynh@conexant.com> |
| 6 | * Based on Steven Toth <stoth@linuxtv.org> cx23885 driver |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 22 | */ |
| 23 | |
Joe Perches | 36d89f7 | 2010-11-07 17:48:21 -0300 | [diff] [blame] | 24 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 25 | |
Mauro Carvalho Chehab | 02b20b0 | 2009-09-15 11:33:54 -0300 | [diff] [blame] | 26 | #include <linux/init.h> |
| 27 | #include <linux/module.h> |
| 28 | #include <linux/pci.h> |
| 29 | #include <linux/delay.h> |
| 30 | #include <media/cx25840.h> |
| 31 | |
| 32 | #include "cx25821.h" |
| 33 | #include "tuner-xc2028.h" |
| 34 | |
sai | 770238bf | 2010-03-22 23:29:25 -0300 | [diff] [blame] | 35 | /* board config info */ |
Mauro Carvalho Chehab | 02b20b0 | 2009-09-15 11:33:54 -0300 | [diff] [blame] | 36 | |
| 37 | struct cx25821_board cx25821_boards[] = { |
| 38 | [UNKNOWN_BOARD] = { |
Leonid V. Fedorenchik | 0fe773d | 2011-09-02 11:55:34 +0800 | [diff] [blame] | 39 | .name = "UNKNOWN/GENERIC", |
| 40 | /* Ensure safe default for unknown boards */ |
| 41 | .clk_freq = 0, |
| 42 | }, |
Mauro Carvalho Chehab | 02b20b0 | 2009-09-15 11:33:54 -0300 | [diff] [blame] | 43 | |
| 44 | [CX25821_BOARD] = { |
Leonid V. Fedorenchik | 0fe773d | 2011-09-02 11:55:34 +0800 | [diff] [blame] | 45 | .name = "CX25821", |
| 46 | .portb = CX25821_RAW, |
| 47 | .portc = CX25821_264, |
| 48 | .input[0].type = CX25821_VMUX_COMPOSITE, |
| 49 | }, |
Mauro Carvalho Chehab | 02b20b0 | 2009-09-15 11:33:54 -0300 | [diff] [blame] | 50 | |
| 51 | }; |
| 52 | |
| 53 | const unsigned int cx25821_bcount = ARRAY_SIZE(cx25821_boards); |
| 54 | |
Mauro Carvalho Chehab | 1a9fc85 | 2009-09-13 11:30:11 -0300 | [diff] [blame] | 55 | struct cx25821_subid cx25821_subids[] = { |
| 56 | { |
Leonid V. Fedorenchik | 0fe773d | 2011-09-02 11:55:34 +0800 | [diff] [blame] | 57 | .subvendor = 0x14f1, |
| 58 | .subdevice = 0x0920, |
| 59 | .card = CX25821_BOARD, |
| 60 | }, |
Mauro Carvalho Chehab | 02b20b0 | 2009-09-15 11:33:54 -0300 | [diff] [blame] | 61 | }; |
| 62 | |
Mauro Carvalho Chehab | 02b20b0 | 2009-09-15 11:33:54 -0300 | [diff] [blame] | 63 | void cx25821_card_setup(struct cx25821_dev *dev) |
| 64 | { |
| 65 | static u8 eeprom[256]; |
| 66 | |
Mauro Carvalho Chehab | 1a9fc85 | 2009-09-13 11:30:11 -0300 | [diff] [blame] | 67 | if (dev->i2c_bus[0].i2c_rc == 0) { |
Mauro Carvalho Chehab | 02b20b0 | 2009-09-15 11:33:54 -0300 | [diff] [blame] | 68 | dev->i2c_bus[0].i2c_client.addr = 0xa0 >> 1; |
Mauro Carvalho Chehab | 1a9fc85 | 2009-09-13 11:30:11 -0300 | [diff] [blame] | 69 | tveeprom_read(&dev->i2c_bus[0].i2c_client, eeprom, |
Leonid V. Fedorenchik | 744992c | 2011-10-22 01:43:30 -0300 | [diff] [blame] | 70 | sizeof(eeprom)); |
Mauro Carvalho Chehab | 02b20b0 | 2009-09-15 11:33:54 -0300 | [diff] [blame] | 71 | } |
| 72 | } |