BleakHouse
Posts: 9
Joined: Mon Feb 18, 2013 12:12 am

synaptics rmi4-i2c, driver doesn't load

Wed Mar 13, 2019 11:03 pm

I am trying to get a touchscreen to work on my Pi3. It has a Synaptics S7501B chip on it. I have not been able to find much information on it, but I believe it uses i2c as it's interface. I have it connected to the pi and i2cdetect sees it at address 0x20. I have written a device tree overlay and compiled a kernel with rmi4-i2c support enabled (actually I enabled all rmi4 drivers).

This is my dts file

Code: Select all

/dts-v1/;
/plugin/;

/{
    compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709";

    [email protected]{
          target = <&i2c_arm>;
          __overlay__{
             #address-cells = <1>;
             #size-cells = <0>;
             status = "okay";

                [email protected] {
                        compatible = "syna,rmi4-i2c";
                        reg = <0x20>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        interrupt-parent = <&gpio>;
                        interrupts = <4 2>;

                        [email protected] {
                                reg = <0x1>;
                                syna,nosleep-mode = <1>;
                        };

                        [email protected] {
                                reg = <0x11>;
                                touchscreen-inverted-y;
                                syna,sensor-type = <1>;
                        };
                };
            };
        };
};
I put "dtoverlay=rmi4-i2c01" in /boot/config.txt where "rmi4-i2c01.dtbo" is the filename in /boot/overlays.

I can see activity on SCL, SDA with my o-scope when I run i2cdetect, but none when booting.

VC debug log shows:

Code: Select all

