Hi,
How to enable power on/off of imx6 sabrelite board over gpio 7 13 button? I have already enabled snvs_pwrkey driver and added configuration in imx6qdl.dtsi:
snvs-pwrkey@0x020cc000 {
compatible = "fsl,imx6sx-snvs-pwrkey";
reg = <0x020cc000 0x4000>;
interrupts = <0 4 IRQ_TYPE_LEVEL_HIGH>;
fsl,keycode = <116>; /* KEY_POWER */
fsl,wakeup;
};
I have also mapped gpio button to KEY_POWER in imx6qdl-sabrelite.dtsi:
power {
label = "Power Button";
gpios = GP_GPIOKEY_VOL_UP;
linux,code = <KEY_POWER>; /* or KEY_SEARCH */
gpio-key,wakeup;
};
#define GP_GPIOKEY_VOL_UP <&gpio7 13 GPIO_ACTIVE_LOW>
MX6QDL_PAD_GPIO_18__GPIO7_IO13 0x1b0b0
I have compiled and probe image but failed. I have also tried more items from forum but also failed. So I need help.
Thanks, regards, Ivan.
Hi Ivan
some snvs-pwrkey examples can be found on
http://www.variscite.com/support-forum/viewtopic.php?t=150
https://community.freescale.com/thread/358898
https://groups.google.com/forum/#!topic/rtc-linux/1-A_J-uyW1Q
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Igor,
I have tried examples you posted but had no luck. Second link suites me
most. I have changed code in snsv-pwrkey.c like described and added
block to imx6qdl.dtsi but have no success. I have in imx6qdl.dtsi block:
snvs@020cc000 {
compatible = "fsl,sec-v4.0-mon", "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges = <0 0x020cc000 0x4000>;
snvs-rtc-lp@34 {
compatible = "fsl,sec-v4.0-mon-rtc-lp";
reg = <0x34 0x58>;
interrupts = <0 19 IRQ_TYPE_LEVEL_HIGH>,
<0 20 IRQ_TYPE_LEVEL_HIGH>;
};
};
and I have put:
snvs-pwrkey@0x020cc000 {
compatible = "fsl,imx6sx-snvs-pwrkey";
reg = <0x020cc000 0x4000>;
interrupts = <0 4 IRQ_TYPE_LEVEL_HIGH>;
fsl,keycode = <116>; /* KEY_POWER */
fsl,wakeup;
};
inside, but boot process is failing because, I think, same 0x020cc000
memory range is used for snvs and snvs-pwrkey.
I have also commented out upper block and leave lower block alone, but
nothing happens when I press button on gpio.
I have found on internet that gpio-keys driver is resonsible for mapping
gpio on some key, and I have driver enabled and I have mapped gpio to
key as described, so this part should be OK. Also driver snvs-pwrkey is
enabled because I have printout in /var/log/messages:
input: 20cc000.snvs-pwrkey as
/devices/soc0/soc.0/2000000.aips-bus/20cc000.snvs-pwrkey/input/input0
snvs_pwrkey 20cc000.snvs-pwrkey: i.MX snvs powerkey probed
Also for gpio key I have printout in /var/log/messages:
input: gpio-keys.14 as
/devices/soc0/gpio-keys.14/input/input1
But when pressing button on gpio nothing happens.
Third link that is posted does not suite me, because I have different
code, so I can not apply patches from it. Also I do not have all files
mentioned there.
I have imx6 sabrelite board with quad processor with yocto (jethro)
linux with kernel 3.14.28.0.
Thanks, regards, Ivan.