From owner-freebsd-bugs@FreeBSD.ORG Mon Jun 16 13:20:03 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6EC0737B401 for ; Mon, 16 Jun 2003 13:20:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C6EC43F93 for ; Mon, 16 Jun 2003 13:20:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h5GKK2Up056232 for ; Mon, 16 Jun 2003 13:20:02 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h5GKK2Os056231; Mon, 16 Jun 2003 13:20:02 -0700 (PDT) Resent-Date: Mon, 16 Jun 2003 13:20:02 -0700 (PDT) Resent-Message-Id: <200306162020.h5GKK2Os056231@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Tanja Wittke Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5348937B401 for ; Mon, 16 Jun 2003 13:17:41 -0700 (PDT) Received: from obh.snafu.de (obh.snafu.de [213.73.92.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4890F43FA3 for ; Mon, 16 Jun 2003 13:17:40 -0700 (PDT) (envelope-from tawi@gruft.de) Received: from tawi by obh.snafu.de with local (Exim 3.36 #1) id 19S0Q6-0003dv-00 for FreeBSD-gnats-submit@freebsd.org; Mon, 16 Jun 2003 22:17:38 +0200 Message-Id: Date: Mon, 16 Jun 2003 22:17:38 +0200 From: Tanja Wittke To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/53383: adding Terratec TValue to bktr driver X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Tanja Wittke List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jun 2003 20:20:03 -0000 >Number: 53383 >Category: kern >Synopsis: adding Terratec TValue to bktr driver >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Jun 16 13:20:01 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Tanja Wittke >Release: FreeBSD 4.8-PRERELEASE i386 >Organization: private >Environment: System: FreeBSD strolch.ob-home.lan 4.8-STABLE FreeBSD 4.8-STABLE #20: Mon Jun 16 21:12:17 CEST 2003 root@strolch.ob-home.lan:/usr/obj/usr/src/sys/STROLCH i386 >Description: When using the Terratec TValue Card widely used in Germany there is no sound and the wrong tuner is detected on the card. Adding the audio mux values, gpio mask and detection of the card fixes this. >How-To-Repeat: Simply use a Terratec TValue card with the bktr driver... >Fix: Applied you find a diff for the bktr_card.[ch] files which fixes the behaviour for that card. NOTE: I implemented this for only one specific model of the card (according to the PCI device ID). There are several other device IDs which seem to use the same values according to the SOlaris/Linux driver. These IDs are: 0x1117 0x1118 (which is implemented with my patch) 0x1119 0x111a (and maybe others) SNIP HERE diff -c sys/dev/bktr.old/bktr_card.c sys/dev/bktr/bktr_card.c *** sys/dev/bktr.old/bktr_card.c Sat Feb 8 03:04:57 2003 --- sys/dev/bktr/bktr_card.c Mon Jun 16 22:03:01 2003 *************** *** 355,360 **** --- 355,373 ---- { 0x10000, 0, 0x10000, 0, 1 }, /* audio MUX values */ 0x10f00 }, /* GPIO mask */ + { CARD_TERRATVALUE, /* the card id */ + "TerraTec TValue", /* the 'name' */ + NULL, /* the tuner */ + 0, /* the tuner i2c address */ + 0, /* dbx is optional */ + 0, + 0, + 0, /* EEProm type */ + 0, /* EEProm size */ + /* Tuner, Extern, Intern, Mute, Enabled */ + { 0x500, 0x900, 0x300, 0x900, 1 }, /* audio MUX values */ + 0xffff00 }, /* GPIO mask */ + }; struct bt848_card_sig bt848_card_signature[1]= { *************** *** 546,551 **** --- 559,565 ---- #define PCI_VENDOR_AVERMEDIA 0x1461 #define PCI_VENDOR_STB 0x10B4 #define PCI_VENDOR_ASKEY 0x144F + #define PCI_VENDOR_TERRATEC 0x153B #endif /* Following not confirmed with http://members.hyperlink.net.au/~chart, so not added to NetBSD's pcidevs */ *************** *** 556,561 **** --- 570,576 ---- #define PCI_VENDOR_IODATA 0x10fc #define MODEL_IODATA_GV_BCTV3_PCI 0x4020 + #define MODEL_TERRATVALUE1118 0x1118 void probeCard( bktr_ptr_t bktr, int verbose, int unit ) *************** *** 697,702 **** --- 712,725 ---- goto checkTuner; } + if (subsystem_vendor_id == PCI_VENDOR_TERRATEC && + subsystem_id == MODEL_TERRATVALUE1118 ) { + bktr->card = cards[ (card = CARD_TERRATVALUE) ]; + bktr->card.eepromAddr = eeprom_i2c_address; + bktr->card.eepromSize = (u_char)(256 / EEPROMBLOCKSIZE); + goto checkTuner; + } + /* Vendor is unknown. We will use the standard probe code */ /* which may not give best results */ printf("%s: Warning - card vendor 0x%04x (model 0x%04x) unknown.\n", *************** *** 1111,1116 **** --- 1134,1144 ---- case CARD_IO_BCTV3: select_tuner( bktr, ALPS_TSCH5 ); /* ALPS_TSCH6, in fact. */ + goto checkDBX; + break; + + case CARD_TERRATVALUE: + select_tuner( bktr, PHILIPS_PAL); /* Phlips PAL tuner */ goto checkDBX; break; diff -c sys/dev/bktr.old/bktr_card.h sys/dev/bktr/bktr_card.h *** sys/dev/bktr.old/bktr_card.h Sat Feb 8 03:04:57 2003 --- sys/dev/bktr/bktr_card.h Mon Jun 16 22:03:01 2003 *************** *** 77,83 **** #define CARD_LEADTEK 15 #define CARD_TERRATVPLUS 16 #define CARD_IO_BCTV3 17 ! #define Bt848_MAX_CARD 18 #define CARD_IO_GV CARD_IO_BCTV2 --- 77,84 ---- #define CARD_LEADTEK 15 #define CARD_TERRATVPLUS 16 #define CARD_IO_BCTV3 17 ! #define CARD_TERRATVALUE 18 ! #define Bt848_MAX_CARD 19 #define CARD_IO_GV CARD_IO_BCTV2 >Release-Note: >Audit-Trail: >Unformatted: