From: David F. <dav...@ya...> - 2005-03-10 03:04:13
|
--- Craig Hughes <cr...@hu...> wrote: > On Mar 8, 2005, at 7:50 PM, David Farrell > wrote: > > > I2C looks disabled, well enough... > > > > I know this was added some time ago but why > are > > there so many I2C devices? > > I think because in theory you could have that > many. > > C I'm a litle confused. In the kernel documentation (dev-interface) it seems to indicate the -0 is the host, not the device. You need ioctl to specify device address. It is only the i2c kernel module i2c-dev that is used right? David. |
From: David F. <dav...@ya...> - 2005-03-10 13:56:24
|
--- Dave Hylands <dhy...@gm...> wrote: > > I think David has it right: There is one > /dev/i2c-? node per i2c *bus* > > and an ioctl is used to select the slave unit > on the bus to connect to. > > If you use the i2c bus the way the lm_sensors > guys do, then you'd have > a device for each unique i2c device on the bus. > That lets you talk > directly to your fan or temperature sensor. What happens if you have two I2C busses? Or a bridge device? There are only 7 bits of address, or is there a separate device for reading and writing? Should the documentation in the kernel define what to do, or lm_sensor guys? I need SMB devices, the scheme doesn't indicate if a device is smb or not. > The i2c-dev interface is a way to access all of > the devices through a > single interface, which is sometimes more > appropriate than creating a > driver for each individual device. > > > I have trivially adjusted my devices to build > only 3 of the nodes since > > that is all I expect to ever need even if I > resort to bitbanging a > > couple with GPIOs > > If you don't use the devices through the /dev > entries, then you don't > need the /dev entries. All the /dev entries do > is provide a name to > major/minor mapping. You only need the ones > that your user mode apps > actually use. > > -- > Dave Hylands > Vancouver, BC, Canada > http://www.DaveHylands.com/ > > |
From: Dave H. <dhy...@gm...> - 2005-03-10 14:37:24
|
> What happens if you have two I2C busses? Or a > bridge device? > > There are only 7 bits of address, or is there a > separate device for reading and writing? From linux-2.6.10gum/Documentation/devices.txt: 89 char I2C bus interface 0 = /dev/i2c-0 First I2C adapter 1 = /dev/i2c-1 Second I2C adapter ... So each i2c bus adapter gets it's own /dev entry. I was mistaken about the lm_sensors (looking at it again). They do eveything through the i2c-dev interface. If you write your own driver for a device, it can be any major/minor you want, alhtough you would probably include a scheme where certain bits of the minor device would be used to indicate which i2c bus the device was located on. > I need SMB devices, the scheme doesn't indicate > if a device is smb or not. Nope - you can mix smb devices and non-smb devices on the same i2c bus. SMB devices are supposed to provide a "Unique Device Identifier" or UDID. There is a mechanism to issue directed "Get UDID" calls. i2c devices that don't support SMBus would presumably not respond or not respond with a well formed response. Presumably your code knows when its talking to one type of device versus the other? Or perhaps you're trying to do something generic? -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |
From: mgross <mar...@th...> - 2005-03-10 15:04:24
|
On Thursday 10 March 2005 05:56, David Farrell wrote: > --- Dave Hylands <dhy...@gm...> wrote: > > > I think David has it right: There is one > > > > /dev/i2c-? node per i2c *bus* > > > > > and an ioctl is used to select the slave unit > > > > on the bus to connect to. > > > > If you use the i2c bus the way the lm_sensors > > guys do, then you'd have > > a device for each unique i2c device on the bus. > > That lets you talk > > directly to your fan or temperature sensor. > > What happens if you have two I2C busses? Or a > bridge device? I don't think you have more than one HW I2C line coming out of the PXA, so unless you write a bit ban driver to do one over a couple of GPIO's you shouldn't wory. However; 1 device node for each bus is the way I read the interface. > > There are only 7 bits of address, or is there a > separate device for reading and writing? > Some I2Cdevices go up to 10 bit addressing. > Should the documentation in the kernel define > what to do, or lm_sensor guys? > The kernel documentation is from the lm-sensor guys, I think its old documentation. Also, the user mode version header file i2c-dev.h, that you need, is not in the kernel code. It is however, in the lm_sensor package.. Also, the question above is a more general, "ho does I2C work" type of question. I'd go to the phillips i2c website for that type of stuff. > I need SMB devices, the scheme doesn't indicate > if a device is smb or not. > SMB is I2C with added protocal, the SMB transport is I2C. > > The i2c-dev interface is a way to access all of > > the devices through a > > single interface, which is sometimes more > > appropriate than creating a > > driver for each individual device. > > > > > I have trivially adjusted my devices to build > > > > only 3 of the nodes since > > > > > that is all I expect to ever need even if I > > > > resort to bitbanging a > > > > > couple with GPIOs > > > > If you don't use the devices through the /dev > > entries, then you don't > > need the /dev entries. All the /dev entries do > > is provide a name to > > major/minor mapping. You only need the ones > > that your user mode apps > > actually use. > > > > -- > > Dave Hylands > > Vancouver, BC, Canada > > http://www.DaveHylands.com/ > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users |
From: David F. <dav...@ya...> - 2005-03-10 14:54:54
|
--- Dave Hylands <dhy...@gm...> wrote: > Presumably your code knows when its talking to > one type of device > versus the other? Or perhaps you're trying to > do something generic? I just want to talk to a smart battery, and occasionally a battery switch and smart charger. I don't want to re-invert the wheel, just follow standards. It just looked like the /dev nodes Craig set up didn't follow the (standard). David. |
From: Craig H. <cr...@hu...> - 2005-03-10 19:57:33
|
On Mar 10, 2005, at 6:54 AM, David Farrell wrote: > It just looked like the /dev nodes > Craig set up didn't follow the (standard). I have to admit I know jack about I2C -- I just copied the creation of those devices from somewhere (I know not where). So what's the consensus on how many device nodes I should create by default? 1? 3 or 4? C |
From: Dave H. <dhy...@gm...> - 2005-03-10 20:44:34
|
Hi Craig, > I have to admit I know jack about I2C -- I just copied the creation of > those devices from somewhere (I know not where). So what's the > consensus on how many device nodes I should create by default? 1? 3 > or 4? If you're talking about device nodes with a major of 89, I'd say that you only need one, the one with a minor of zero. If somebody is savy enough to add a 2nd i2c bus using bit-banged GPIO, they're probably able to figure out how to add the 2nd device :) -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |
From: David F. <dav...@ya...> - 2005-03-10 15:41:33
|
> > > > There are only 7 bits of address, or is there > a > > separate device for reading and writing? > > > > Some I2Cdevices go up to 10 bit addressing. My context was in the number of nodes that Craig created, I'm glad is wasn't 1024. > SMB is I2C with added protocal, the SMB > transport is I2C. For those interesed, maxim has a nice appnote comparing the two. http://www.maxim-c.com/appnotes.cfm/appnote_number/356 David. |
From: David F. <dav...@ya...> - 2005-03-10 16:46:13
|
How is it I cut and paste and miss one character? http://www.maxim-ic.com/appnotes.cfm/appnote_number/356 BTW PXA does not support 10 bit addressing. David. http://www.maxim-ic.com/appnotes.cfm/appnote_number/356 --- David Farrell <dav...@ya...> wrote: > > > > > > > There are only 7 bits of address, or is > there > > a > > > separate device for reading and writing? > > > > > > > Some I2Cdevices go up to 10 bit addressing. > > My context was in the number of nodes that > Craig > created, I'm glad is wasn't 1024. > > > SMB is I2C with added protocal, the SMB > > transport is I2C. > > For those interesed, maxim has a nice appnote > comparing the two. > > http://www.maxim-c.com/appnotes.cfm/appnote_number/356 > > David. > > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT > Products from real users. > Discover which products truly live up to the > hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > |
From: David F. <dav...@ya...> - 2005-03-10 20:50:06
|
--- Dave Hylands <dhy...@gm...> wrote: > Hi Craig, > > > I have to admit I know jack about I2C -- I > just copied the creation of > > those devices from somewhere (I know not > where). So what's the > > consensus on how many device nodes I should > create by default? 1? 3 > > or 4? > > If you're talking about device nodes with a > major of 89, I'd say that > you only need one, the one with a minor of > zero. > > If somebody is savy enough to add a 2nd i2c bus > using bit-banged GPIO, > they're probably able to figure out how to add > the 2nd device :) I think this is right, Although there are some addressable bus extenders which may be nice to give a node since they do create a new bus, I think this is beyond us right now. David. David. |
From: Craig R H. <cr...@gu...> - 2005-03-10 23:21:55
|
David Farrell wrote: DF> > If you're talking about device nodes with a DF> > major of 89, I'd say that DF> > you only need one, the one with a minor of DF> > zero. DF> > DF> > If somebody is savy enough to add a 2nd i2c bus DF> > using bit-banged GPIO, DF> > they're probably able to figure out how to add DF> > the 2nd device :) DF> DF> I think this is right, Although there are some DF> addressable bus extenders which may be nice to DF> give a node since they do create a new bus, I DF> think this is beyond us right now. Done C |
From: albertd <alb...@sy...> - 2005-03-10 04:20:33
|
I think David has it right: There is one /dev/i2c-? node per i2c *bus* and an ioctl is used to select the slave unit on the bus to connect to. I have trivially adjusted my devices to build only 3 of the nodes since that is all I expect to ever need even if I resort to bitbanging a couple with GPIOs Index: sources/device_table.txt =================================================================== --- sources/device_table.txt (revision 422) +++ sources/device_table.txt (working copy) @@ -68,7 +68,7 @@ /dev/ttyS c 666 0 0 4 64 0 1 4 /dev/fb c 640 0 5 29 0 0 32 4 /dev/rfcomm c 666 0 0 216 0 0 1 4 -/dev/i2c- c 666 0 0 89 0 0 1 255 +/dev/i2c- c 666 0 0 89 0 0 1 2 #/dev/ttySA c 666 0 0 204 5 0 1 3 #/dev/psaux c 666 0 0 10 1 0 0 - #/dev/ppp c 666 0 0 108 0 - - - On the side: has anyone got a i2c real time clock they would recommend? I would prefer one with battery backup on a semi-independant board rather than one I would have to build up from components. Albert. David Farrell wrote: >--- Craig Hughes <cr...@hu...> wrote: > > >>On Mar 8, 2005, at 7:50 PM, David Farrell >>wrote: >> >> >> >>>I2C looks disabled, well enough... >>> >>>I know this was added some time ago but why >>> >>> >>are >> >> >>>there so many I2C devices? >>> >>> >>I think because in theory you could have that >>many. >> >>C >> >> > >I'm a litle confused. In the kernel >documentation (dev-interface) it seems to >indicate the -0 is the host, not the device. You >need ioctl to specify device address. It is only >the i2c kernel module i2c-dev that is used right? > >David. > |
From: Dave H. <dhy...@gm...> - 2005-03-10 05:21:58
|
> I think David has it right: There is one /dev/i2c-? node per i2c *bus* > and an ioctl is used to select the slave unit on the bus to connect to. If you use the i2c bus the way the lm_sensors guys do, then you'd have a device for each unique i2c device on the bus. That lets you talk directly to your fan or temperature sensor. The i2c-dev interface is a way to access all of the devices through a single interface, which is sometimes more appropriate than creating a driver for each individual device. > I have trivially adjusted my devices to build only 3 of the nodes since > that is all I expect to ever need even if I resort to bitbanging a > couple with GPIOs If you don't use the devices through the /dev entries, then you don't need the /dev entries. All the /dev entries do is provide a name to major/minor mapping. You only need the ones that your user mode apps actually use. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |