itmicro
Пункты: 2274
Регистрация: 20.10.2010
Hi,
Where can I find a sample gpio driver and related makefile to take a reference ? Thanks,
Regards
sasamy
Пункты: 83542
Регистрация: 14.08.2009
Hi. Most simple - to use the interface sysfs
Device Drivers ---> GPIO Support ---> [*] /sys/class/gpio/... (sysfs interface)
Example In userspace:
/bin/echo "60" > /sys/class/gpio/export
/bin/echo "out" > /sys/class/gpio/gpio60/direction
/bin/echo "0" > /sys/class/gpio/gpio60/value
/bin/echo "1" > /sys/class/gpio/gpio60/value
gpio60 == PWM2 - see arch/arm/mach-mx23/mx23_pins.h
#define PINID_PWM2 MXS_PIN_ENCODE(1, 28)
1 x 32 + 28 = 60
Regards
itmicro
Пункты: 2274
Регистрация: 20.10.2010
Hi,
Thank you for your reply. Actually, I need a kernel space driver to customize. Actually I am trying to make soft spi on GPIO. Do you have this kind of driver ? Thanks,
Regards,
Цитата Hi. Most simple - to use the interface sysfs
Device Drivers ---> GPIO Support ---> [*] /sys/class/gpio/... (sysfs interface)
Example In userspace:
/bin/echo "60" > /sys/class/gpio/export
/bin/echo "out" > /sys/class/gpio/gpio60/direction
/bin/echo "0" > /sys/class/gpio/gpio60/value
/bin/echo "1" > /sys/class/gpio/gpio60/value
gpio60 == PWM2 - see arch/arm/mach-mx23/mx23_pins.h
#define PINID_PWM2 MXS_PIN_ENCODE(1, 28)
1 x 32 + 28 = 60
Regards
sasamy
Пункты: 83542
Регистрация: 14.08.2009
Цитата
Actually I am trying to make soft spi on GPIO. Do you have this kind of driver ?
I use the built in kernel driver
Device Drivers ---> SPI support ---> <*> GPIO-based bitbanging SPI Master
See my patch - there it is used it for touch panel ads7846(7843)