Date: Thu, 12 Nov 1998 14:44:54 -0800 From: Mike Smith <mike@smith.net.au> To: Nicolas Souchu <nsouch@teaser.fr> Cc: Ron Klinkien <root@zappa.demon.nl>, freebsd-hackers@FreeBSD.ORG, Marc Bouget <mbouget@club-internet.fr> Subject: Re: i2c projects Message-ID: <199811122244.OAA01308@dingo.cdrom.com> In-Reply-To: Your message of "Fri, 13 Nov 1998 00:17:48 GMT." <19981113001748.14820@breizh.prism.uvsq.fr>
next in thread | previous in thread | raw e-mail | index | archive | help
> Now, you want to write user/kernel code? If you need kernel code which is > uncertain, /sys/dev/iicbus/iic.c will be a good start. Read, copy and > modify it as needed. > > For userland code, you'll have to add your devices in /sys/dev/iicbus/iic.c: > > { "iic", IICBUS_DEVICE_CLASS, "MY DEVICE IDENTIFIER", MY_DEVICE_ADDRESS}, > > like this (for each device on you I2C bus): > > /* > * list of known devices > */ > struct iicbus_device iicbus_children[] = { > { "iicsmb", IICBUS_DRIVER_CLASS, "I2C to SMB bridge" }, > { "iic", IICBUS_DEVICE_CLASS, "MY DEVICE IDENTIFIER", MY_DEVICE_ADDRESS}, > { "iic", IICBUS_DEVICE_CLASS, "PCF8574 I2C to 8 bits parallel i/o", 64}, > { "iic", IICBUS_DEVICE_CLASS, "PCF8584 as slave", PCF_MASTER_ADDRESS }, > { "ic", IICBUS_DEVICE_CLASS, "network interface", PCF_MASTER_ADDRESS }, > #if 0 > { "iic", IICBUS_DRIVER_CLASS, "General Call", I2C_GENERAL_CALL }, > #endif > { NULL, 0 } > }; Hmm. Is this just for devices in the kernel? You probably want to make this extensible, eg. with a (de)registration function so that other consumers can register stuff they know about. -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811122244.OAA01308>