Post Go back to editing

How to config PI_03 Pin as input with IRQ in device tree on SC598 with Yocto build 2.1.0?

There is a requirement to setup LIRC on PI_03, as I compare some successful result on network, the pin LIRC used should be input with IRQ.

But in SC598 on Yocto 2.1.0, there is only pinmux config on pinctrl, and GIC is binding for pin port instead of specific pin.

  • Hi Denny,

    usually, if a pin is utilized, you can drop the feature by passing the status="disabled" in the device node and make use of the pinmux to convert to gpio or other as per our requirement. 

    Do you face issues in converting the pin? 

    Could add your requirements in detail, please? 


    Prasanth R

  • I'm trying to add following code in DTS to add "gpio ir receiver node" for LIRC usage

    ir_recv {
            compatible = "gpio-ir-receiver";
            gpios = <&gpi 3 GPIO_ACTIVE_HIGH>;

    But under this setting, "PI_03" is no IRQ feature. (example of worked LIRC pin)

    My question is how to set "PI_03" as IRQ input pin in device tree?


  • Have you tried to run with above configuration? 

    SC598 using different driver so output may not match. Can you paste output from SC598?

  • I have tried "code block", I can get input gpio config and "/dev/lirc0".

    But I can't read any information from "mode2 -d /dev/lirc0"

    After compare success case in network, I think the problem is "PI_03" not be config with IRQ feature.

  • Hi

    That's implies that driver loaded successfully and that GPIO and IRQ is assigned. 

    Can you scan for kernel log for output of gpio-ir-receiver driver and additionally the output of "cat /proc/interrupts"

    I would like to see that gpio-ir-receiver have no error that IRQ isn't assigned to it. 

    And in /proc/interrupts there should be registered IRQ for device with name that may look like "gpio-ir-recv-irq". 

    I have quickly scanned GPIO,IRQCHIP and gpio-ir-receiver drivers. There should be the error if no IRQ assigned to driver.
    In driver there all GPIOs are assigned default IRQ handlers. 

  • I have attached some log you mentioned. It seems IRQ has been setup, but LIRC mode2 still not worked.

    mode2 -d /dev/lirc1 -D 10 -k
    Using driver default on device /dev/lirc1
    Trying device: /dev/lirc1
    Using device: /dev/lirc1
    Warning: Running as root.
    cat /sys/kernel/debug/gpio 
    gpiochip0: GPIOs 0-15, adsp-gpio:
     gpio-5   (                    |spi2 CS0            ) out hi ACTIVE LOW
    gpiochip1: GPIOs 16-31, adsp-gpio:
    gpiochip2: GPIOs 32-47, adsp-gpio:
    gpiochip3: GPIOs 48-63, adsp-gpio:
    gpiochip4: GPIOs 64-79, adsp-gpio:
    gpiochip5: GPIOs 80-95, adsp-gpio:
    gpiochip6: GPIOs 96-111, adsp-gpio:
     gpio-104 (                    |spi3 CS0            ) out hi ACTIVE LOW
     gpio-107 (                    |reset               ) out lo ACTIVE LOW
    gpiochip7: GPIOs 112-127, adsp-gpio:
    gpiochip8: GPIOs 128-143, adsp-gpio:
     gpio-131 (                    |ir_recv             ) in  hi 
    dmesg | grep gpio_ir
    [    1.054845] rc rc1: gpio_ir_recv as /devices/platform/ir_recv/rc/rc1
    [    1.061165] rc rc1: lirc_dev: driver gpio_ir_recv registered at minor = 1, raw IR receiver, no transmitter
    [    1.070778] input: gpio_ir_recv as /devices/platform/ir_recv/rc/rc1/input1
    root@adsp-sc598-som-ezkit:~# cat /proc/interrupts 
      2:      26206     GICv3  30 Level     arch_timer
      6:          0     GICv3  81 Level     sc5xx gptimer clockevent
     13:          0     GICv3  23 Level     arm-pmu
     14:          0     GICv3  42 Level     sram-ecc-err
     15:          0     GICv3  39 Edge      sc59x_thermal_fault
     16:          0     GICv3  40 Edge      sc59x_thermal_alert
     17:          0     GICv3 218 Edge      adi-hadc
     18:        454     GICv3 170 Level     dma controller irq
     19:          0     GICv3 171 Level     dma controller irq
     21:          0     GICv3 184 Level     31001600.twi
     24:          0     GICv3 164 Level     SPI ERROR
     25:          0     GICv3 168 Level     SPI ERROR
     26:        432     GICv3 253 Level     eth0
     37:          0     GICv3 129 Level     dma controller irq
     38:          0     GICv3 337 Level     dma controller error irq
     39:          0     GICv3 131 Level     dma controller irq
     40:          0     GICv3 338 Level     dma controller error irq
     41:          0     GICv3 153 Level     dma controller irq
     42:          0     GICv3 293 Level     dma controller error irq
     43:          0     GICv3 154 Level     dma controller irq
     44:          0     GICv3 294 Level     dma controller error irq
     45:          0     GICv3 157 Level     dma controller irq
     46:          0     GICv3 295 Level     dma controller error irq
     47:          0     GICv3 158 Level     dma controller irq
     48:          0     GICv3 296 Level     dma controller error irq
     49:          0     GICv3 161 Level     dma controller irq
     50:          0     GICv3 297 Level     dma controller error irq
     51:          0     GICv3 162 Level     dma controller irq
     52:          0     GICv3 298 Level     dma controller error irq
     53:          0     GICv3 165 Level     dma controller irq
     54:          0     GICv3 299 Level     dma controller error irq
     55:          0     GICv3 166 Level     dma controller irq
     56:          0     GICv3 300 Level     dma controller error irq
     57:          0     GICv3 301 Level     dma controller error irq
     58:          0     GICv3 302 Level     dma controller error irq
     59:          0     GICv3 173 Level     dma controller irq
     60:          0     GICv3 303 Level     dma controller error irq
     61:          0     GICv3 174 Level     dma controller irq
     62:          0     GICv3 304 Level     dma controller error irq
     63:          0     GICv3 176 Level     dma controller irq
     64:          0     GICv3 305 Level     dma controller error irq
     65:          0     GICv3 177 Level     dma controller irq
     66:          0     GICv3 306 Level     dma controller error irq
     67:          0     GICv3 179 Level     dma controller irq
     68:          0     GICv3 307 Level     dma controller error irq
     69:          0     GICv3 180 Level     dma controller irq
     70:          0     GICv3 308 Level     dma controller error irq
     71:          0     GICv3 239 Level     dma controller irq
     72:          0     GICv3 318 Level     dma controller error irq
     73:          0     GICv3 238 Level     dma controller irq
     74:          0     GICv3 317 Level     dma controller error irq
     75:          0  adsp-pint  19 Edge      gpio-ir-recv-irq
    IPI0:         0       Rescheduling interrupts
    IPI1:         0       Function call interrupts
    IPI2:         0       CPU stop interrupts
    IPI3:         0       CPU stop (for crash dump) interrupts
    IPI4:         0       Timer broadcast interrupts
    IPI5:         0       IRQ work interrupts
    IPI6:         0       CPU wake-up interrupts
    Err:          0

  • Hi Danny,

    from software side it looks all is setup. Can you verify that gpio-ir-receiver device is communicating with ADSP-SC598? I don't have any device on hand that I can try reproduce same issue that you see. 


  • I can't sure what you want me to test for.

    But I have tried to use the "Same Pin" (PI_03) as general GPIO input by "/sys/class/gpio", and the value read can response input logic correctly.

    (Tried by IR and manually pull high/low)