public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* i2c Questions
@ 2008-03-27 21:14 badguy development
       [not found] ` <BLU106-W751DECBB6A8A8CAAE3C71B0FE0-MsuGFMq8XAE@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: badguy development @ 2008-03-27 21:14 UTC (permalink / raw)
  To: i2c-GZX6beZjE8VD60Wz+7aTrA


[-- Attachment #1.1: Type: text/plain, Size: 1114 bytes --]


Hello,

 I am creating 2 i2c drivers.

I have started a driver for the LTC1760 
 and that one is working and well under way.

I have to now develop a driver for bus address 0x01
 and in the code I have located that to be an invalid address.

the code tests for address < 0x03 && address > 0x77
then promptly fails with invalid address.

I am hoping to find an understanding for this.
this is a programmable address, and I will have it changed if I have to.

Also, I have 3 i2c busses on this iMX31 SOM

how can I tell my device to only query / operate on a specific bus.
do I need to?

and finally where should a noobie to this i2c stuff be asking questions like this?

Please forward any response to this to my email here:
badguydevelopment-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org

 I am trying to join the list, but have not received confirmation yet.

Thanks ahead of time for your wealth of knowledge.




_________________________________________________________________
Sympatico/MSN Autos wants to put YOU in a 2008 Eclipse! Click here to enter!
http://g.msn.ca/ca55/212

[-- Attachment #1.2: Type: text/html, Size: 1396 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

^ permalink raw reply	[flat|nested] 7+ messages in thread

* i2c Questions
@ 2008-03-27 21:15 badguy development
  0 siblings, 0 replies; 7+ messages in thread
From: badguy development @ 2008-03-27 21:15 UTC (permalink / raw)
  To: i2c-GZX6beZjE8VD60Wz+7aTrA


[-- Attachment #1.1: Type: text/plain, Size: 1098 bytes --]


Hello,

 I am creating 2 i2c drivers.

I have started a driver for the LTC1760 
 and that one is working and well under way.

I have to now develop a driver for bus address 0x01
 and in the code I have located that to be an invalid address.

the code tests for address < 0x03 && address > 0x77
then promptly fails with invalid address.

I am hoping to find an understanding for this.
this is a programmable address, and I will have it changed if I have to.

Also, I have 3 i2c busses on this iMX31 SOM

how can I tell my device to only query / operate on a specific bus.
do I need to?

and finally where should a noobie to this i2c stuff be asking questions like this?

Please forward any response to this to my email here:
badguydevelopment-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org

 I am trying to join the list, but have not received confirmation yet.

Thanks ahead of time for your wealth of knowledge.




_________________________________________________________________
Send a smile, make someone laugh, have some fun!  Start now!
http://g.msn.ca/ca55/208

[-- Attachment #1.2: Type: text/html, Size: 1355 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: i2c Questions
       [not found] ` <BLU106-W751DECBB6A8A8CAAE3C71B0FE0-MsuGFMq8XAE@public.gmane.org>
@ 2008-03-29 22:09   ` Jean Delvare
       [not found]     ` <20080329230927.3b9b47e5-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Jean Delvare @ 2008-03-29 22:09 UTC (permalink / raw)
  To: badguy development; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA

On Thu, 27 Mar 2008 21:14:53 +0000, badguy development wrote:
> 
> Hello,
> 
>  I am creating 2 i2c drivers.
> 
> I have started a driver for the LTC1760 
>  and that one is working and well under way.
> 
> I have to now develop a driver for bus address 0x01
>  and in the code I have located that to be an invalid address.
> 
> the code tests for address < 0x03 && address > 0x77
> then promptly fails with invalid address.
> 
> I am hoping to find an understanding for this.
> this is a programmable address, and I will have it changed if I have to.

Please read the I2C specification. Address 0x01 is for CBUS
compatibility and cannot be used by I2C devices.

> 
> Also, I have 3 i2c busses on this iMX31 SOM
> 
> how can I tell my device to only query / operate on a specific bus.
> do I need to?

The device can only operate on the one bus to which it is connected, so
I can't see any problem here.

> 
> and finally where should a noobie to this i2c stuff be asking questions like this?

This is the right list. It would be nice if you could post under your
real name.

> 
> Please forward any response to this to my email here:
> badguydevelopment-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org
> 
>  I am trying to join the list, but have not received confirmation yet.
> 
> Thanks ahead of time for your wealth of knowledge.

-- 
Jean Delvare

