0

I am new to linux & working on a project which includes some gpios are connected to my calixto board based on which i am performing action which i am getting from sys/class/gpio*/value & put in a while loop but it consumes much resources so i want to make it event based i.e how to get event from /dev/input/event* file & what are the configurations needed to be done in kernel during creating uImage thanks in advance.

1
  • You might explain why you want to go event based and what do you think it is. Not sure if your hardware (unmentioned) maps the IO to those Human Input Device events, if yes at the end of the link you find some hints: kernel.org/doc/Documentation/input/input.txt Commented Feb 20, 2014 at 6:57

2 Answers 2

1

Events are created by input devices, not by GPIOs directly. (Keep in mind that other sources of events can include things like mice, keyboards, touchscreens, and joysticks.) The easiest way of creating an input device from GPIOs will be to declare a gpio_keys platform device, either by adding one to your device tree (if you're using one), or by editing your board configuration file (if not). Details will depend heavily on the exact platform you're working with.

There's a brief walk-through on the Amadeus web site — it's for different hardware than what you're working with, but the principles will be similar.

Sign up to request clarification or add additional context in comments.

2 Comments

i have made changes in my both the file i.e board-calixto-evm.c and board-da850-evm.c according to given example but i didn't understand how to create a node and from where to get the code = BTN_EXTRA for my gpios which are connected to my gpio pins that are 48,49,......55. what i want is that when i press my gpio key 48 then its input must be visible in /dev/input/event file, from where i will read the value and do my work. i have made changes during kernel compilation also but there are no directory i.e gpio48,......gpio55 and how i will test that whether the gpio is working when pressed.
whether i have to do something with pinmux because my driver is visible by using /proc/bus/input/devices
0

If you mean using Asyc Access I think the following is a good start:

https://developer.ridgerun.com/wiki/index.php/How_to_use_GPIO_signals

3 Comments

i have made changes in my both the file i.e board-calixto-evm.c and board-da850-evm.c according to given example but i didn't understand how to create a node and from where to get the code = BTN_EXTRA for my gpios which are connected to my gpio pins that are 48,49,......55. what i want is that when i press my gpio key 48 then its input must be visible in /dev/input/event file, from where i will read the value and do my work. i have made changes during kernel compilation also but there are no directory i.e gpio48,......gpio55 and how i will test that whether the gpio is working when pressed
whether i have to do something with pinmux because my driver is visible by using /proc/bus/input/devices
I dont see any products which specify GPIO capabilities on the homepage of calixto.co.in/products.html - can you be more specific what type of USB device you have? If the device shows up differently than the example, it could be that it requires a different approach - it is device (class) specific.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.