OpenWrt Forum Archive

Topic: i2c-gpio-custom on BR6104KP

The content of this topic has been archived on 24 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I am not sure if this is a bug or not :-)

Currently I am using revision 12089 (https://svn.openwrt.org/openwrt/trunk) on an BR6104KP (kernel 2.6.25.12). I can use all  LEDs except the USB leds - but this is not my problem. I have set up i2c via make menuconfig. The relevant parts of .config looks like

/raid5-4/openwrt-040808/trunk> grep -in i2c .config
1042:# I2C support
1044:CONFIG_PACKAGE_kmod-i2c-core=y
1045:CONFIG_PACKAGE_kmod-i2c-algo-bit=y
1046:# CONFIG_PACKAGE_kmod-i2c-algo-pca is not set
1047:# CONFIG_PACKAGE_kmod-i2c-algo-pcf is not set
1048:CONFIG_PACKAGE_kmod-i2c-gpio=y
1049:CONFIG_PACKAGE_kmod-i2c-gpio-custom=y

The kernel module i2c-gpio-custom.ko was build but I am not able to load it without error messages:

root@OpenWrt:~# rmmod  i2c-gpio-custom
root@OpenWrt:~# cd /lib/modules/2.6.25.12
root@OpenWrt:/lib/modules/2.6.25.12# insmod  i2c-gpio-custom.ko bus0=0,1,3

The module is loaded but I got this ugly message
Custom GPIO-based I2C driver version 0.1.0
kobject (80e4f070): tried to init an initialized object, something is seriously wrong.

Call Trace:[<8000781c>][<8000781c>][<800fd0b0>][<80127810>][<8012c94c>][<8012c9f4>]
[<8012c87c>][<80020774>][<c00a1144>][<80020774>][<c00a1000>][<c00a11a0>][<80063d34>]
[<80045920>][<800091f0>]

I have checked the following instructions again and again:
http://linux-adm5120.sourceforge.net/openwrt/i2c/

Any ideas?

Best regards,
Frank

(Last edited by frank-km on 13 Aug 2008, 16:23)

Hi,

frank-km wrote:

I am not sure if this is a bug or not :-)

....

The module is loaded but I got this ugly message
Custom GPIO-based I2C driver version 0.1.0
kobject (80e4f070): tried to init an initialized object, something is seriously wrong.

Call Trace:[<8000781c>][<8000781c>][<800fd0b0>][<80127810>][<8012c94c>][<8012c9f4>]
[<8012c87c>][<80020774>][<c00a1144>][<80020774>][<c00a1000>][<c00a11a0>][<80063d34>]
[<80045920>][<800091f0>]

It was a bug.

Any ideas?

Fixed in r12297.

Regards,
Gabor

Hi Gabor,

Thanks a lot - I will test the patches tomorrow.

Best regards,
Frank

Hi,

I can confirm that the i2c_gpio_custom.ko driver works now perfect:

-------

1. insmod i2c_gpio_custom.ko bus0=0,3,1
Custom GPIO-based I2C driver version 0.1.1

2. insmod i2c_gpio.ko
i2c-gpio i2c-gpio.0: using pins 3 (SDA) and 1 (SCL)

3. (I am using a DS1631, all 3 adress bits grounded)
root@OpenWrt:~# i2cdetect 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x03-0x77.
Continue? [Y/n]
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                         

4. start temperature measurement
root@OpenWrt:~# i2cget 0 0x48 0x51  w
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-0, chip address 0x48, data address
0x51, using read word data.
Continue? [Y/n]
0x000f

5. get the temperature
root@OpenWrt:~# i2cget 0 0x48 0xaa  w
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-0, chip address 0x48, data address
0xaa, using read word data.
Continue? [Y/n]
0x801a

6.Result:
0x801a means 26,50°C. In comparission with an analog Hg thermometer the result is great (26,0 °C)

NOW I AM SURE: It is to hot in my apartement ;-)

Best regards,
Frank

(Last edited by frank-km on 14 Aug 2008, 15:08)

w1-gpio-custom also suffers from the same problem, and requires the same fix.

The discussion might have continued from here.