blob: da0f56d50e27fb5b322b715f2a5ccd576d350318 [file] [log] [blame]
Mauro Carvalho Chehab1a9fc852009-09-13 11:30:11 -03001/*
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
Mauro Carvalho Chehab02b20b02009-09-15 11:33:54 -030024#include <linux/init.h>
25#include <linux/module.h>
26#include <linux/pci.h>
27#include <linux/delay.h>
28#include <media/cx25840.h>
29
30#include "cx25821.h"
31#include "tuner-xc2028.h"
32
sai770238bf2010-03-22 23:29:25 -030033/* board config info */
Mauro Carvalho Chehab02b20b02009-09-15 11:33:54 -030034
35struct cx25821_board cx25821_boards[] = {
36 [UNKNOWN_BOARD] = {
Mauro Carvalho Chehab1a9fc852009-09-13 11:30:11 -030037 .name = "UNKNOWN/GENERIC",
sai770238bf2010-03-22 23:29:25 -030038 /* Ensure safe default for unknown boards */
Mauro Carvalho Chehab1a9fc852009-09-13 11:30:11 -030039 .clk_freq = 0,
40 },
Mauro Carvalho Chehab02b20b02009-09-15 11:33:54 -030041
42 [CX25821_BOARD] = {
Mauro Carvalho Chehab1a9fc852009-09-13 11:30:11 -030043 .name = "CX25821",
44 .portb = CX25821_RAW,
45 .portc = CX25821_264,
46 .input[0].type = CX25821_VMUX_COMPOSITE,
47 },
Mauro Carvalho Chehab02b20b02009-09-15 11:33:54 -030048
49};
50
51const unsigned int cx25821_bcount = ARRAY_SIZE(cx25821_boards);
52
Mauro Carvalho Chehab1a9fc852009-09-13 11:30:11 -030053struct cx25821_subid cx25821_subids[] = {
54 {
55 .subvendor = 0x14f1,
56 .subdevice = 0x0920,
57 .card = CX25821_BOARD,
58 },
Mauro Carvalho Chehab02b20b02009-09-15 11:33:54 -030059};
60
Mauro Carvalho Chehab02b20b02009-09-15 11:33:54 -030061void cx25821_card_setup(struct cx25821_dev *dev)
62{
63 static u8 eeprom[256];
64
Mauro Carvalho Chehab1a9fc852009-09-13 11:30:11 -030065 if (dev->i2c_bus[0].i2c_rc == 0) {
Mauro Carvalho Chehab02b20b02009-09-15 11:33:54 -030066 dev->i2c_bus[0].i2c_client.addr = 0xa0 >> 1;
Mauro Carvalho Chehab1a9fc852009-09-13 11:30:11 -030067 tveeprom_read(&dev->i2c_bus[0].i2c_client, eeprom,
68 sizeof(eeprom));
Mauro Carvalho Chehab02b20b02009-09-15 11:33:54 -030069 }
70}