sama5d3xplained ADC line on 4.19.78-linux4sam-6.2

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

queifaro
Posts: 15
Joined: Fri Dec 20, 2013 11:19 am

sama5d3xplained ADC line on 4.19.78-linux4sam-6.2

Tue Dec 22, 2020 10:29 am

Hello,
i'm working on SAM5D31 base board and according on my custom carrier board pinout i need PD20,21,22,23 only as adc line. In my carrier board pinout PD19 is used as GPIO for enabling LTE modem.
I tried to modify a device tree in at91-sama5d3_xplained.dts in order to select only the proper adc line (PD20,21,22,23) and avoi to set pinctrl_adc0_adtrg that use PD19 but the situation on /sys/devices/platform/ahb/ahb:apb/f8018000.adc/iio:device0# remain the same:

drwxr-xr-x 6 root root 0 Jan 1 00:05 .
drwxr-xr-x 4 root root 0 Jan 1 00:05 ..
drwxr-xr-x 2 root root 0 Jan 1 00:12 buffer
-rw-r--r-- 1 root root 4096 Jan 1 00:12 current_timestamp_clock
-r--r--r-- 1 root root 4096 Jan 1 00:05 dev
-rw-r--r-- 1 root root 4096 Jan 1 00:12 in_voltage1_raw
-rw-r--r-- 1 root root 4096 Jan 1 00:12 in_voltage2_raw
-rw-r--r-- 1 root root 4096 Jan 1 00:12 in_voltage3_raw
-rw-r--r-- 1 root root 4096 Jan 1 00:12 in_voltage4_raw
-rw-r--r-- 1 root root 4096 Jan 1 00:12 in_voltage5_raw
-rw-r--r-- 1 root root 4096 Jan 1 00:12 in_voltage6_raw
-rw-r--r-- 1 root root 4096 Jan 1 00:12 in_voltage7_raw
-rw-r--r-- 1 root root 4096 Jan 1 00:12 in_voltage_scale
-r--r--r-- 1 root root 4096 Jan 1 00:12 name
lrwxrwxrwx 1 root root 0 Jan 1 00:12 of_node -> ../../../../../../firmware/devicetree/base/ahb/apb/adc@f8018000
drwxr-xr-x 2 root root 0 Jan 1 00:12 power
drwxr-xr-x 2 root root 0 Jan 1 00:12 scan_elements
lrwxrwxrwx 1 root root 0 Jan 1 00:12 subsystem -> ../../../../../../bus/iio
drwxr-xr-x 2 root root 0 Jan 1 00:12 trigger
-rw-r--r-- 1 root root 4096 Jan 1 00:05 uevent

the situation is the same even if i put the ADC in "disabled" in device tree.

The link https://www.linux4sam.org/bin/view/Linu ... oAdcDriver Pin Muxing suggest to perform some driver modification in order to change adc line pin but software driver reference point provided seems not present in 4.19.78-linux4sam-6.2.

Could you please provide some suggestion ?
Thanks in advance
Best Regards
Fabio
blue_z
Location: USA
Posts: 2154
Joined: Thu Apr 19, 2007 10:15 pm

Re: sama5d3xplained ADC line on 4.19.78-linux4sam-6.2

Wed Dec 23, 2020 1:15 am

queifaro wrote: i'm working on SAM5D31 base board ...
I tried to modify a device tree in at91-sama5d3_xplained.dts ...
That DT file is for the Xplained board with a SAMA5D36, yet you claim to use SAMA5D31. That doesn't make sense.
Why aren't you using a custom dts file for a custom board?
queifaro wrote: ... in order to select only the proper adc line (PD20,21,22,23) and avoi to set pinctrl_adc0_adtrg that use PD19
Only stating that you "tried" and neglecting to describe exactly how you modified the DT is not the way to ask for help..

queifaro wrote: but the situation on /sys/devices/platform/ahb/ahb:apb/f8018000.adc/iio:device0# remain the same:
...
First, that does not seem to be a valid path.
Second, what information are you getting from that subdirectory listing?
I glean nothing about your configuration "tries" relating to pin PD19.
And it looks like you haven't even reconfigured the ADC down to just the four analog inputs you wanted.

queifaro wrote: the situation is the same even if i put the ADC in "disabled" in device tree.
What "situation" are you referring to?
Are you sure you are examining something that would actually reflect the modifications that you are trying to make?

queifaro wrote: The link https://www.linux4sam.org/bin/view/Linu ... oAdcDriver Pin Muxing suggest to perform some driver modification in order to change adc line pin but software driver reference point provided seems not present in 4.19.78-linux4sam-6.2.
Much information in that section is now outdated, as it refers to a "platform_data structure" in "board files". Configuration by board file has been replaced with the Device Tree.
It is also poorly worded; the pins are ADC inputs, not "ADC outputs".


queifaro wrote: Could you please provide some suggestion ?
Use the proper tool(s) to confirm pin configuration/multiplexing.
There's debugfs, e.g. /sys/kernel/debug/pinctrl/pinctrl-handles (which lists all registered pin states) and /sys/kernel/debug/gpio.

Regards

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 4 guests