How to get LRADC0 events using newest Ubuntu images based on kernel 5,8

Started by pac, December 23, 2020, 06:50:05 PM

Previous topic - Next topic

pac

Hi All,
I need to use ADC0 input of A20 lime (GPIO1 pin 6).
Using legacy images (kernel 3.4 based) I do :

insmod sun4i-keyboard.ko

What I have to do using the latest Ubuntu images ?
I'm using A20-OLinuXino-bionic-base-20201217-194545:

I try to do the same but that module seems not present in the modules collection.

Thanks in advance

Paolo Cremonese




pac

Hi All,
I have seen that the sun4i-lradc-keys.ko is loaded.

What is the device file I have to open to get events from that driver ?

using

/dev/input/event0

I don't receive any event from ADC.

Please, help me.

Thanks in advance

Paolo



LubOlimex

What board do you have? LRADC seems to work with the A20-OLinuXino-MICRO that we tested...
Technical support and documentation manager at Olimex

pac


pac

Peeking the suggestion by LubOlimex, I try to modify the dts adding the following:
&lradc {
vref-supply = <&reg_vcc3v0>;
status = "okay";

button-191 {
label = "Volume Up";
linux,code = <KEY_VOLUMEUP>;
channel = <0>;
voltage = <191274>;
};

button-392 {
label = "Volume Down";
linux,code = <KEY_VOLUMEDOWN>;
channel = <0>;
voltage = <392644>;
};

button-601 {
label = "Menu";
linux,code = <KEY_MENU>;
channel = <0>;
voltage = <601151>;
};

button-795 {
label = "Search";
linux,code = <KEY_SEARCH>;
channel = <0>;
voltage = <795090>;
};

button-987 {
label = "Home";
linux,code = <KEY_HOMEPAGE>;
channel = <0>;
voltage = <987387>;
};

button-1184 {
label = "Esc";
linux,code = <KEY_ESC>;
channel = <0>;
voltage = <1184678>;
};

button-1398 {
label = "Enter";
linux,code = <KEY_ENTER>;
channel = <0>;
voltage = <1398804>;
};
};



(the same in Micro) at the end of sun7i-a20-olinuxino-lime.dts
Then compiling, I obtain the new dtb
I copy the dtb to the folder
/usr/lib/linux-image-5.8.18-olimex
then reboot.
The system starts well but the device tree does not change : the status of lradc is still disabled.
What I'm doing of wrong ?

Best regards
Paolo