Написал на основе pcf8574 драйвер для ics1523, как для i2c chip.
Получаю ошибку, не могу понять почему
Код
i2c-gpio i2c-gpio: using pins 55 (SDA) and 38 (SCL)
ICS1523 Probe Run
ICS1523 Init Run
ICS1523 Inititialisatio START
Unable to handle kernel NULL pointer dereference at virtual address 00000028
pgd = c0004000
[00000028] *pgd=00000000
Internal error: Oops: 5 [#1]
Modules linked in:
CPU: 0 Not tainted (2.6.27 #705)
PC is at i2c_smbus_write_byte_data+0x10/0x4c
LR is at ics1523_probe+0x64/0x1c4
pc : [<c0163f98>] lr : [<c01677f4>] psr: 60000013
sp : c3819dc8 ip : c3819e10 fp : c3819e0c
r10: 00000000 r9 : 00000000 r8 : 00000000
r7 : c0291888 r6 : c0167790 r5 : c394f2c0 r4 : c395d200
r3 : c0284480 r2 : 00000000 r1 : 00000000 r0 : 00000026
Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
Control: 0005317f Table: 20004000 DAC: 00000017
Process swapper (pid: 1, stack limit = 0xc3818268)
Stack: (0xc3819dc8 to 0xc381a000)
9dc0: c0291888 00000000 00000000 00000000 c3819dfc c3819de8
9de0: c01fa3a8 c0033f28 c395d200 c3819e04 c3819e34 c3819e10 c01677e4 c01fa394
9e00: c3819e34 c3819e10 c01677f4 c0163f98 00000008 c395d220 c395d200 c0167790
9e20: c0291888 00000000 c3819e54 c3819e38 c0163574 c01677a0 00000001 c395d220
9e40: c02918b4 c02918b4 c3819e74 c3819e58 c0121cf4 c0163500 c395d220 c395d2cc
9e60: c02918b4 00000000 c3819e94 c3819e78 c0121df0 c0121c30 c3834298 c02918b4
9e80: c0121da4 00000000 c3819ec4 c3819e98 c012157c c0121db4 c3920ae0 c3834298
9ea0: c3834298 c395d268 c00f5a0c c02918b4 c3920ae0 c0291154 c3819ed4 c3819ec8
9ec0: c0121b38 c012153c c3819f04 c3819ed8 c0120e58 c0121b28 c02614c6 c0015a60
9ee0: c0291888 c02918b4 c0015a60 c0291888 00000000 00000000 c3819f2c c3819f08
9f00: c0121fe4 c0120dc0 00000000 c0291154 c0015a60 c0291888 00000000 00000000
9f20: c3819f4c c3819f30 c0164940 c0121f5c c3818000 c001a140 c0015a60 00000000
9f40: c3819f5c c3819f50 c0015a78 c01648d0 c3819fd4 c3819f60 c001e284 c0015a70
9f60: c3819f8c c3819f70 c00abcb0 c00aba28 c3819f00 c3832260 c00abdb4 0000007f
9f80: c3819fbc c3819f90 c00553b8 c00abc40 c3819fac 00373231 00000000 c0010000
9fa0: 000000c0 c0019f30 00000000 00000000 c3819fd4 c001a140 c0019f30 00000000
9fc0: 00000000 00000000 c3819ff4 c3819fd8 c0008410 c001e240 00000000 00000001
9fe0: 00000000 00000000 00000000 c3819ff8 c0035c34 c00083a4 ffffffff bfbfffbf
Backtrace:
[<c0163f88>] (i2c_smbus_write_byte_data+0x0/0x4c) from [<c01677f4>] (ics1523_probe+0x64/0x1c4)
[<c0167790>] (ics1523_probe+0x0/0x1c4) from [<c0163574>] (i2c_device_probe+0x84/0xa0)
r8:00000000 r7:c0291888 r6:c0167790 r5:c395d200 r4:c395d220
r3:00000008
[<c01634f0>] (i2c_device_probe+0x0/0xa0) from [<c0121cf4>] (driver_probe_device+0xd4/0x184)
r7:c02918b4 r6:c02918b4 r5:c395d220 r4:00000001
[<c0121c20>] (driver_probe_device+0x0/0x184) from [<c0121df0>] (__driver_attach+0x4c/0x70)
r7:00000000 r6:c02918b4 r5:c395d2cc r4:c395d220
[<c0121da4>] (__driver_attach+0x0/0x70) from [<c012157c>] (bus_for_each_dev+0x50/0x80)
r6:00000000 r5:c0121da4 r4:c02918b4 r3:c3834298
[<c012152c>] (bus_for_each_dev+0x0/0x80) from [<c0121b38>] (driver_attach+0x20/0x28)
r6:c0291154 r5:c3920ae0 r4:c02918b4
[<c0121b18>] (driver_attach+0x0/0x28) from [<c0120e58>] (bus_add_driver+0xa8/0x210)
[<c0120db0>] (bus_add_driver+0x0/0x210) from [<c0121fe4>] (driver_register+0x98/0x124)
r8:00000000 r7:00000000 r6:c0291888 r5:c0015a60 r4:c02918b4
[<c0121f4c>] (driver_register+0x0/0x124) from [<c0164940>] (i2c_register_driver+0x80/0xdc)
r8:00000000 r7:00000000 r6:c0291888 r5:c0015a60 r4:c0291154
r3:00000000
[<c01648c0>] (i2c_register_driver+0x0/0xdc) from [<c0015a78>] (ics1523_init+0x18/0x20)
r6:00000000 r5:c0015a60 r4:c001a140 r3:c3818000
[<c0015a60>] (ics1523_init+0x0/0x20) from [<c001e284>] (do_one_initcall+0x54/0x184)
[<c001e230>] (do_one_initcall+0x0/0x184) from [<c0008410>] (kernel_init+0x7c/0xf0)
r8:00000000 r7:00000000 r6:00000000 r5:c0019f30 r4:c001a140
[<c0008394>] (kernel_init+0x0/0xf0) from [<c0035c34>] (do_exit+0x0/0x6e0)
r5:00000000 r4:00000000
Code: e1a0c00d e92dd800 e24cb004 e24dd038 (e1d0e0b2)
---[ end trace 3c912652fab3ebf6 ]---
Kernel panic - not syncing: Attempted to kill init!
Вылетает на строке
i2c_smbus_write_byte_data (ICS_ADDR, ICS_ICR, 0);
Что я делаю не так?