Part Number:OMAP-L138
Tool/software: Linux
Hi,
SDK: PROCESSOR-SDK-LINUX-OMAPL138 05_00_00_15
I want to set the GP0[9] to "gpio-keys", and I have add the code in the da850-lcdk.dts like this:
//20180907 user3 { label = "GPIO Key USER2"; linux,code = <BTN_2>; gpios = <&gpio 9 GPIO_ACTIVE_HIGH>; };
But the Linux can't work well, Just stop during the startup process.
and I have read the topic about the GPIO: http://processors.wiki.ti.com/index.php/DaVinci_PSP_03.01_Linux_Installation_User_Guide
GPIO GPIO driver has been rewritten to use the GPIO core infrastructure from the kernel. However there are no major changes to the APIs (back-end communication with the interrupts are handled with GPIO core). Need to call gpio_request() to start using a GPIO (this was not required earlier, we could directly call gpio_direction_xxx and gpio_write APIs) Provision to pass falling edge or rising edge information with the request_irq API. The IORESOURCE_IRQ_LOWEDGE and/or IORESOURCE_IRQ_HIGHEDGE can be passed for the "flags" argument. Current driver (for DM355 only) has a limitation of using GPIO 0-9 direct/unbanked interrupts together with the banked interrupts. The default behavior of the driver is use banked interrupts for all GPIOs (including GPIO 0-9). In this case all GPIO interrupts work, provided they are available through pinmux. The DM355 SoC file - arch/arm/mach-davinci/dm355.c file can be configured to enable direct/unbanked interrupts for GPIO 0-9. However, with this change GPIO 10 - 103 in interrupt mode (through banked interrupts) would not work. @@ -865,11 +865,12 @@ static struct davinci_soc_info davinci_soc_info_dm355 = { .intc_irq_prios = dm355_default_priorities, .intc_irq_num = DAVINCI_N_AINTC_IRQ, .timer_info = &dm355_timer_info, .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE), .gpio_num = 104, - .gpio_irq = IRQ_DM355_GPIOBNK0, + .gpio_irq = IRQ_DM355_GPIO0, + .gpio_unbanked = 10, .serial_dev = &dm355_serial_device, .sram_dma = 0x00010000, .sram_len = SZ_32K, };
I also change the da850.dtsi:
gpio: gpio@226000 { compatible = "ti,dm6441-gpio"; gpio-controller; #gpio-cells = <2>; reg = <0x226000 0x1000>; interrupts = <42 IRQ_TYPE_EDGE_BOTH 43 IRQ_TYPE_EDGE_BOTH 44 IRQ_TYPE_EDGE_BOTH 45 IRQ_TYPE_EDGE_BOTH 46 IRQ_TYPE_EDGE_BOTH 47 IRQ_TYPE_EDGE_BOTH 48 IRQ_TYPE_EDGE_BOTH 49 IRQ_TYPE_EDGE_BOTH 50 IRQ_TYPE_EDGE_BOTH>; ti,ngpio = <144>; ti,davinci-gpio-unbanked = <0>; //20180907 status = "disabled"; };
to
ti,davinci-gpio-unbanked = <8>; //20180907
But the Linux doesn't work as I want, I can not see the GPIO0_9 when I use the tool "lsgpio".
so I want someone help me to set the gpio0_9 as the "gpio-keys".