Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

could need a little bit support with a device-driver

0 views
Skip to first unread message

Joachim Jäckel

unread,
Jan 29, 2000, 3:00:00 AM1/29/00
to freebsd-m...@freebsd.org
Hello,

maybe someone could help me a little bit, to understand the following
(or would correct me, if I'm wrong).

My Miro DC10 Card is build like the following: (I'm currently for the
beginning
only interested in the decoder site)

+---------+ +------------+ +---------+
| Decoder | | JPEG Codec | | Encoder |
| SAA7110 | | ZR36060 | | ADV???? |
+---------+ +------------+ +---------+
| |
+---------------------+
|
+------------+
| PCI Bridge |
| ZR36067 |
+------------+
|
V
----------------PCI-Bus-----------------------------

My "driver" currently detects the PCI-Bridge Processors ID, is mapping
his
registers to a program structure and initializes this structure.

I think to fully initialize the decoder part of the card, I have to
initialize
the decoder chip, too. (The documentation of the PCI-Bridge chip is
saying,
that the chip offers an easy way [the post-office-protocoll] to
communicate
with all clients - but, because the decoder chip itself has an i2c
interface,
I've no idea, how to set the subaddresses for data-transfer to the i2c
interface
of the decoder-chip through the PCI-Bridge-chip.)

Because of that, I think I've to program it similiar to the
i2c-interface of the
bktr-device. Therefore, I need the smbus, iicbus and iicbb (btw. what is
the
"bit-banging"-code?) in my kernel and have to register the i2c code with
the "device_add_child" function etc. etc.
(It seems to me, that I could copy the whole bktr_i2c.c file with only
small
changes to my driver, couldn't I?)

Besides that, I would need some functions in the i2c-area, which would
make my
decoder initialization. Couldn´t I simply add a function with the new
funktionality
and call this new i2c-function from e.g. the ioctl-routine of my
main-driver?
How could I do write to my encoder with a slave-indicator and a
sub-address (bti2c_smb_* functions?)?
(I'll need an interface to the encoder which has also an i2c-interface
in the
future, too. - How could I get the slave-indicator value from the card?
I think
this interface would use the same i2c-code in the driver?)

That are enough questions for the beginning, (I'll have severall in the
future...)
maybe you could help me a little bit, to see a little bit clearer.

Thanks in advance,
--
Joachim...@d.kamp.net -- http://home.kamp.net/home/joachim.jaeckel


To Unsubscribe: send mail to majo...@FreeBSD.org
with "unsubscribe freebsd-multimedia" in the body of the message

Roger Hardiman

unread,
Jan 30, 2000, 3:00:00 AM1/30/00
to Joachim Jäckel, freebsd-m...@freebsd.org
Joachim,

> Because of that, I think I've to program it similiar to the
> i2c-interface of the bktr-device.

I'll explain bit-banging.

The i2c bus uses 2 wires, one for data, one for a clock pulse.

On the bt848 chip, you can write an i2c device address, and
some data to a single register and the bt848 handles the
i2c bus for you.

Alternativly, you can write your own software to drive
the data and clock lines (SDL and SCL) manually,
in which case you output each bit in turn, and handle the
full i2c protocol.
This manual control is called bit-banding.

in the bt848 driver, you can use the bt848 i2c control
for the tuner device, but you need to use bit banging
for the MSP34xx stereo audio decoder as it needs a
protocol unsupported by the bt848's easy i2c register.


Finally, the bktr driver used to do all the i2c control locally to the
driver.
Now it registers both as an i2c hardware provider and an
i2c bus user with the smbus and iicbus code.


Both the old code and the new code are in the driver
(as the driver still compiles on old FreeBSD versions and on NetBSD
and OpenBSD which do not have our smbus and iicbus code)


Good luck

Roger

Joachim Jäckel

unread,
Jan 30, 2000, 3:00:00 AM1/30/00
to freebsd-m...@freebsd.org
Hello again,

I think my last mail was a little bit of nonsens, I saw, that I cannot
use the bktr_i2c.c file like it is. My current problem is to understand,
how I could use the i2c functionality under FreeBSD...

Maybe here's someone who could explain me that a littel bit and could
give me a hand, how to addapt it to my needs? (I know the data, that I
have to send over the i2c-bus to my chips, but how...)

Thanks in advance.

0 new messages