[email protected]:~ $ sudo vcdbg log msg |& grep -v -E "(HDMI|gpioman)"
001220.675: brfs: File read: /mfs/sd/config.txt
001221.648: brfs: File read: 1807 bytes
001275.948: brfs: File read: /mfs/sd/config.txt
001561.278: *** Restart logging
001561.344: brfs: File read: 1807 bytes
001562.843: brfs: File read: /mfs/sd/cmdline.txt
001562.938: Read command line from file 'cmdline.txt':
001563.001: 'dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=7ec8d85c-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait'
001563.313: brfs: File read: 142 bytes
001923.863: brfs: File read: /mfs/sd/kernel7.img
001923.924: Loading 'kernel7.img' to 0x8000 size 0x500e90
001928.318: No kernel trailer - assuming DT-capable
001928.394: Trying Device Tree file 'bcm2710-rpi-3-b.dtb'
001928.455: brfs: File read: 5246608 bytes
001932.056: brfs: File read: /mfs/sd/bcm2710-rpi-3-b.dtb
001932.135: Loading 'bcm2710-rpi-3-b.dtb' to 0x508e90 size 0x637d
001950.239: dtdebug: delete_node(/__local_fixups__)
001960.325: dtdebug: /aliases:i2c_vc=i2c0
001970.392: dtdebug: /__symbols__:i2c_vc=i2c0
001977.935: dtdebug: /__overrides__:i2c_vc=i2c0
001992.446: dtdebug: /__overrides__:i2c_vc_baudrate=i2c0_baudrate
001996.978: dtdebug: /aliases:i2c=i2c1
002007.234: dtdebug: /__symbols__:i2c=i2c1
002014.868: dtdebug: /__overrides__:i2c=i2c1
002019.426: dtdebug: /aliases:i2c_arm=i2c1
002029.999: dtdebug: /__symbols__:i2c_arm=i2c1
002037.671: dtdebug: /__overrides__:i2c_arm=i2c1
002052.441: dtdebug: /__overrides__:i2c_baudrate=i2c1_baudrate
002067.178: dtdebug: /__overrides__:i2c_arm_baudrate=i2c1_baudrate
002067.211: dtparam: uart0_clkrate=48000000
002072.791: dtdebug: /__overrides__ has no uart0_clkrate property
002072.805: Unknown dtparam 'uart0_clkrate' - ignored
002072.870: brfs: File read: 25469 bytes
002074.942: brfs: File read: /mfs/sd/config.txt
002075.530: dtparam: i2c_arm=on
002080.785: dtdebug: Found override i2c_arm
002080.820: dtdebug:   override i2c_arm: string target 'status'
002092.506: dtparam: audio=on
002097.914: dtdebug: Found override audio
002097.950: dtdebug:   override audio: string target 'status'
002111.752: brfs: File read: 1807 bytes
002122.185: dtdebug: Opened overlay file 'overlays/rmi4-i2c01.dtbo'
002122.754: brfs: File read: /mfs/sd/overlays/rmi4-i2c01.dtbo
002134.206: Loaded overlay 'rmi4-i2c01'
002134.286: dtdebug: Found fragment 0 (offset 72)
002149.494: dtdebug: merge_fragment(/soc/[email protected],/[email protected]/__overlay__)
002149.520: dtdebug:   +prop(#address-cells)
002151.190: dtdebug:   +prop(#size-cells)
002152.878: dtdebug:   +prop(status)
002161.618: dtdebug: merge_fragment(/soc/[email protected]/[email protected],/[email protected]/__overlay__/[email protected])
002161.648: dtdebug:   +prop(compatible)
002163.280: dtdebug:   +prop(reg)
002165.012: dtdebug:   +prop(#address-cells)
002166.676: dtdebug:   +prop(#size-cells)
002168.357: dtdebug:   +prop(interrupt-parent)
002170.042: dtdebug:   +prop(interrupts)
002178.950: dtdebug: merge_fragment(/soc/[email protected]/[email protected]/[email protected],/[email protected]/__overlay__/[email protected]/[email protected])
002178.978: dtdebug:   +prop(reg)
002180.689: dtdebug:   +prop(syna,nosleep-mode)
002182.975: dtdebug: merge_fragment() end
002190.186: dtdebug: merge_fragment(/soc/[email protected]/[email protected]/[email protected],/fragm[email protected]/__overlay__/[email protected]/[email protected])
002190.212: dtdebug:   +prop(reg)
002191.931: dtdebug:   +prop(touchscreen-inverted-y)
002194.235: dtdebug:   +prop(syna,sensor-type)
002196.569: dtdebug: merge_fragment() end
002196.598: dtdebug: merge_fragment() end
002196.666: dtdebug: merge_fragment() end
002208.861: dtparam: uart1=off
002214.299: dtdebug: Found override uart1
002214.333: dtdebug:   override uart1: string target 'status'
003198.502: dtparam: cam0-pwdn-ctrl=23
003203.942: dtdebug: Found override cam0-pwdn-ctrl
003203.964: dtparam: cam0-pwdn=5
003209.393: dtdebug: Found override cam0-pwdn
003221.180: dtparam: cam0-led-ctrl=23
003226.632: dtdebug: Found override cam0-led-ctrl
003226.653: dtparam: cam0-led=6
003232.142: dtdebug: Found override cam0-led
003232.249: dtparam: arm_freq=1200000000
003237.917: dtdebug: Found override arm_freq
003237.967: dtdebug:   override arm_freq: cell target clock-frequency @ offset 0 (size 4)
003253.760: dtdebug:   override arm_freq: cell target clock-frequency @ offset 0 (size 4)
003269.704: dtdebug:   override arm_freq: cell target clock-frequency @ offset 0 (size 4)
003285.697: dtdebug:   override arm_freq: cell target clock-frequency @ offset 0 (size 4)
003302.056: dtparam: core_freq=400000000
003307.808: dtdebug: /__overrides__ has no core_freq property
003307.822: Unknown dtparam 'core_freq' - ignored
003320.612: dtdebug: delete_node(/hat)
003334.517: Device tree loaded to 0x2eff9700 (size 0x68ca)
004805.643: vchiq_core: vchiq_init_state: slot_zero = 0xfac80000, is_master = 1
004816.575: TV service:host side not connected, dropping notification 0x00000002, 0x00000001, 0x00000010
008888.074: camsubs: Looking for camera 0: i2c_port = 0, led gpio = 134, power enable gpio = 133
009188.863: camsubs: Camera not found
009188.946: camsubs: Looking for camera 0: i2c_port = 0, led gpio = 134, power enable gpio = 133
009489.714: camsubs: Camera not found
009489.792: camsubs: Looking for camera 0: i2c_port = 0, led gpio = 134, power enable gpio = 133
009490.562: camsubs: Camera not found
009490.641: camsubs: Looking for camera 0: i2c_port = 0, led gpio = 134, power enable gpio = 133
009491.398: camsubs: Camera not found
009491.473: camsubs: Looking for camera 0: i2c_port = 0, led gpio = 134, power enable gpio = 133
009492.237: camsubs: Camera not found
So it's reading the dtbo file but not loading any driver.

After using dtoyerlay to manually load the overlay I get:

Code: Select all

[email protected]:~ $ sudo dtoverlay rmi4-i2c01
[email protected]:~ $ sudo journalctl --all --this-boot --no-pager -o verbose | grep -i i2c
    MESSAGE=i2c /dev entries driver
    MESSAGE=Inserted module 'i2c_dev'
    MESSAGE=Reading rules file: /lib/udev/rules.d/15-i2c-modprobe.rules
    MESSAGE=Reading rules file: /lib/udev/rules.d/60-i2c-tools.rules
    MESSAGE=Reading rules file: /etc/udev/rules.d/90-i2c.rules
    MESSAGE=Execute 'load' 'of:Ni2cT<NULL>Cbrcm,bcm2835-i2c'
    MESSAGE=Inserted 'i2c_bcm2835'
    MESSAGE=starting '/usr/lib/raspberrypi-sys-mods/i2cprobe'
    MESSAGE=      pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/dtoverlay rmi4-i2c01
    _CMDLINE=sudo dtoverlay rmi4-i2c01
    _CMDLINE=sudo dtoverlay rmi4-i2c01
    _CMDLINE=sudo dtoverlay rmi4-i2c01
    MESSAGE=      pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/dtoverlay -r rmi4-i2c01
    _CMDLINE=sudo dtoverlay -r rmi4-i2c01
    _CMDLINE=sudo dtoverlay -r rmi4-i2c01
    _CMDLINE=sudo dtoverlay -r rmi4-i2c01
    MESSAGE=      pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/dtoverlay rmi4-i2c01
    _CMDLINE=sudo dtoverlay rmi4-i2c01
    _CMDLINE=sudo dtoverlay rmi4-i2c01
    _CMDLINE=sudo dtoverlay rmi4-i2c01
Still no driver loaded.
Anyone have any ideas?

Dan

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6907
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: synaptics rmi4-i2c, driver doesn't load

Thu Mar 14, 2019 9:17 am

Have you built the driver? If you check the defconfigs then RMI4_CORE is not set, therefore neither are RMI4_I2C, RMI4_SPI, RMI4_SMB, nor any of the other options for RMI4 drivers.
Whilst you may have the DT side correct to configure the driver, it won't do anything if the driver isn't there.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2228
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: synaptics rmi4-i2c, driver doesn't load

Thu Mar 14, 2019 9:58 am

I have written a device tree overlay and compiled a kernel with rmi4-i2c support enabled (actually I enabled all rmi4 drivers).
Assuming this is true, have you updated the aliases file?

Code: Select all

$ grep rmi4 /lib/modules/`uname -r`/modules.alias

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6907
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: synaptics rmi4-i2c, driver doesn't load

Thu Mar 14, 2019 10:05 am

PhilE wrote:
Thu Mar 14, 2019 9:58 am
I have written a device tree overlay and compiled a kernel with rmi4-i2c support enabled (actually I enabled all rmi4 drivers).
Assuming this is true, have you updated the aliases file?

Code: Select all

$ grep rmi4 /lib/modules/`uname -r`/modules.alias
Oops, my bad, I hadn't noticed the comment of the recompiled kernel.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

BleakHouse
Posts: 9
Joined: Mon Feb 18, 2013 12:12 am

Re: synaptics rmi4-i2c, driver doesn't load

Thu Mar 14, 2019 12:18 pm

Assuming this is true, have you updated the aliases file?

Code: Select all

$ grep rmi4 /lib/modules/`uname -r`/modules.alias
Did not return anything, so apparently not.
I have no idea how to do that.

Dan

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2228
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: synaptics rmi4-i2c, driver doesn't load

Thu Mar 14, 2019 1:44 pm

The easy way on a running system is to type "sudo depmod". There are parameters that specify root directories, kernel versions, etc., but the default is to work in /lib/modules/<current-version>. Afterwards, run the grep again to confirm the update has had the desired effect.

BleakHouse
Posts: 9
Joined: Mon Feb 18, 2013 12:12 am

Re: synaptics rmi4-i2c, driver doesn't load

Thu Mar 14, 2019 1:55 pm

I have already run sudo depmod with no effect. The grep still returns nothing.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6907
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: synaptics rmi4-i2c, driver doesn't load

Thu Mar 14, 2019 2:01 pm

Have you checked the config on the live system to see that it includes RMI4_CORE? "sudo modprobe configs" "zcat /proc/config.gz | grep RMI4"

Have you got the relevant modules in /lib/modules/<current-version>/kernel/driver/input/rmi4 ?
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

BleakHouse
Posts: 9
Joined: Mon Feb 18, 2013 12:12 am

Re: synaptics rmi4-i2c, driver doesn't load

Thu Mar 14, 2019 2:17 pm

Code: Select all

 zcat /proc/config.gz | grep RMI4
 CONFIG_RMI4_CORE is not set
"/lib/modules/4.19.27-v7+/kernel/drivers/input" does not contain a rmi4 directory.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2228
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: synaptics rmi4-i2c, driver doesn't load

Thu Mar 14, 2019 2:19 pm

It sounds like your build was incomplete. Did you follow the instructions here?

BleakHouse
Posts: 9
Joined: Mon Feb 18, 2013 12:12 am

Re: synaptics rmi4-i2c, driver doesn't load

Thu Mar 14, 2019 2:23 pm

Yes, I am doing it again right now.

BleakHouse
Posts: 9
Joined: Mon Feb 18, 2013 12:12 am

Re: synaptics rmi4-i2c, driver doesn't load

Thu Mar 14, 2019 3:08 pm

Code: Select all

 grep rmi4 /lib/modules/`uname -r`/modules.alias
Returns nothing.

Code: Select all

[email protected]:~ $ sudo modprobe configs
[email protected]:~ $ zcat /proc/config.gz | grep RMI4
CONFIG_RMI4_CORE=y
CONFIG_RMI4_I2C=y
CONFIG_RMI4_SPI=y
CONFIG_RMI4_SMB=y
CONFIG_RMI4_F03=y
CONFIG_RMI4_F03_SERIO=y
CONFIG_RMI4_2D_SENSOR=y
CONFIG_RMI4_F11=y
CONFIG_RMI4_F12=y
CONFIG_RMI4_F30=y
CONFIG_RMI4_F34=y
CONFIG_RMI4_F55=y

Code: Select all

dmesg | grep i2c
[    2.975994] i2c /dev entries driver
[    5.468215] rmi4_i2c 1-0020: 1-0020 supply vdd not found, using dummy regulator
[    5.468324] rmi4_i2c 1-0020: Linked as a consumer to regulator.0
[    5.468341] rmi4_i2c 1-0020: 1-0020 supply vio not found, using dummy regulator
[    5.492512] rmi4_i2c 1-0020: rmi_set_page: set page failed: -121.
[    5.492528] rmi4_i2c 1-0020: Failed to set page select to 0
[    5.492712] rmi4_i2c: probe of 1-0020 failed with error -121
Still have problems but moving ahead.

I was following the directions you indicated but made a mistake when I followed:
"configure your kernel in more detail "
did "make menuconfig"
and then "make bcm2709_defconfig" which overwrites .config.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6907
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: synaptics rmi4-i2c, driver doesn't load

Thu Mar 14, 2019 3:21 pm

Code: Select all

sudo i2cdetect -y 1
to confirm that your rmi4 can be found on the I2C bus.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

BleakHouse
Posts: 9
Joined: Mon Feb 18, 2013 12:12 am

Re: synaptics rmi4-i2c, driver doesn't load

Thu Mar 14, 2019 3:52 pm

Yes it shows at address 0x20 as I said in my original post.

Code: Select all

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

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6907
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: synaptics rmi4-i2c, driver doesn't load

Thu Mar 14, 2019 4:16 pm

Sorry, I'm dropping in and out of this thread as I'm waiting for other things to happen. I won't always recall all the details exactly.

-121 is -EREMOTEIO, coming from the I2C transaction not being acknowledged. Dig that oscilloscope out again and see what is going on with the lines.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2228
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: synaptics rmi4-i2c, driver doesn't load

Thu Mar 14, 2019 4:36 pm

For the record, the module and alias searches were always going to fail because you have (now) built the drivers into the kernel. But this now sounds like a hardware issue.

BleakHouse
Posts: 9
Joined: Mon Feb 18, 2013 12:12 am

Re: synaptics rmi4-i2c, driver doesn't load

Thu Mar 14, 2019 10:04 pm

In case it's helpful to anyone else compiling a kernel:
It's necessary to apt-get install bison, flex and libssl-dev before attempting to build the kernel.
If looking at vcdbg log and it's filled with memory allocation errors, try disabling the OpenGL driver, something in there is trying to allocate a huge negative amount of memory.
If you are going to modify the kernel with make menuconfig, do it after you do "make bcm2709_defconfig"
as make bcm... overwrites .config which is what make menuconfig modifies.

@6x9 and Phil E, thanks for your help. I am starting from a fresh install on Raspbian 4.19.27 to see if it helps. I had a lot of other stuff going on that may have interfered with the i2c interface.

Return to “Device Tree”