From owner-freebsd-hackers Thu Nov 12 14:46:58 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA04352 for freebsd-hackers-outgoing; Thu, 12 Nov 1998 14:46:58 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from dingo.cdrom.com (dingo.cdrom.com [204.216.28.145]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA04347 for ; Thu, 12 Nov 1998 14:46:56 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost.cdrom.com [127.0.0.1]) by dingo.cdrom.com (8.9.1/8.8.8) with ESMTP id OAA01308; Thu, 12 Nov 1998 14:44:54 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Message-Id: <199811122244.OAA01308@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Nicolas Souchu cc: Ron Klinkien , freebsd-hackers@FreeBSD.ORG, Marc Bouget Subject: Re: i2c projects In-reply-to: Your message of "Fri, 13 Nov 1998 00:17:48 GMT." <19981113001748.14820@breizh.prism.uvsq.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 12 Nov 1998 14:44:54 -0800 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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