Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A20 => Topic started by: pac on December 23, 2020, 06:50:05 PM

Title: How to get LRADC0 events using newest Ubuntu images based on kernel 5,8
Post by: pac on December 23, 2020, 06:50:05 PM
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



Title: Re: How to get LRADC0 events using newest Ubuntu images based on kernel 5,8
Post by: pac on December 30, 2020, 07:24:01 PM
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


Title: Re: How to get LRADC0 events using newest Ubuntu images based on kernel 5,8
Post by: LubOlimex on January 06, 2021, 04:33:29 PM
What board do you have? LRADC seems to work with the A20-OLinuXino-MICRO that we tested...
Title: Re: How to get LRADC0 events using newest Ubuntu images based on kernel 5,8
Post by: pac on January 08, 2021, 02:29:12 PM
I'm using the OLinuXino-A20-LIME

Best Regards,
Paolo Cremonese
Title: Re: How to get LRADC0 events using newest Ubuntu images based on kernel 5,8
Post by: pac on January 08, 2021, 11:14:43 PM
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