1122394Sharti/* $NetBSD$ */ 2122394Sharti 3122394Sharti/*- 4122394Sharti * Copyright (c) 2008 Jared D. McNeill <jmcneill@invisible.ca> 5122394Sharti * All rights reserved. 6122394Sharti * 7133211Sharti * Redistribution and use in source and binary forms, with or without 8133211Sharti * modification, are permitted provided that the following conditions 9133211Sharti * are met: 10133211Sharti * 1. Redistributions of source code must retain the above copyright 11133211Sharti * notice, this list of conditions and the following disclaimer. 12133211Sharti * 2. Redistributions in binary form must reproduce the above copyright 13122394Sharti * notice, this list of conditions and the following disclaimer in the 14122394Sharti * documentation and/or other materials provided with the distribution. 15122394Sharti * 16133211Sharti * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 17133211Sharti * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18133211Sharti * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19133211Sharti * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 20133211Sharti * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21133211Sharti * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22133211Sharti * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23133211Sharti * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24133211Sharti * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25133211Sharti * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26133211Sharti * POSSIBILITY OF SUCH DAMAGE. 27133211Sharti */ 28122394Sharti 29156066Sharti#include <sys/cdefs.h> 30122394Sharti__KERNEL_RCSID(0, "$NetBSD$"); 31122394Sharti 32122394Sharti#include <sys/types.h> 33122394Sharti#include <sys/device.h> 34122394Sharti 35122394Sharti#include <dev/usb/usbdevs.h> 36122394Sharti#include <dev/usb/emdtvvar.h> 37122394Sharti 38122394Shartistatic const struct emdtv_board emdtv_boards[] = { 39122394Sharti { 40122394Sharti .eb_name = "ATI TV Wonder 600 USB", 41122394Sharti .eb_vendor = USB_VENDOR_AMD, 42122394Sharti .eb_product = USB_PRODUCT_AMD_TV_WONDER_600_USB, 43122394Sharti .eb_tuner = EMDTV_TUNER_XC3028L, 44122394Sharti .eb_demod = EMDTV_DEMOD_LG3303, 45122394Sharti .eb_manual_gpio = true, 46122394Sharti .eb_gpio_regs = { 47122394Sharti .ts1_on = EMDTV_GPIO_BIT_VAL(0, 0, 0), 48122394Sharti .a_on = EMDTV_GPIO_BIT_VAL(1, 0, 0), 49122394Sharti .t1_on = EMDTV_GPIO_BIT_VAL(6, 0, 0), 50122394Sharti .t1_reset = EMDTV_GPIO_BIT_VAL(4, 0, 1), 51122394Sharti .d1_reset = EMDTV_GPIO_BIT_VAL(19, 0, 1), 52122394Sharti }, 53122394Sharti }, 54122394Sharti { 55122394Sharti .eb_name = "Pinnacle PCTV HD Pro Stick 800e", 56122394Sharti .eb_vendor = USB_VENDOR_PINNACLE, 57122394Sharti .eb_product = USB_PRODUCT_PINNACLE_PCTV800E, 58122394Sharti .eb_tuner = EMDTV_TUNER_XC3028, 59122394Sharti .eb_demod = EMDTV_DEMOD_LG3303, 60122394Sharti .eb_manual_gpio = true, 61122394Sharti .eb_gpio_regs = { 62122394Sharti .ts1_on = EMDTV_GPIO_BIT_VAL(0, 0, 0), 63122394Sharti .a_on = EMDTV_GPIO_BIT_VAL(1, 0, 0), 64122394Sharti .t1_on = EMDTV_GPIO_BIT_VAL(6, 0, 0), 65122394Sharti .t1_reset = EMDTV_GPIO_BIT_VAL(4, 0, 1), 66122394Sharti .d1_reset = EMDTV_GPIO_BIT_VAL(19, 0, 1), 67122394Sharti }, 68122394Sharti }, 69122394Sharti { 70122394Sharti .eb_name = "Empia Hybrid XS ATSC", 71122394Sharti .eb_vendor = USB_VENDOR_EMPIA, 72122394Sharti .eb_product = USB_PRODUCT_EMPIA_EM2883, 73122394Sharti .eb_tuner = EMDTV_TUNER_XC5000, 74122394Sharti .eb_demod = EMDTV_DEMOD_LG3304, 75122394Sharti }, 76122394Sharti}; 77122394Sharti 78122394Sharticonst struct emdtv_board * 79122394Shartiemdtv_board_lookup(uint16_t vendor, uint16_t product) 80122394Sharti{ 81122394Sharti const struct emdtv_board *eb; 82122394Sharti unsigned int i; 83122394Sharti 84122394Sharti for (i = 0; i < __arraycount(emdtv_boards); i++) { 85122394Sharti eb = &emdtv_boards[i]; 86122394Sharti if (vendor == eb->eb_vendor && product == eb->eb_product) 87122394Sharti return eb; 88122394Sharti } 89122394Sharti 90122394Sharti return NULL; 91122394Sharti} 92122394Sharti