public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* Access 16bits address register in a device through I2C
@ 2008-07-17 16:13 Wen Wang
       [not found] ` <56458e0807170913k10adc9k2c479eddbe600fdb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Wen Wang @ 2008-07-17 16:13 UTC (permalink / raw)
  To: i2c-GZX6beZjE8VD60Wz+7aTrA


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

Hi all,
I have a problem writing an I2C device driver and would greatly appreciate
if someone could provide some enlightenment.

I'm working on a project needs to access registers with 16bits address
through I2C. But unfortunately I can not find a way to achieve this, cause
it seems that current kernel I2C framework only supports 8bits address
register.

So I'm wondering do I miss something or what can I do? Any ideas?

Thanks
Wen

[-- Attachment #1.2: Type: text/html, Size: 530 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] 4+ messages in thread

* Re: Access 16bits address register in a device through I2C
       [not found] ` <56458e0807170913k10adc9k2c479eddbe600fdb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2008-07-17 16:26   ` Ben Dooks
  2008-07-17 17:06   ` Wolfram Sang
  1 sibling, 0 replies; 4+ messages in thread
From: Ben Dooks @ 2008-07-17 16:26 UTC (permalink / raw)
  To: Wen Wang; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA

On Fri, Jul 18, 2008 at 12:13:30AM +0800, Wen Wang wrote:
> Hi all,
> I have a problem writing an I2C device driver and would greatly appreciate
> if someone could provide some enlightenment.
> 
> I'm working on a project needs to access registers with 16bits address
> through I2C. But unfortunately I can not find a way to achieve this, cause
> it seems that current kernel I2C framework only supports 8bits address
> register.

The easiest way is to create a function that uses a pair of i2c messages,
the first message sends the 16bits of address pointer to the device, the
second one either reads or writes data.
 
> So I'm wondering do I miss something or what can I do? Any ideas?
> 
> Thanks
> Wen

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

-- 
Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

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

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

* Re: Access 16bits address register in a device through I2C
       [not found] ` <56458e0807170913k10adc9k2c479eddbe600fdb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2008-07-17 16:26   ` Ben Dooks
@ 2008-07-17 17:06   ` Wolfram Sang
       [not found]     ` <20080717170649.GD4199-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  1 sibling, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2008-07-17 17:06 UTC (permalink / raw)
  To: Wen Wang; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA


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

Hi Wen,

On Fri, Jul 18, 2008 at 12:13:30AM +0800, Wen Wang wrote:

> So I'm wondering do I miss something or what can I do? Any ideas?

For an example what Ben suggested (2 messages), have a look at the
at24-driver, which just went through the merge-window.

http://article.gmane.org/gmane.linux.drivers.i2c/1661

Check functions 'at24_eeprom_[read|write]' for details.

All the best,

   Wolfram

-- 
  Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 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] 4+ messages in thread

* Re: Access 16bits address register in a device through I2C
       [not found]     ` <20080717170649.GD4199-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2008-07-18  2:51       ` Wen Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Wen Wang @ 2008-07-18  2:51 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA


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

Hi Guys,

Thank you for your kindly heads up, that really helps me a lot :)

BRs
Wen

On Fri, Jul 18, 2008 at 1:06 AM, Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote:

> Hi Wen,
>
> On Fri, Jul 18, 2008 at 12:13:30AM +0800, Wen Wang wrote:
>
> > So I'm wondering do I miss something or what can I do? Any ideas?
>
> For an example what Ben suggested (2 messages), have a look at the
> at24-driver, which just went through the merge-window.
>
> http://article.gmane.org/gmane.linux.drivers.i2c/1661
>
> Check functions 'at24_eeprom_[read|write]' for details.
>
> All the best,
>
>   Wolfram
>
> --
>  Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de
>  Pengutronix - Linux Solutions for Science and Industry
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFIf3wpD27XaX1/VRsRAjXBAKCx28nzPbkyMx3aN6KNN03jNFIRLwCgiyAL
> +zHcrnvXfuzWngEpflY5KZg=
> =sUwl
> -----END PGP SIGNATURE-----
>
>

[-- Attachment #1.2: Type: text/html, Size: 1564 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] 4+ messages in thread

end of thread, other threads:[~2008-07-18  2:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-17 16:13 Access 16bits address register in a device through I2C Wen Wang
     [not found] ` <56458e0807170913k10adc9k2c479eddbe600fdb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-07-17 16:26   ` Ben Dooks
2008-07-17 17:06   ` Wolfram Sang
     [not found]     ` <20080717170649.GD4199-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2008-07-18  2:51       ` Wen Wang

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