_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: i2c Questions
       [not found]     ` <20080329230927.3b9b47e5-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
@ 2008-03-29 22:58       ` badguy development
       [not found]         ` <BLU106-W27A7B34F7BE0CC6E2D9B94B0F80-MsuGFMq8XAE@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: badguy development @ 2008-03-29 22:58 UTC (permalink / raw)
  To: i2c-GZX6beZjE8VD60Wz+7aTrA


[-- Attachment #1.1: Type: text/plain, Size: 2756 bytes --]




> Date: Sat, 29 Mar 2008 23:09:27 +0100
> From: khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org
> To: badguydevelopment-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org
> CC: i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
> Subject: Re: [i2c] i2c Questions
> 
> On Thu, 27 Mar 2008 21:14:53 +0000, badguy development wrote:
> > 
> > Hello,
> > 
> >  I am creating 2 i2c drivers.
> > 
> > I have started a driver for the LTC1760 
> >  and that one is working and well under way.
> > 
> > I have to now develop a driver for bus address 0x01
> >  and in the code I have located that to be an invalid address.
> > 
> > the code tests for address < 0x03 && address > 0x77
> > then promptly fails with invalid address.
> > 
> > I am hoping to find an understanding for this.
> > this is a programmable address, and I will have it changed if I have to.
> 
> Please read the I2C specification. Address 0x01 is for CBUS
> compatibility and cannot be used by I2C devices.
> 

 Thank you for the CBUS tip, that is what lead me to it in the spec.
 I guess I will have to continue digging to learn why 0x02 is also disallowed.

> > 
> > Also, I have 3 i2c busses on this iMX31 SOM
> > 
> > how can I tell my device to only query / operate on a specific bus.
> > do I need to?
> 
> The device can only operate on the one bus to which it is connected, so
> I can't see any problem here.
> 

 I guess I did not use correct terms there.
  What I meant to ask was: how can I tell my device driver to only query a given bus.
but I also guess that is not necessary, and the first bus to respond on that address will be carrying my device.

> > 
> > and finally where should a noobie to this i2c stuff be asking questions like this?
> 
> This is the right list. It would be nice if you could post under your
> real name.
> 

  Thanks, I currently do not have an email that uses my name, its top secret.
  but I can place my name at the end of my messages.

is this perhaps why I have not recieved confirmation for joining the list?
am I disallowed without an email revealing a more realistic name?

if that is the case I guess I will have to finally create an email account using a name :(

> > 
> > Please forward any response to this to my email here:
> > badguydevelopment-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org
> > 
> >  I am trying to join the list, but have not received confirmation yet.
> > 
> > Thanks ahead of time for your wealth of knowledge.
> 
> -- 
> Jean Delvare

     Christian Hunt


_________________________________________________________________
This Valentine's Day, get creative and show your sweetheart how much you care with flair! Find fun date ideas here!
http://g.msn.ca/ca55/224

[-- Attachment #1.2: Type: text/html, Size: 3322 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: i2c Questions
       [not found]         ` <BLU106-W27A7B34F7BE0CC6E2D9B94B0F80-MsuGFMq8XAE@public.gmane.org>
@ 2008-03-30 11:54           ` Jean Delvare
       [not found]             ` <20080330135409.06f8fd09-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Jean Delvare @ 2008-03-30 11:54 UTC (permalink / raw)
  To: badguy development; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA

Hi Christian,

On Sat, 29 Mar 2008 22:58:43 +0000, badguy development wrote:
> > On Thu, 27 Mar 2008 21:14:53 +0000, badguy development wrote:
> > > I have to now develop a driver for bus address 0x01
> > >  and in the code I have located that to be an invalid address.
> > > 
> > > the code tests for address < 0x03 && address > 0x77
> > > then promptly fails with invalid address.
> > > 
> > > I am hoping to find an understanding for this.
> > > this is a programmable address, and I will have it changed if I have to..
> > 
> > Please read the I2C specification. Address 0x01 is for CBUS
> > compatibility and cannot be used by I2C devices.
> 
>  Thank you for the CBUS tip, that is what lead me to it in the spec.
>  I guess I will have to continue digging to learn why 0x02 is also disallowed.

0x02 is a bit of mystery to me as well, the specification doesn't
prohibit its use completely, but you can only use it for devices that
are compatible with "other protocols" but they don't say which ones.
0x03 is mysterious as well, it's reserved for "future purposes" since
I2C was defined (two dozen years ago.) 0x04-0x07 is for "HS-mode master
code", whatever it is. 0x08 is used frequently as the SMBus slave
address, 0x09-0x0b for battery stuff, and 0x0c for SMBus alert
response. So my advice would be to stay away of the whole 0x00 row. If
you can program the address, 0x10 would be a sane choice I think, if no
other device on your system needs it.

