1 | /* $NetBSD: cxdtv_boards.c,v 1.2 2011/07/14 23:47:45 jmcneill Exp $ */ |
2 | |
3 | /* |
4 | * Copyright (c) 2008, 2011 Jonathan A. Kollasch |
5 | * Copyright (c) 2008 Jared D. McNeill <jmcneill@invisible.ca> |
6 | * All rights reserved. |
7 | * |
8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions |
10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the |
15 | * documentation and/or other materials provided with the distribution. |
16 | * |
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
18 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
19 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
20 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR |
21 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
23 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
24 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
26 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
27 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | */ |
29 | |
30 | #include <sys/cdefs.h> |
31 | __KERNEL_RCSID(0, "$NetBSD: cxdtv_boards.c,v 1.2 2011/07/14 23:47:45 jmcneill Exp $" ); |
32 | |
33 | #include <sys/types.h> |
34 | #include <sys/device.h> |
35 | |
36 | #include <dev/pci/pcidevs.h> |
37 | #include <dev/pci/pcivar.h> |
38 | #include <dev/pci/pcireg.h> |
39 | #include <dev/pci/cxdtvreg.h> |
40 | #include <dev/pci/cxdtv_boards.h> |
41 | |
42 | static const struct cxdtv_board cxdtv_boards[] = { |
43 | { |
44 | .cb_name = "ATI HDTV Wonder (digital-only)" , |
45 | .cb_vendor = PCI_VENDOR_ATI, |
46 | .cb_product = PCI_SUBSYSTEM_ATI_HDTV_WONDER_HP_Z556_MC, |
47 | .cb_tuner = CXDTV_TUNER_PLL, |
48 | .cb_demod = CXDTV_DEMOD_NXT2004, |
49 | }, |
50 | { |
51 | .cb_name = "pcHDTV HD5500" , |
52 | .cb_vendor = PCI_VENDOR_PCHDTV, |
53 | .cb_product = PCI_PRODUCT_PCHDTV_HD5500, |
54 | .cb_tuner = CXDTV_TUNER_PLL, |
55 | .cb_demod = CXDTV_DEMOD_LG3303, |
56 | }, |
57 | }; |
58 | |
59 | const struct cxdtv_board * |
60 | cxdtv_board_lookup(pci_vendor_id_t vendor, pci_product_id_t product) |
61 | { |
62 | const struct cxdtv_board *cb; |
63 | unsigned int i; |
64 | |
65 | for (i = 0; i < __arraycount(cxdtv_boards); i++) { |
66 | cb = &cxdtv_boards[i]; |
67 | if (vendor == cb->cb_vendor && product == cb->cb_product) |
68 | return cb; |
69 | } |
70 | |
71 | return NULL; |
72 | } |
73 | |