How to use gpio-key to control volume

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

How to use gpio-key to control volume

1,093 Views
jingyangxie
Contributor V

In imx6q-sabresd board,the devicetree has configured the gpio-keys as follow:

gpio-keys {
  compatible = "gpio-keys";
  pinctrl-names = "default";
  pinctrl-0 = <&pinctrl_gpio_keys>;
  power {
   label = "Power Button";
   gpios = <&gpio3 29 1>;
   gpio-key,wakeup;
   linux,code = <KEY_POWER>;
  };
  volume-up {
   label = "Volume Up";
   gpios = <&gpio1 4 1>;
   gpio-key,wakeup;
   linux,code = <KEY_VOLUMEUP>;
  };
  volume-down {
   label = "Volume Down";
   gpios = <&gpio1 5 1>;
   gpio-key,wakeup;
   linux,code = <KEY_VOLUMEDOWN>;
  };
 };
but when I pressed the button,nothing appeared, anyone knows how to use the gpio-key to contorl volume?
0 Kudos
1 Reply

614 Views
igorpadykov
NXP Employee
NXP Employee

Hi jingyang

please check unit test (/mxc_sound_test) giving useful examples

of usage various peripherals:

imx-test
www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-test-5.7.tar.gz

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

0 Kudos