> > > Also, I have 3 i2c busses on this iMX31 SOM
> > > 
> > > how can I tell my device to only query / operate on a specific bus.
> > > do I need to?
> > 
> > The device can only operate on the one bus to which it is connected, so
> > I can't see any problem here.
> > 
> 
>  I guess I did not use correct terms there.
>   What I meant to ask was: how can I tell my device driver to only query a given bus.
> but I also guess that is not necessary, and the first bus to respond on that address will be carrying my device.

Depends on whether you write a legacy i2c driver (with attach_adapter
and detach_client methods) or a new-style one (with probe and remove
methods.)

If you write a legacy i2c driver (discouraged), you'll call i2c_probe()
in your attach_adapter method, and it will call you back only if a
device is found at the specified address(es). If your device can only
live at one address and only one bus has a device responding at this
address, then the driver will only attach to this device on that bus.
If you are unlucky and you have other devices using the same address on
the other buses, you have to add some detection code in your i2c_probe
callback, otherwise your driver will incorrectly attach to the other
devices. This can be very tricky if the devices don't have
identification registers.

If you write a new-style i2c driver (encouraged), you first number your
i2c buses, then you explicitly instantiate the i2c devices on the bus
you know they are connected to. There is no probing or guessing
involved, you just tell "I have device X on I2C bus N at address A" and
you're done. Much cleaner, and faster too.

> > This is the right list. It would be nice if you could post under your
> > real name.
> 
>   Thanks, I currently do not have an email that uses my name, its top secret.
>   but I can place my name at the end of my messages.
> 
> is this perhaps why I have not recieved confirmation for joining the list?
> am I disallowed without an email revealing a more realistic name?

No, mailman isn't smart enough to check this, and even if it was, there
would be no point in doing this... Everyone can read the list archive,
so putting restrictions on who can subscribe to the list would be silly.

I have no idea why your subscription did not work. Please try again.

