From owner-freebsd-multimedia Sun Mar 15 06:13:38 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA19284 for freebsd-multimedia-outgoing; Sun, 15 Mar 1998 06:13:38 -0800 (PST) (envelope-from owner-freebsd-multimedia@FreeBSD.ORG) Received: from brane.digs.iafrica.com (brane.digs.iafrica.com [196.7.162.25]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id GAA19276 for ; Sun, 15 Mar 1998 06:13:34 -0800 (PST) (envelope-from iang@digs.iafrica.com) Received: from digs.iafrica.com [127.0.0.1] by brane.digs.iafrica.com with esmtp (Exim 1.71 #1) id 0yEE9R-0000Y8-00; Sun, 15 Mar 1998 16:12:33 +0200 To: Luigi Rizzo cc: Joachim.Wunder@lrz-muenchen.de, rhh@ct.picker.com, multimedia@FreeBSD.ORG Subject: Re: Status on detect fix for Hauppauge FI1236 MK2 Tuner Cards In-reply-to: Your message of "Fri, 06 Mar 1998 12:59:56 +0100." <199803061159.MAA01514@labinfo.iet.unipi.it> X-Attribution: BOFH Date: Sun, 15 Mar 1998 16:12:33 +0200 From: Ian Freislich Message-Id: Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Luigi Rizzo... > there is a small program at http://www.iet.unipi.it/~luigi/txt.c > which i use to control various features of my card, and uses the > I2C commands to fetch Teletext pages from the SAA5246. The command > are very simple. That ioctl won't work (I don't think) because it only supports the following format: MSB LSB | 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 | 0 - read i^2c address Internal reg Data 1 - write I presume that these bytes are just consecutive bytes written onto the serial bus. If we're going to write stuff to the MSP3410 chips we need to get 6 or 4 consecutive byte commands onto the i^2c bus. The following telegrams will need to be supported: write: <80 sa ah al dh dl> <80 sa dh dl> read: <80 sa ah al> <81 dh dl> sa - Sub address (internal part address) ah - Register Address MSB al - Register Address LSB dh - Data MSB dl - Data LSB Reads are done by writing the sub-address and the register address and the readiing two bytes from the device read address. I also don't think that this ioctl() will provide that functionality. If you can write something to get the data onto the bus, I should be able to get it to initialise the chip correctly. I'd propose something like this: ioctl (int, BT848_I2CWR6, u_long *) BT848_I2CWR6 - Write 6 bytes: u_long: MSB 7 - Device address 6 - Not used 5 - Not used 4 - Byte 4 (sa) 3 - Byte 3 (ah) 2 - Byte 2 (al) 1 - Byte 1 (dh) LSB 0 - Byte 0 (dl) The write must terminate with a STOP from the i^2c master. ioctl (int, BT848_I2CWR4, u_long *) BT848_I2CWR4 - Write 4 bytes: u_long: MSB 7 - Device address 6 - Not used 5 - Not used 4 - Not used 3 - Not used 2 - byte 2 (sa) 1 - Byte 1 (dh) LSB 0 - Byte 0 (dl) The write must terminate with a STOP from the i^2c master. ioctl (int, BT848_I2CRD2, u_long *) BT848_I2CRD2 - Read 2 bytes: u_long: MSB 7 - Device address 6 - Byte 2 (sa) 5 - Byte 1 (ah) 4 - byte 0 (al) 3 - Not used 2 - Not used 1 - Byte 1 (dh returned by read) LSB 0 - Byte 0 (dl returned by read) Bytes 6-4 of the u_long are written to the Device address on the i^2c bus followed by a START condition from the master. 2 bytes are read from the device address into bytes 1-0 of the u_long followed by a STOP condition from the master. -- igf (Ian Freislich) http://copernicus.cpt.tech.iafrica.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message