From owner-freebsd-multimedia Fri Mar 21 14:03:26 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id OAA16035 for multimedia-outgoing; Fri, 21 Mar 1997 14:03:26 -0800 (PST) Received: from rah.star-gate.com (rah.star-gate.com [204.188.121.18]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id OAA16028 for ; Fri, 21 Mar 1997 14:03:05 -0800 (PST) Received: from rah.star-gate.com (localhost.star-gate.com [127.0.0.1]) by rah.star-gate.com (8.8.5/8.7.3) with ESMTP id OAA02176; Fri, 21 Mar 1997 14:02:43 -0800 (PST) Message-Id: <199703212202.OAA02176@rah.star-gate.com> X-Mailer: exmh version 1.6.9 8/22/96 To: Steve Passe cc: multimedia@FreeBSD.ORG Subject: Re: INTs on the bt848 In-reply-to: Your message of "Fri, 21 Mar 1997 14:39:08 MST." <199703212139.OAA25157@Ilsa.StevesCafe.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 21 Mar 1997 14:02:43 -0800 From: Amancio Hasty Sender: owner-multimedia@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >From The Desk Of Steve Passe : > Hi, > > I have been looking over the INT code and have the following questions: > > in bktr_intr, near the top you attempt to access the device status register: > ... > bt_reg = (u_char *) &bt848; > s_status = *bt_reg; > *bt_reg = 0; Thats just my silly convention. Yes, you can change it to: s_status = *bt848 *bt848 = 0; > this code takes the addr of the pointer, then sets s_status to the pointer > value, NOT the thing it points @, ie bt848 is already a u_char*. so > your doing double indirection. > > shouldn't this be: > s_status = *bt848; > *bt848 = 0; > --- > a little further down you read the int status register: > > btl_reg = (u_long *) &bt848[BKTR_INT_STAT]; > bktr_status = *btl_reg ; > *btl_reg = *btl_reg; > *btl_reg = 0; At the time I was having a horrible time clearing up error conditions and this is just code that should be taken out. Feel free to take out line #4 > > line 3 clears all the set bits, but line 4 doesn't accomplish anything that > I can see, based on the databook, p 107, since a 0 in a bit field has > no effect. shouldn'tline 4 be removed? > > --- > in bktr_open() you access the device status register again: > > *bt848 = 0x3; > *bt848 = 0xc0; > > what is this attempting to do? I think that at the time that I wrote the above I wanted to make sure that I had a valid input source and that bit 0 & 1 to be resetted. > the databook, page 87, says only the 2 low bits hold values, and my > experiments with reading/clearing it show that writting a 0 bit > to the filed is what will clear it. > > shouldn't this be changed to: > > *bt848 = 0x00; again, your correction is the appropriate one. Just be a little careful when hacking on the Bt848 and when in doubt double check your assumptions by way of experimentation. Have fun! Amancio