i.MX23 GPIO on LCD pins

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

i.MX23 GPIO on LCD pins

1,232 Views
AndracsEstacvez
Contributor II

Hi all,

in my application I need to use the pins LCD_D00 to LCD_D10. As far as I know, I need to configure these pins as GPIOs.Could someone explain how to do it? Do I need to develop a new kernel module for doing the initialization or I just need to modify some of the existing files?

Best,

0 Kudos
Reply
4 Replies

920 Views
AndracsEstacvez
Contributor II

Hi again Balaji,

finally, I have found the solution thank to your reply.

Pins definitions are in:

"rpm/BUILD/linux-2.6.31/arch/arm/mach-mx23/mx23evk_pins.c"


There, comment those pins you want to use as GPIOs:


{

  .name  = "LCD_D01",

  .id = PINID_LCD_D01,

  .fun        = PIN_FUN1,

  .strength = PAD_8MA,

  .voltage    = PAD_3_3V,

  .drive      = 1,

  },


Thank you!

0 Kudos
Reply

919 Views
Balaji_ng
Contributor III

Hi,

It means that the LCD_D0 GPIO is being used by some other peripheral as well. You may have to check the board specific configuration file of the I.MX23 in the kernel. In my case it was present in <kernel_dir>/arch/arm/mach-mx23/ location. In previous versions of BSPs, it was available under <kernel_dir>/arch/arm/mach-stmp378x/stmp378x_devb.c, and some under <kernel_dir>/arch/arm/plat-stmp3xxx/ directories.

Here you may have to check various places where LCD pins of your choice have been used and modify them to suit your hardware requirements.

In my case I didnt consiously configured them anywhere. But I got them working once I freed these GPIOs from other peripherals.

Hope this helps,
Regards,

Balaji.V


Andrés Estévez said:

Hi Balaji,

thanks for you reply. I have already disabled the LCD option in the Kernel Configuration Menu. SYSFS support is also enabled. When I try to access to one of the pins by means of "echo <LCD_D0 gpio> >> export" I get a "device busy error - 16" in dmesg.

I think what I missing is to configure those pins as GPIOs, isn't it? But I don't know how to do it.

Thank you

0 Kudos
Reply

920 Views
AndracsEstacvez
Contributor II

Hi Balaji,

thanks for you reply. I have already disabled the LCD option in the Kernel Configuration Menu. SYSFS support is also enabled. When I try to access to one of the pins by means of "echo <LCD_D0 gpio> >> export" I get a "device busy error - 16" in dmesg.

I think what I missing is to configure those pins as GPIOs, isn't it? But I don't know how to do it.

Thank you

0 Kudos
Reply

920 Views
Balaji_ng
Contributor III

Hi,

     One of the options is that you may could expose them in sysfs  and use file operations to access them. But for that you may have to free up those GPIOs. You may do this by disabling the LCD option in the Kernel Configuration Menu and enable SYSFS support for GPIO.

Following link may help you better.

http://www.kernel.org/doc/Documentation/gpio.txt

Regards,

Balaji.V

0 Kudos
Reply