How to configure tca6416 as a button

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to configure tca6416 as a button

1,317 Views
末班车上的乘客
Contributor II

Hi,everyone

I need tca6416a as input button and output control for my new design,how to configure tca6416 as gpio button and gpio.Is it like below? 

i2c@3 {
#address-cells = <1>;
#size-cells = <0>;
reg = <3>;
tca6416: tca6416@21{
compatible = "ti,tca6416";
reg = <0x21>;
gpio-controller;
#gpio-cells = <2>;
};
};

gpio_keys {
compatible = "gpio-keys";
pinctrl-names = "default";

power-button {
label = "Power Button";
linux,code = <KEY_POWER>;
gpios = <&gpio4 22 GPIO_ACTIVE_LOW>;
};

left{
label = "left";
linux,code = <KEY_RIGHT>;
gpios = <&tca6416 0 GPIO_ACTIVE_LOW>;
};
right {
label = "right";
linux,code = <KEY_LEFT>;
gpios = <&tca6416 1 GPIO_ACTIVE_LOW>;
};
};

leds {
compatible = "gpio-leds";
pinctrl-names = "default";


keybacklight{
label = "keybl";
gpios = <&tca6416 2 GPIO_ACTIVE_HIGH>;
};
};

Labels (4)
0 Kudos
1 Reply

986 Views
igorpadykov
NXP Employee
NXP Employee

Hi

seems tca6416 used on wandboard so one can check its configuration :

mx6-wandboard/tca6416-keypad.c at master · smartpathinfosystemsindia/mx6-wandboard · GitHub 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos