Hi all,
My problem exactly matches this discussion which doesn't seem to come to a resolution. Additionally, there are other discussions that get started, but never seems to find a resolution. If I manage to solve the issue, I'll post the solution here as well so that others will a tleast have something to go on.
I'm working on a IMX6SL-EVK board where I want to control a gpio pin from within linux. Currently, as a test platform I'm trying to control the LED that's connection to GPIO3:20 but haven't had much luck.
I'm running the kernel (Linux version 3.10.53) that is shipped with android KK by freescale.
The following is what I tried to perform the IO operation:
1. SYSFS GPIO access is enabled in the kernel
2. Modified iomux section in arch/arm/boot/dts/imx6sl-evk-common.dtsi to include the GPIO line in question as follows (see line 14)
&iomuxc {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&pinctrl_hog>;
pinctrl-1 = <&pinctrl_hog_sleep>;
hog {
pinctrl_hog: hoggrp {
fsl,pins = <
MX6SL_PAD_KEY_ROW7__GPIO4_IO07 0x17059
MX6SL_PAD_KEY_COL7__GPIO4_IO06 0x17059
MX6SL_PAD_SD2_DAT7__GPIO5_IO00 0x17059
MX6SL_PAD_SD2_DAT6__GPIO4_IO29 0x17059
MX6SL_PAD_HSIC_STROBE__GPIO3_IO20 0xc7030
MX6SL_PAD_REF_CLK_32K__GPIO3_IO22 0x17059
MX6SL_PAD_FEC_TX_CLK__GPIO4_IO21 0x80000000
3. Issued the following commands from within linux to control the GPIOs
echo 84>/sys/class/gpio/export
echo out>/sys/class/gpio/gpio84/direction
echo -n 0x01>/sys/class/gpio/gpio84/value
I know the above command tries to access the GPIO port because, I've added some printk messages and see the results in the kernel log (this is issued from within static void bgpio_write32(void __iomem *reg, unsigned long data) in drivers/gpio/gpio-generic.c)
drivers/gpio/gpio-generic.c:87 a0828000=40f000
drivers/gpio/gpio-generic.c:87 a0828004=100000
However, the GPIO line itself doesn't change state.
I feel, I'm missing something in my dts configuration, but can't figure it out.
Thanks in advance.
已解决! 转到解答。
Finally figured out what was going on. My original STROBE pad setting was correct, however I didn't realise, the contents of DTS file that I was modifying was getting overridden by another file which is arch/arm/boot/dts/imx6sl-evk-csi.dts. After adding the STROBE entry in that file, I'm able to control the GPIO line through the sysfs interface.
Thanks for all your help.
Finally figured out what was going on. My original STROBE pad setting was correct, however I didn't realise, the contents of DTS file that I was modifying was getting overridden by another file which is arch/arm/boot/dts/imx6sl-evk-csi.dts. After adding the STROBE entry in that file, I'm able to control the GPIO line through the sysfs interface.
Thanks for all your help.
Could you try applying/adapting this patch to 3.10?
Regards,
Fabio Estevam
Hi dee
according to linux documentation ...bindings/pinctrl/fsl,imx-pinctrl.txt :
Bits used for CONFIG:
NO_PAD_CTL(1 << 31): indicate this pin does not need config.
SION(1 << 30): Software Input On Field.
Force the selected mux mode input path no matter of MUX_MODE functionality.
By default the input path is determined by functionality of the selected
mux mode (regular).
One can try to change MX6SL_PAD_HSIC_STROBE__GPIO3_IO20 to 0x400c7030
Some examples can be found on
Other option to check/set GPIO register value with memtool
Best regards
igor