Access 16bits address register in a device through I2C
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
_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c
A message that is not in the archive (sent off-list or not yet received): 56458e0807170913k10adc9k2c479eddbe600fdb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 8 lines · Wen Wang
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.
Quoted 9 lines
So I'm wondering do I miss something or what can I do? Any ideas?
Thanks
Wen_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c
Signature · 8 lines
Ben ([email protected], http://www.fluff.org/) 'a smiley only costs 4 bytes' _______________________________________________ i2c mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/i2c
Hi Wen,
Quoted 1 line · Wen Wang
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
Signature · 2 lines
Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de Pengutronix - Linux Solutions for Science and Industry
_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Guys,
Thank you for your kindly heads up, that really helps me a lot :)
BRs
Wen
Quoted 21 lines · Wolfram Sang
Hi Wen,
Quoted 1 line · Wen Wang
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
Quoted 9 lines
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)iD8DBQFIf3wpD27XaX1/VRsRAjXBAKCx28nzPbkyMx3aN6KNN03jNFIRLwCgiyAL +zHcrnvXfuzWngEpflY5KZg=
=sUwl
-----END PGP SIGNATURE-----
_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c