Activate a DS1307 I2C RTC on iMX28

cancel
Showing results for 
Search instead for 
Did you mean: 

Activate a DS1307 I2C RTC on iMX28

Jump to solution
672 Views
g__
Contributor II

We cannot use the embedded RTC at the moment. We added a DS1307. 

The driver is compiled in the build. 

ls -la /lib/modules/3.18.5-fslc\+g483412c/kernel/drivers/rtc/
drwxr-xr-x    2 xxx     xxx          4096 May 18  2017 .
drwxr-xr-x    5 xxx     xxx          4096 May 18  2017 ..
-rw-r--r--    1 xxx     xxx        149499 May 18  2017 rtc-ds1307.ko

The DS1307 is detected : 

i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- 32 -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- ‍‍‍‍‍‍‍‍‍‍

I tried to activate it : 

echo ds1307 0x32 > /sys/class/i2c-dev/i2c-0/dev
sh: can't create /sys/class/i2c-dev/i2c-0/dev: Permission denied

How can I activate it ? 

Thanks

Best

Labels (1)
0 Kudos
1 Solution
408 Views
g__
Contributor II

The filename was incorrect. That's the right one :

echo ds1307 0x32 > /sys/class/i2c-dev/i2c-0/device/new_device

View solution in original post

0 Kudos
1 Reply
409 Views
g__
Contributor II

The filename was incorrect. That's the right one :

echo ds1307 0x32 > /sys/class/i2c-dev/i2c-0/device/new_device

View solution in original post

0 Kudos