Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Mar 1997 14:02:43 -0800
From:      Amancio Hasty <hasty@rah.star-gate.com>
To:        Steve Passe <smp@csn.net>
Cc:        multimedia@FreeBSD.ORG
Subject:   Re: INTs on the bt848 
Message-ID:  <199703212202.OAA02176@rah.star-gate.com>
In-Reply-To: Your message of "Fri, 21 Mar 1997 14:39:08 MST." <199703212139.OAA25157@Ilsa.StevesCafe.com> 

index | next in thread | previous in thread | raw e-mail

>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




home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703212202.OAA02176>