> if that is the case I guess I will have to finally create an email account using a name :(

As far as I am concerned, it's just a matter of politeness. When I
spend time helping people, I think it's fair that I know their name.
Not to mention that you won't be able to contribute anything to the
kernel without a real name.

-- 
Jean Delvare

_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: i2c Questions
       [not found]             ` <20080330135409.06f8fd09-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
@ 2008-04-03 22:39               ` badguy development
       [not found]                 ` <BLU106-W43B41606462A4205B13FF0B0F70-MsuGFMq8XAE@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: badguy development @ 2008-04-03 22:39 UTC (permalink / raw)
  To: Jean Delvare; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA


[-- Attachment #1.1: Type: text/plain, Size: 5112 bytes --]




> Date: Sun, 30 Mar 2008 13:54:09 +0200
> From: khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org
> To: badguydevelopment-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org
> CC: i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
> Subject: Re: [i2c] i2c Questions
> 
> Hi Christian,
> 
> On Sat, 29 Mar 2008 22:58:43 +0000, badguy development wrote:
> > > On Thu, 27 Mar 2008 21:14:53 +0000, badguy development wrote:
> > > > I have to now develop a driver for bus address 0x01
> > > >  and in the code I have located that to be an invalid address.
> > > > 
> > > > the code tests for address < 0x03 && address > 0x77
> > > > then promptly fails with invalid address.
> > > > 
> > > > I am hoping to find an understanding for this.
> > > > this is a programmable address, and I will have it changed if I have to..
> > > 
> > > Please read the I2C specification. Address 0x01 is for CBUS
> > > compatibility and cannot be used by I2C devices.
> > 
> >  Thank you for the CBUS tip, that is what lead me to it in the spec.
> >  I guess I will have to continue digging to learn why 0x02 is also disallowed.
> 
> 0x02 is a bit of mystery to me as well, the specification doesn't
> prohibit its use completely, but you can only use it for devices that
> are compatible with "other protocols" but they don't say which ones.
> 0x03 is mysterious as well, it's reserved for "future purposes" since
> I2C was defined (two dozen years ago.) 0x04-0x07 is for "HS-mode master
> code", whatever it is. 0x08 is used frequently as the SMBus slave
> address, 0x09-0x0b for battery stuff, and 0x0c for SMBus alert
> response. So my advice would be to stay away of the whole 0x00 row. If
> you can program the address, 0x10 would be a sane choice I think, if no
> other device on your system needs it.
> 

Ok Thanks for the knowledge here.

> > > > Also, I have 3 i2c busses on this iMX31 SOM
> > > > 
> > > > how can I tell my device to only query / operate on a specific bus.
> > > > do I need to?
> > > 
> > > The device can only operate on the one bus to which it is connected, so
> > > I can't see any problem here.
> > > 
> > 
> >  I guess I did not use correct terms there.
> >   What I meant to ask was: how can I tell my device driver to only query a given bus.
> > but I also guess that is not necessary, and the first bus to respond on that address will be carrying my device.
> 
> Depends on whether you write a legacy i2c driver (with attach_adapter
> and detach_client methods) or a new-style one (with probe and remove
> methods.)
> 
> If you write a legacy i2c driver (discouraged), you'll call i2c_probe()
> in your attach_adapter method, and it will call you back only if a
> device is found at the specified address(es). If your device can only
> live at one address and only one bus has a device responding at this
> address, then the driver will only attach to this device on that bus.
> If you are unlucky and you have other devices using the same address on
> the other buses, you have to add some detection code in your i2c_probe
> callback, otherwise your driver will incorrectly attach to the other
> devices. This can be very tricky if the devices don't have
> identification registers.
> 
> If you write a new-style i2c driver (encouraged), you first number your
> i2c buses, then you explicitly instantiate the i2c devices on the bus
> you know they are connected to. There is no probing or guessing
> involved, you just tell "I have device X on I2C bus N at address A" and
> you're done. Much cleaner, and faster too.
> 

Well I now plan to write a new style as soon as my test spike code written using legacy code is working :)
heh, I am using Kernel 2.6.19.2 is the new style available here?
and if so can you recommend some code I can use for an example?

> > > This is the right list. It would be nice if you could post under your
> > > real name.
> > 
> >   Thanks, I currently do not have an email that uses my name, its top secret.
> >   but I can place my name at the end of my messages.
> > 
> > is this perhaps why I have not recieved confirmation for joining the list?
> > am I disallowed without an email revealing a more realistic name?
> 
> No, mailman isn't smart enough to check this, and even if it was, there
> would be no point in doing this... Everyone can read the list archive,
> so putting restrictions on who can subscribe to the list would be silly.
> 
> I have no idea why your subscription did not work. Please try again.
> 
> > if that is the case I guess I will have to finally create an email account using a name :(
> 
> As far as I am concerned, it's just a matter of politeness. When I
> spend time helping people, I think it's fair that I know their name.
> Not to mention that you won't be able to contribute anything to the
> kernel without a real name.
> 
> -- 
> Jean Delvare

Thanks for the help.

      -Christian Hunt

_________________________________________________________________
Turn every day into $1000. Learn more at SignInAndWIN.ca
http://g.msn.ca/ca55/213

[-- Attachment #1.2: Type: text/html, Size: 6027 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: i2c Questions
       [not found]                 ` <BLU106-W43B41606462A4205B13FF0B0F70-MsuGFMq8XAE@public.gmane.org>
@ 2008-04-04  8:16                   ` Jean Delvare
  0 siblings, 0 replies; 7+ messages in thread
From: Jean Delvare @ 2008-04-04  8:16 UTC (permalink / raw)
  To: badguy development; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA

On Thu, 3 Apr 2008 22:39:59 +0000, badguy development wrote:
> Well I now plan to write a new style as soon as my test spike code written using legacy code is working :)
> heh, I am using Kernel 2.6.19.2 is the new style available here?

No, it's not. The infrastructure for new-style i2c drivers was added by
David Brownell in 2.6.22.

-- 
Jean Delvare

_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-04-04  8:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-27 21:14 i2c Questions badguy development
     [not found] ` <BLU106-W751DECBB6A8A8CAAE3C71B0FE0-MsuGFMq8XAE@public.gmane.org>
2008-03-29 22:09   ` Jean Delvare
     [not found]     ` <20080329230927.3b9b47e5-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-03-29 22:58       ` badguy development
     [not found]         ` <BLU106-W27A7B34F7BE0CC6E2D9B94B0F80-MsuGFMq8XAE@public.gmane.org>
2008-03-30 11:54           ` Jean Delvare
     [not found]             ` <20080330135409.06f8fd09-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-04-03 22:39               ` badguy development
     [not found]                 ` <BLU106-W43B41606462A4205B13FF0B0F70-MsuGFMq8XAE@public.gmane.org>
2008-04-04  8:16                   ` Jean Delvare
  -- strict thread matches above, loose matches on Subject: below --
2008-03-27 21:15 badguy development

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox