Need help on selecting one (and only one) i2c bus
Do I have to use the ignore_range array ?
Once filed, I have nothing to do ?
The device I want to probe/send data to is located on bus i2c-0 and at the adresses 0x00 to 0x15
I guess I have to do:
static unsigned short ignore_range[] = { 0x00, 0x16, 0xff, 0x01, 0x00, 0xff, 0x02, 0x00, 0xff, I2C_CLIENT_END };
Am I right ?
-----Original Message-----
From: khamouma [mailto:[email protected]]
Sent: Monday, March 09, 2009 11:59 AM
To: '[email protected]'
Subject: Need help on selecting one (and only one) i2c bus
Hello everybody,
I'm new on I2C device drivers programming and I'm facing a little problem, I can't find how to select my i2c-0 bus (I have 3 of them: i2c-0, i2c-1 and i2c-2) I'd like my probe function to probe only this bus and ignore the others. I guess I can find the solution with the i2c_address_data structure, but I don't really understand how to use it...
Thanks in advance,
Ayman KHAMOUMA
A message that is not in the archive (sent off-list or not yet received): 000001c9a0c6$bf92af80$b23e81a4-J7BnVcvkGbbQT0dZR+AlfA@public.gmane.org
Hi Ayman,
Quoted 2 lines · Ayman KHAMOUMA
I'm new on I2C device drivers programming and I'm facing a little problem, I can't find how to select my i2c-0 bus (I have 3 of them: i2c-0, i2c-1 and i2c-2) I'd like my probe function to probe only this bus and ignore the others. I guess I can find the solution with the
i2c_address_datastructure, but I don't really understand how to use it...
It would help if you would first tell us what kernel version you are using, what device you are writing a driver for, and what architecture / system type this is all working on.
Quoted 1 line
Do I have to use the
ignore_rangearray ?
ignore_range has gone away long ago. The last kernel that had it was 2.6.12.6, released in late August 2005. Are really you using such an old kernel?
Quoted 3 lines
Once filed, I have nothing to do ?
The device I want to probe/send data to is located on bus i2c-0 and at the adresses
0x00to0x15
I seriously doubt this. Addresses 0x00, 0x01 and 0x02 are very special for I2C, no device can use them. I suspect you are mixing register addresses (the map of which is internal and specific to each device) with device addresses on the bus.
Quoted 4 lines
I guess I have to do:
static unsigned short ignore_range[] = {0x00,0x16,0xff,0x01,0x00,0xff,0x02,0x00,0xff,I2C_CLIENT_END};Am I right ?
No, this is seriously wrong. But I can't tell more without additional information about what you are trying to achieve in the first place.
Signature · 1 line
Jean Delvare
A message that is not in the archive (sent off-list or not yet received): [email protected]
I'm using a 2.6.23.17 kernel for sh4 architecture.
I have to write a driver for an i2c controled audio chip. You are totally right...I was mixing register adresses with device adresses...the only adress I have to use is 0x71 on i2c-0
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jean Delvare
Sent: Tuesday, March 10, 2009 4:31 PM
To: Ayman KHAMOUMA
Cc: [email protected]
Subject: Re: Need help on selecting one (and only one) i2c bus
Hi Ayman,
Quoted 1 line · Ayman KHAMOUMA
I'm new on I2C device drivers programming and I'm facing a little problem,
I can't find how to select my i2c-0 bus (I have 3 of them: i2c-0, i2c-1 and i2c-2) I'd like my probe function to probe only this bus and ignore the others.
Quoted 1 line
I guess I can find the solution with the
i2c_address_datastructure, but I
don't really understand how to use it...
It would help if you would first tell us what kernel version you are using, what device you are writing a driver for, and what architecture / system type this is all working on.
Quoted 1 line
Do I have to use the
ignore_rangearray ?
ignore_range has gone away long ago. The last kernel that had it was 2.6.12.6, released in late August 2005. Are really you using such an old kernel?
Quoted 4 lines
Once filed, I have nothing to do ?
The device I want to probe/send data to is located on bus i2c-0 and at the adresses
0x00to0x15
I seriously doubt this. Addresses 0x00, 0x01 and 0x02 are very special for I2C, no device can use them. I suspect you are mixing register addresses (the map of which is internal and specific to each device) with device addresses on the bus.
Quoted 5 lines
I guess I have to do:
static unsigned short ignore_range[] = {0x00,0x16,0xff,0x01,0x00,0xff,0x02,0x00,0xff,I2C_CLIENT_END};Am I right ?
No, this is seriously wrong. But I can't tell more without additional information about what you are trying to achieve in the first place.
--
Jean Delvare
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html
I forgot to say that I'm using STLinux 2.3
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jean Delvare
Sent: Tuesday, March 10, 2009 4:31 PM
To: Ayman KHAMOUMA
Cc: [email protected]
Subject: Re: Need help on selecting one (and only one) i2c bus
Hi Ayman,
Quoted 1 line · Ayman KHAMOUMA
I'm new on I2C device drivers programming and I'm facing a little problem,
I can't find how to select my i2c-0 bus (I have 3 of them: i2c-0, i2c-1 and i2c-2) I'd like my probe function to probe only this bus and ignore the others.
Quoted 1 line
I guess I can find the solution with the
i2c_address_datastructure, but I
don't really understand how to use it...
It would help if you would first tell us what kernel version you are using, what device you are writing a driver for, and what architecture / system type this is all working on.
Quoted 1 line
Do I have to use the
ignore_rangearray ?
ignore_range has gone away long ago. The last kernel that had it was 2.6.12.6, released in late August 2005. Are really you using such an old kernel?
Quoted 4 lines
Once filed, I have nothing to do ?
The device I want to probe/send data to is located on bus i2c-0 and at the adresses
0x00to0x15
I seriously doubt this. Addresses 0x00, 0x01 and 0x02 are very special for I2C, no device can use them. I suspect you are mixing register addresses (the map of which is internal and specific to each device) with device addresses on the bus.
Quoted 5 lines
I guess I have to do:
static unsigned short ignore_range[] = {0x00,0x16,0xff,0x01,0x00,0xff,0x02,0x00,0xff,I2C_CLIENT_END};Am I right ?
No, this is seriously wrong. But I can't tell more without additional information about what you are trying to achieve in the first place.
--
Jean Delvare
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html
After some researches I guess I have to use the normal_i2c and ignore arrays:
static unsigned short normal_i2c[] = { 0x71, I2C_CLIENT_END}; static unsigned short ignore[] = { 0x01, 0x71, 0x02, 0x71, I2C_CLIENT_END};
static struct i2c_client_address_data addr_data = {
.normal_i2c = normal_i2c,
.ignore = ignore,
};
Int the init function I have to allocate a major to the driver, and than add the I2c driver:i2c_add_driver(&i2c_my_drv);
After doing that, i2c_my_drv.attach_adapter is called.
Which will call (among others) my probe function, in which I call i2c_attach_client.
Am I in the right way ?
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jean Delvare
Sent: Tuesday, March 10, 2009 4:31 PM
To: Ayman KHAMOUMA
Cc: [email protected]
Subject: Re: Need help on selecting one (and only one) i2c bus
Hi Ayman,
Quoted 1 line · Ayman KHAMOUMA
I'm new on I2C device drivers programming and I'm facing a little problem,
I can't find how to select my i2c-0 bus (I have 3 of them: i2c-0, i2c-1 and i2c-2) I'd like my probe function to probe only this bus and ignore the others.
Quoted 1 line
I guess I can find the solution with the
i2c_address_datastructure, but I
don't really understand how to use it...
It would help if you would first tell us what kernel version you are using, what device you are writing a driver for, and what architecture / system type this is all working on.
Quoted 1 line
Do I have to use the
ignore_rangearray ?
ignore_range has gone away long ago. The last kernel that had it was 2.6.12.6, released in late August 2005. Are really you using such an old kernel?
Quoted 4 lines
Once filed, I have nothing to do ?
The device I want to probe/send data to is located on bus i2c-0 and at the adresses
0x00to0x15
I seriously doubt this. Addresses 0x00, 0x01 and 0x02 are very special for I2C, no device can use them. I suspect you are mixing register addresses (the map of which is internal and specific to each device) with device addresses on the bus.
Quoted 5 lines
I guess I have to do:
static unsigned short ignore_range[] = {0x00,0x16,0xff,0x01,0x00,0xff,0x02,0x00,0xff,I2C_CLIENT_END};Am I right ?
No, this is seriously wrong. But I can't tell more without additional information about what you are trying to achieve in the first place.
--
Jean Delvare
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 000301c9a237$e6d3c8f0$b23e81a4-J7BnVcvkGbbQT0dZR+AlfA@public.gmane.org
Hi Ayman,
Quoted 15 lines · Ayman KHAMOUMA
After some researches I guess I have to use the
normal_i2cand ignore arrays:static unsigned short normal_i2c[] = {
0x71,I2C_CLIENT_END}; static unsigned short ignore[] = {0x01,0x71,0x02,0x71,I2C_CLIENT_END};static struct
i2c_client_address_dataaddr_data= {
.normal_i2c =normal_i2c,
.ignore = ignore,
};Int the init function I have to allocate a major to the driver, and than add the I2c driver:
i2c_add_driver(&i2c_my_drv);
Quoted 7 lines
After doing that, i2c_my_drv.attach_adapter is called.
Which will call (among others) my probe function, in which I call
i2c_attach_client.Am I in the right way ?
No. You're using the old, deprecated way to instantiate devices, and you are abusing it (the ignore array wasn't meant to be used the way you do.)
You said you're using kernel 2.6.23.17, it's not brand new, but it's not too old either. At any rate, it already includes the new-style device binding. So, instead of using the old binding model and then fight to get your driver to _not_ attach to improper devices/addresses, you should use the new model and explicitly instantiate your device, so that your driver won't even try to bind to the wrong devices.
I have posted an explanation about how to do this recently:
http://marc.info/?l=linux-i2c&m=123659553713018&w=2
You should convert your driver to a new-style one and use either method 1 or method 2, whichever is easier for you. See the following document for a guide on how to update your code:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=Documentation/i2c/upgrading-clients;hb=HEAD
It's for kernel 2.6.26 and later but it should mostly apply to 2.6.23 too. The only big difference I can think of is that 2.6.23 doesn't have struct i2c_device_id, instead the device driver binding is based on the i2c driver name. I can help you with this if you can't figure it out.
As a side note, the fact that you needed to add buses 1 and 2 to the ignore list suggests that something is wrong with your I2C bus driver. It is rather unlikely that all 3 I2C buses on your system have a device at address 0x71, so your old-style driver shouldn't have instantiated 3 devices. If it did, it strongly suggests that the quick write i2c-core is using to check for the presence of a device at a given address improperly reported success in all cases. You really should check your I2C bus driver and in particular the implementation of 0-byte messages before going further with the device driver.
Signature · 2 lines
Jean Delvare http://khali.linux-fr.org/wishlist.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Thanks a lot Jean,
Well I added bus 1 and 2 to the ignore list because I thought it wat a clean way to do it.
There is nothing at 0x71 of bus 1 and 2.
I just wanted my code to be a "generic" code and to work even if in the future some devices were added in bus 1 et 2.
Thanks again for your help,
Ayman KHAMOUMA
-----Original Message-----
From: Jean Delvare [mailto:[email protected]]
Sent: Wednesday, March 11, 2009 12:23 PM
To: Ayman KHAMOUMA
Cc: [email protected]
Subject: Re: Need help on selecting one (and only one) i2c bus
Hi Ayman,
Quoted 15 lines · Ayman KHAMOUMA
After some researches I guess I have to use the
normal_i2cand ignore arrays:static unsigned short normal_i2c[] = {
0x71,I2C_CLIENT_END}; static unsigned short ignore[] = {0x01,0x71,0x02,0x71,I2C_CLIENT_END};static struct
i2c_client_address_dataaddr_data= {
.normal_i2c =normal_i2c,
.ignore = ignore,
};Int the init function I have to allocate a major to the driver, and than add the I2c driver:
i2c_add_driver(&i2c_my_drv);
Quoted 7 lines
After doing that, i2c_my_drv.attach_adapter is called.
Which will call (among others) my probe function, in which I call
i2c_attach_client.Am I in the right way ?
No. You're using the old, deprecated way to instantiate devices, and you are abusing it (the ignore array wasn't meant to be used the way you do.)
You said you're using kernel 2.6.23.17, it's not brand new, but it's not too old either. At any rate, it already includes the new-style device binding. So, instead of using the old binding model and then fight to get your driver to _not_ attach to improper devices/addresses, you should use the new model and explicitly instantiate your device, so that your driver won't even try to bind to the wrong devices.
I have posted an explanation about how to do this recently:
http://marc.info/?l=linux-i2c&m=123659553713018&w=2
You should convert your driver to a new-style one and use either method 1 or method 2, whichever is easier for you. See the following document for a guide on how to update your code:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plai
n;f=Documentation/i2c/upgrading-clients;hb=HEAD
It's for kernel 2.6.26 and later but it should mostly apply to 2.6.23 too. The only big difference I can think of is that 2.6.23 doesn't have struct i2c_device_id, instead the device driver binding is based on the i2c driver name. I can help you with this if you can't figure it out.
As a side note, the fact that you needed to add buses 1 and 2 to the ignore list suggests that something is wrong with your I2C bus driver. It is rather unlikely that all 3 I2C buses on your system have a device at address 0x71, so your old-style driver shouldn't have instantiated 3 devices. If it did, it strongly suggests that the quick write i2c-core is using to check for the presence of a device at a given address improperly reported success in all cases. You really should check your I2C bus driver and in particular the implementation of 0-byte messages before going further with the device driver.
--
Jean Delvare
http://khali.linux-fr.org/wishlist.html
It's me again...
In I2c.h I found:
/* Mainboard arch_initcall() code should register all its I2C devices.
* This is done at arch_initcall time, before declaring any i2c adapters.
* Modules for add-on boards must use other calls.
*/
extern inti2c_register_board_info(int busnum, struct i2c_board_info const *info, unsigned n);
I guess I have to call this function near the arch_initcall().
I greped my folder for arch_initcall() but couldn't figure out witch file to use...
Any idea ?
Another thing, what would be the equivalent of MODULE_DEVICE_TABLE(i2c, example_idtable);
As you said, the i2c_device_id structure doesn't exist in this kernel...
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jean Delvare
Sent: Wednesday, March 11, 2009 12:23 PM
To: Ayman KHAMOUMA
Cc: [email protected]
Subject: Re: Need help on selecting one (and only one) i2c bus
Hi Ayman,
Quoted 15 lines · Ayman KHAMOUMA
After some researches I guess I have to use the
normal_i2cand ignore arrays:static unsigned short normal_i2c[] = {
0x71,I2C_CLIENT_END}; static unsigned short ignore[] = {0x01,0x71,0x02,0x71,I2C_CLIENT_END};static struct
i2c_client_address_dataaddr_data= {
.normal_i2c =normal_i2c,
.ignore = ignore,
};Int the init function I have to allocate a major to the driver, and than add the I2c driver:
i2c_add_driver(&i2c_my_drv);
Quoted 7 lines
After doing that, i2c_my_drv.attach_adapter is called.
Which will call (among others) my probe function, in which I call
i2c_attach_client.Am I in the right way ?
No. You're using the old, deprecated way to instantiate devices, and you are abusing it (the ignore array wasn't meant to be used the way you do.)
You said you're using kernel 2.6.23.17, it's not brand new, but it's not too old either. At any rate, it already includes the new-style device binding. So, instead of using the old binding model and then fight to get your driver to _not_ attach to improper devices/addresses, you should use the new model and explicitly instantiate your device, so that your driver won't even try to bind to the wrong devices.
I have posted an explanation about how to do this recently:
http://marc.info/?l=linux-i2c&m=123659553713018&w=2
You should convert your driver to a new-style one and use either method 1 or method 2, whichever is easier for you. See the following document for a guide on how to update your code:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plai
n;f=Documentation/i2c/upgrading-clients;hb=HEAD
It's for kernel 2.6.26 and later but it should mostly apply to 2.6.23 too. The only big difference I can think of is that 2.6.23 doesn't have struct i2c_device_id, instead the device driver binding is based on the i2c driver name. I can help you with this if you can't figure it out.
As a side note, the fact that you needed to add buses 1 and 2 to the ignore list suggests that something is wrong with your I2C bus driver. It is rather unlikely that all 3 I2C buses on your system have a device at address 0x71, so your old-style driver shouldn't have instantiated 3 devices. If it did, it strongly suggests that the quick write i2c-core is using to check for the presence of a device at a given address improperly reported success in all cases. You really should check your I2C bus driver and in particular the implementation of 0-byte messages before going further with the device driver.
--
Jean Delvare
http://khali.linux-fr.org/wishlist.html
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 001301c9a269$ab95d940$b23e81a4-J7BnVcvkGbbQT0dZR+AlfA@public.gmane.org
Hi Ayman,
Quoted 9 lines · Ayman KHAMOUMA
It's me again...
In
I2c.hI found:/* Mainboard
arch_initcall()code should register all its I2C devices.
* This is done atarch_initcalltime, before declaring any i2c adapters.
* Modules for add-on boards must use other calls.
*/
Quoted 8 lines
extern int
i2c_register_board_info(int busnum, struct i2c_board_info const *info, unsigned n);I guess I have to call this function near the
arch_initcall().
I greped my folder forarch_initcall()but couldn't figure out witch file to use...
Any idea ?
I'm not much into embedded architectures, and I suspect it depends on the architecture. Looking at the latest kernel tree I see this function is called only in machine or platform initialization files, for example:
arch/arm/mach-pxa/cm-x300.c: i2c_register_board_info(0, cm_x300_gpio_ext_info,arch/arm/mach-rpc/riscpc.c: i2c_register_board_info(0, &i2c_rtc, 1);arch/arm/mach-s3c6410/mach-smdk6410.c: i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));arch/arm/mach-s3c6410/mach-smdk6410.c: i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));arch/arm/plat-omap/i2c.c: err = i2c_register_board_info(bus_id, info, len);arch/arm/mach-s3c2440/mach-osiris.c: i2c_register_board_info(0, osiris_i2c_devs,arch/arm/mach-s3c2440/mach-anubis.c: i2c_register_board_info(0, anubis_i2c_devs,arch/arm/mach-ep93xx/core.c: i2c_register_board_info(0, devices, num);
I can't tell more without knowing which architecture and machine or platform you're working on. And maybe the question would be better asked to someone who is familiar with the architecture in question.
Quoted 3 lines
Another thing, what would be the equivalent of
MODULE_DEVICE_TABLE(i2c, example_idtable);
As you said, thei2c_device_idstructure doesn't exist in this kernel...
There is no equivalent, just omit this part.
Signature · 2 lines
Jean Delvare http://khali.linux-fr.org/wishlist.html
I2c message at init time
In reply to a message not in the archiveHi everybody,
I'm coming back here for a new problem...
I can't find out how to send i2c messages at init time (setup.c) I need to send some commands via i2c in order to make my hdd work I tried to write it as an i2c driver at init time, but it doesn't seem to work (smbus_write_byte_data returns -1... But it works in my "normal" modules)
Any idea ?
Here is what I'm doing:
static int __init device_init(void)
{
unsigned sysconf;
int ret;
struct stpio_pin *pin;
stx7100_configure_sata();
stx7100_configure_pwm(&pwm_private_info);
stx7100_configure_ssc(&ssc_private_info);
stx7100_configure_usb();
stx7100_configure_lirc(&lirc_scd);
stx7100_configure_pata(3, 1, IRL0_IRQ);
//vpp_pio = stpio_request_set_pin(2, 7, "flash_VPP", STPIO_OUT, 0);
phy_reset_pin = stpio_request_set_pin(3, 7, "ste100p_reset",
STPIO_OUT, 1);
stx7100_configure_ethernet(0, 0, 0);
ret = platform_add_devices(mtv7109_devices,ARRAY_SIZE(mtv7109_devices));
//this is the driver I added:
i2c_add_driver(&i2c_MTV7109PioExp_driver);
pin = stpio_request_pin(2,5, "ATAPWR", STPIO_OUT);/* reset ATAPI pin */
stpio_set_pin(pin, 1);
udelay(10);
stpio_set_pin(pin, 0);
udelay(10);
stpio_set_pin(pin, 1);
udelay(10);
stpio_free_pin(pin);
//ret = platform_add_devices(mtv7109_devices,ARRAY_SIZE(mtv7109_devices));
//i2c_add_driver(&i2c_MTV7109PioExp_driver);
return ret;
}device_initcall(device_init);
A message that is not in the archive (sent off-list or not yet received): 000201c9ac6b$34a95300$2d3f81a4-J7BnVcvkGbbQT0dZR+AlfA@public.gmane.org
Re: I2c message at init time
Quoted 3 lines · Ayman KHAMOUMA
Hi everybody,
I'm coming back here for a new problem...
New problem -> new discussion thread, please.
Signature · 1 line
Jean Delvare
A message that is not in the archive (sent off-list or not yet received): [email protected]
RE: I2c message at init time
Oh sorry !
I don't know how to do that, I thought changing the subject of the mail would do it...
How can I open a new discussion thread ?
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jean Delvare
Sent: Tuesday, March 24, 2009 4:52 PM
To: Ayman KHAMOUMA
Cc: [email protected]
Subject: Re: I2c message at init time
Quoted 3 lines · Ayman KHAMOUMA
Hi everybody,
I'm coming back here for a new problem...
New problem -> new discussion thread, please.
--
Jean Delvare
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): fd6b62c10903102327u426a4262meeabe2c581d7107b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 13 lines · 伊泽
hi Jean,
As you said,i2c address
0x00is not allowed for common i2c slave device,it is reserved as broadcast address.Unfortunately,our project has a sensor cy8c201a0 on i2c-bus,it use0x00address.We met much phone hang problem with i2c,errors such as "waiting for bus free" or "exhausted retries" are all with this sensor.
I guess when master would try to address this senosr,it infact send a broadcast address,that may cause problem easily,every slave device would have a chance to pull down the bus line.
Quoted 7 lines
Now, as the signal show,the ACk signal is too too long in hard-ware,that cause the the i2c-bus unit busy,which block the other i2c operation.
I am trying to re-configure i2c-unit as gpio-mode,and set high/low level manually as a workround.
Any good suggestion to solve this issue?
Yeah, switch to hardware which respects the I2C standard.
Signature · 1 line
Jean Delvare
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 3 lines · 伊泽
Quoted 3 lines
As you said,i2c address
0x00is not allowed for common i2c slave device,it is reserved as broadcast address.Unfortunately,our project has a sensor cy8c201a0 on i2c-bus,it use0x00address.
Not true. You need to provide a firmware for that device and this firmware selects the I2C slave address. Read the datasheet again.
(page 5):
"The I2C address is programmable during configuration. It can be locked to prevent accidental change by setting a flag in a config-uration register."
Quoted 2 lines
Quoted 2 lines
We met much phone hang problem with i2c,errors such as "waiting for bus free" or "exhausted retries" are all with this sensor.
Same reason. Without a firmware, the chips does not have its I2C core set up and hence it's blocking SDA and/or SCL.
Daniel
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): fd6b62c10903110319w1eebd2ebs4b83e7d1247f1678-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 10 lines · 伊泽
Quoted 2 lines
Not true. You need to provide a firmware for that device and this firmware selects the I2C slave address. Read the datasheet again.
Thanks Jean, daniel,
Yeah, the capsensor has the function to re-program its own slave address ,we did try that already. If programmed with other address, only coming out data "0".
Quoted 5 lines
The capsensor with
0x00can also work with correct data,except the phone hang problem.I really be confused, when i2c bus unit is blocked by some slave device, is it necessary to control the scl/sda by GPIO mode operation?
You need to have a master to the bus. Whether that is done by GPIO bit-banging or with a real hardware module in some kind of processor or peripheral device is up to you. You won't even see the difference from the Linux API as long as your bus master is supported.
Quoted 4 lines
Quoted 4 lines
"The I2C address is programmable during configuration. It can be locked to prevent accidental change by setting a flag in a config-uration register."
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
We met much phone hang problem with i2c,errors such as "waiting for bus free" or "exhausted retries" are all with this sensor.
Same reason. Without a firmware, the chips does not have its I2C core set up and hence it's blocking SDA and/or SCL.
I think we have the firmware, and the chips have its i2c-core set up already,any other situation which the device block the SDA / SCL ?
Every device connected to the bus can probably block it. If that happens, you need to find out why (this implies at least using a soldering iron and an oscilloscope). But as long as you're not sure whether you have 'the firmware' or not, I'm confident nobody on this list can help you with that.
Daniel