Discussion:
DM368 I2C init
Tauseef Latif
2014-06-30 14:11:18 UTC
Permalink
Hi everyone,
I'm having trouble using the i2c bus on the DM365. This is for a custom
solution, and I'm writing the drivers myself.

Right now I can use i2cget/ i2cdetect function from the terminal and get
values from the bus. But I cannot use i2cset to change anything. The values
themselves seem to be almost static and not changing accordingly (Using a
NXP calendar chip and a accelerometer).

Any help of this will be much appreciated. My code is pasted below.

static struct davinci_i2c_platform_data i2c_pdata = {
.bus_freq = 400 ,//KHz
.bus_delay = 0 , //usec
.sda_pin = 21 , //DM365_I2C_SDA
.scl_pin = 20 , //DM365_I2C_SCL
};

static void __init dm368_bubble_init_i2c(void)
{
davinci_init_i2c(&i2c_pdata);

davinci_cfg_reg(DM365_I2C_SDA);
davinci_cfg_reg(DM365_I2C_SCL);
}
/ # i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- 08 -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- 36 -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- 4c -- -- --
50: -- 51 -- -- -- -- -- -- -- -- -- -- -- UU -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

/ # i2cdump -y 1 0x36 (Calendar chip)

0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: ff ff f6 90 cb 06 00 00 00 02 ff ff 97 00 ff ff ..????...?..?...
10: ff ff ff ff fe 46 ff ff ff ff ff ff ff ff ff ff ....?F..........
......
.....
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://linux.davincidsp.com/pipermail/davinci-linux-open-source/attachments/20140630/568a0412/attachment.html>
Loading...