[beagleboard] How GPIO input buttons read through sys file and updating in Device tree in SDK 7(3.12)

2015-03-05 Thread Naragoni shankar


Hi all,

I am currently using SDK 7.00 for am335x custom board, I am trying to read 
the value of an input. I am using kernel 3.12 kernel. The only way I have 
found is to manually export the gpio and then read the value but i want 
read gpio buttons through sys. here i am using pre defined gpio drive 
gpio_keys.c. find the device tree bellow...
  

gpio_keys_s0: gpio_keys_s0 {
pinctrl-single,pins = 
0x2c (PIN_INPUT_PULLUP | MUX_MODE7)   
/*key_init GPIO0_27 */
0x20 (PIN_INPUT_PULLUP | MUX_MODE7)   /* 
Alaram_key GPIO0_22 */
0x28 (PIN_INPUT_PULLUP | MUX_MODE7)   /* 
Cancel_key GPIO0_26  0x28 */
0x24 (PIN_INPUT_PULLUP | MUX_MODE7)   /* 
Away_key GPIO0_23 */
;
};


 gpio_buttons: gpio_buttons@0 {
   compatible = gpio-keys;
 pinctrl-names = default;
pinctrl-0 = gpio_keys_s0;
#address-cells = 1;
#size-cells = 0;

switch@1 {
label = key_init;
debounce_interval = 50;
linux,code = 100;
gpios = gpio0 27 GPIO_ACTIVE_HIGH;
 gpio-key,wakeup;
};

switch@2 {
label = Alaram_key;
linux,code = 0x102;
gpios = gpio0 22 GPIO_ACTIVE_HIGH;
};

switch@3 {
label = Cancel_key;
linux,code = 0x103;
gpios = gpio0 26 GPIO_ACTIVE_HIGH;
gpio-key,wakeup;
};

switch@4 {
label = Away_key;
linux,code = 0x108;
gpios = gpio0 23 GPIO_ACTIVE_HIGH;
};
};

I can see the the events occur in /dev/input/event0.

root@am335x-evm:/dev/input# cat event1
▒Dm8▒R
 ▒Dm8▒R
   ▒Dm8'S
 ▒Dm8'S
   ▒Dm8=

The problem is I need to read the value and not trigger off of an 
interrupt. but i want read the value through sys file like leds output 
root@am335x-evm:/sys/class/leds/beaglebone:green:usr3#
root@am335x-evm:/sys/class/leds/beaglebone:green:usr3# echo 1 brightness

root@am335x-evm:/sys/class/leds/beaglebone:green:usr3# cat brightness
1

please help me how to read input gpio data as well as how to export gpio 
buttons attributes to sys directory

Thankas  Regards

shankar  

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] Re: USB Client as host possible?

2014-12-01 Thread Naragoni shankar
Hi Neabex,

I am also doing same Task i.e OTG controller configure as Host and slave 
and  make it as hot pluggable devices. Did you get solution for that? if 
you get how can i do for that?   

On Saturday, November 1, 2014 4:17:28 AM UTC+5:30, Neabex wrote:

 Is it possible to use the usb client port as a host somehow? I want to be 
 able to use 2 USB ports without losing speed.


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.