AM62A7-Q1: GPIO setting exception

Part Number: AM62A7-Q1

Tool/software:

Problem description:
I am unable to pull down the PNL_BackLight_CTRL pin and PNL_VDD_CTRL pin using the gpioset command or echo xxx/export, direction, value command

Requirement: How to pull up/down the GPIO pin while calling it in the device tree kernel?

Error message:

Hardware circuit design:

PNL_VDD_CTRL is connected to the SOC AB20 (GPO1_6) pin
PNL_BackLight_CTRL is connected to SOC AA21 (GPO1_3) pin

device tree

After power on, the PNL_VDD_CRL and PNL_BackLight_CTRL pins will be pulled high

Board side view GPIO status and regulator status commands
cat /sys/kernel/debug/gpio

cat /sys/kernel/debug/regulator/regulator_summary

Now when I detect that VCC is disconnected and the voltage is below the threshold, I need to pull down the PNL_VDD_CRL and PNL_BACK LIGHT pins, and the following error occurs at this stage:
03:00:03 MCU,(448 )operator(): Failed to set GPIO631 value.
Path: /sys/class/gpio/gpio631/value, Error: No such file or directory
03:00:03 MCU,(448 )operator(): Failed to set GPIO634 value.
Path: /sys/class/gpio/gpio634/value, Error: No such file or directory


I failed two debugging commands on the board, gpioset or echo xxx/export, direction, and value

Annotate this part of the code in the device tree, and it can be set through board side instructions. The problem is that in practical applications, it is necessary to raise the PNL_VDD_CRL and PNL_BackLight_CTRL pins in the kernel, rather than waiting until the application layer to raise them.


So how to achieve the effect of VCC disconnection and active screen shutdown while keeping the kernel driver to pull up the PNL_VDD_CRL and PNL_BackLight_CTRL pins and pulling them down at the application layer. Then we need to solve the issue of device or resource busy reported above

  • Hi,

    Our GPIO expert is out of office until early next week. Please expect delayed response.

  • Hello,

    The device tree nodes claim the regulator-gpio as the consumer of the GPIO, not userspace. Hence userspace will return the devices as busy because its expecting the regulator-gpio and its relevant driver to control this GPIO.

    You can run 'gpioinfo -c 2' to confirm this.

    Best Regards,

    Anshu

  • Hello,

    Yes, in the current configuration where the gpio pin is set to regulator-6, entering the gpioinfo - c2 command will show that the GPIO pin is occupied by panel vdd.

    At this time, if you enter echo xxx or gpioset/gpioget related commands, an error message "Device or resource busy" will appear.

    However, if I change the configuration of this pin in the device tree to the following way.

    It is possible to lower the pin by using echo xxx or gpioset/gpioget related commands while ensuring that the pin is powered on and defaults to a high level.

    Why are the results of these two ways of setting GPIO so different? I want to know the specific reasons for this.

    Best Regards,

    Garett

  • Hi Garett,

    Its just dependent on the consumer of the GPIO. If its assigned a consumer, its expected its respective driver to update the signal.

    Thanks,

    Anshu