Post Go back to editing

Enabling Push Button 1 on SOM CRR board

Hi, I want to enable Push Button 1 on the SOM CRR board and capture the notifications via GPIO variable. I have tried below method:

Enabled button@0 and button@1 sections from "sc594-som-ezkit.dts" file as below:

button0: button@0 {
compatible = "adi,button-led";
en-pins = <&ssw1 1 GPIO_ACTIVE_LOW>; // PUSHBUTTON_EN
button_gpio = <50>; // PD_00
led_gpio = <35>; // PC_03 / LED9 / LED1_KIT
};

button1: button@1 {
compatible = "adi,button-led";
en-pins = <&ssw1 1 GPIO_ACTIVE_HIGH>; // PUSHBUTTON_EN
button_gpio = <112>; // PH_00
led_gpio = <34>; // PC_02 / LED8 / LED2_KIT
};

With these changes able to receive PB1 notifications on to this file '/sys/class/gpio/gpio48/value' by performing 'poll()' on 'value' file fd.

If I disable button@1 section, I am not receiving any notification via PB1 press.

Is this the right configuration? 

Do I need to enable both button@0, button@1 to work with PB1 ?

Please suggest

Parents
  • PB1 is working as expected by making below changes:

    1) Made en-pins to GPIO_ACTIVE_HIGH in button@0 

    2) button_gpio is 50

    3) Commented button@1 section

    button0: button@0 {
    compatible = "adi,button-led";
    en-pins = <&ssw1 1 GPIO_ACTIVE_LOW>; // PUSHBUTTON_EN
    button_gpio = <50>; // PD_00
    led_gpio = <35>; // PC_03 / LED9 / LED1_KIT
    };

    /*

    button1: button@1 {
    compatible = "adi,button-led";
    en-pins = <&ssw1 1 GPIO_ACTIVE_HIGH>; // PUSHBUTTON_EN
    button_gpio = <112>; // PH_00
    led_gpio = <34>; // PC_02 / LED8 / LED2_KIT
    };

    */

  • Hi Srikanth,

    Glad to hear it worked, Do you mean you made the change in button0? in both the 1st and 2nd replies, sorry, I don't see any difference.

    ```

    button0:

    en-pins = <&ssw1 1 GPIO_ACTIVE_HIGH>; // PUSHBUTTON_EN
    ```

    Thanks,

    Prasanth R

  • Yes, you are right Prasanth. Made below changes in working case:

    1) Made en-pins to GPIO_ACTIVE_HIGH in button@0 

    2) button_gpio is 50

    3) Commented button@1 section (Previously it was uncommented)

Reply Children
No Data