DTS for keyboard Keys question

31 views
Skip to first unread message

bremenpl

unread,
May 19, 2015, 9:51:46 AM5/19/15
to beagl...@googlegroups.com
Hello there,
I am trying to create a dts file for an 8 buttons keyboard. The pins I am using are:
P8_35,
P8_36,
P8_39,
P8_40,
P8_41,
P8_42,
P8_43,
P8_44

HDMI is turned off. Using Dereks molloy book, I have found an example dts file for P9_15 key: https://pastebin.com/kKp3ji7s

There are 2 main parts for me:
pinctrl-single,pins = <
                   
0x040 0x37 // P9_15 pull-up mode 7 GPIO1_16

This first one is quite straight forward for me, I have chnaged it to my needs:
pinctrl-single,pins = <
                   
0x0d0 0x37 // P8_35 pull-up mode 7
           
0x0c8 0x37 // P8_36 pull-up mode 7
           
0x0b8 0x37 // P8_39 pull-up mode 7
           
0x0bc 0x37 // P8_40 pull-up mode 7
           
0x0b0 0x37 // P8_41 pull-up mode 7
           
0x0b4 0x37 // P8_42 pull-up mode 7
           
0x0a8 0x37 // P8_43 pull-up mode 7
           
0x0ac 0x37 // P8_44 pull-up mode 7

The problem is I dont know how to config this part:
 button_P9_15 {
                    debounce_interval
= <50>;
                    linux
,code = <28>;
                    label
= "button9_15";
                    gpios
= <&gpio2 16 0x1>;
                    gpio
-key,wakeup;
                    autorepeat
;

I dont know how to interpret "gpios = <&gpio2 16 0x1>;". I Think that 16 0x1 stands for Gpio1[16], but I dont know what does &gpio2 stands for. Please correct me if I am wrong. What would be the configuration for the P8_44 button? I tried "gpios = <&gpio2 9 0x2>;" but that did not work. The overlay loaded but the button doesnt work. It is wired correctly though. I Would aprichiate all help.

Robert Nelson

unread,
May 19, 2015, 10:04:30 AM5/19/15
to Beagle Board
Well, first is this v3.8.x or anything later?

In 3.8.x: Gpio1[16] = &gpio2
while, in 3.14.x: Gpio1[16] = &gpio1 ;)

So for 3.8.x: GPIO1[16]

gpios = <&gpio2 16 0x1>;

&gpio2 = GPIO1
16 = 16
0x1: GPIO_ACTIVE_HIGH (0x0 = GPIO_ACTIVE_LOW)

Regards,

--
Robert Nelson
https://rcn-ee.com/

Bremenpl

unread,
May 19, 2015, 10:09:03 AM5/19/15
to beagl...@googlegroups.com
This is 3.8+.
So is gpio2 = &gpio3? Then in my case, if my button lines are internally
pulled up and the keys short them to gnd, should i use:
gpios = <&gpio3 9 0x0>; ?
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "BeagleBoard" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/beagleboard/aEGy-NGt81I/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> beagleboard...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


Robert Nelson

unread,
May 19, 2015, 10:12:36 AM5/19/15
to Beagle Board
On Tue, May 19, 2015 at 9:08 AM, Bremenpl <brem...@gmail.com> wrote:
> This is 3.8+.
> So is gpio2 = &gpio3? Then in my case, if my button lines are internally
> pulled up and the keys short them to gnd, should i use:
> gpios = <&gpio3 9 0x0>; ?

Correct

Bremenpl

unread,
May 19, 2015, 10:22:10 AM5/19/15
to beagl...@googlegroups.com
Thank you, gonna test it asap.

Bremenpl

unread,
May 20, 2015, 2:33:25 AM5/20/15
to beagl...@googlegroups.com
I have just tested the dts again. My configruation is a tact switch
connecting the line to ground. The line is internally pulled up. When i
used:
gpios = <&gpio3 9 0x0>;
The letters apperead when i released the button, not when i pressed it.
When i changed to:
gpios = <&gpio3 9 0x1>;
The letters apperad on a button press. It seems like is the way around.
1 means falling edge and 0 is rising edge. Is this correct?

W dniu 2015-05-19 o 16:12, Robert Nelson pisze:
> On Tue, May 19, 2015 at 9:08 AM, Bremenpl <brem...@gmail.com> wrote:
>> This is 3.8+.
>> So is gpio2 = &gpio3? Then in my case, if my button lines are internally
>> pulled up and the keys short them to gnd, should i use:
>> gpios = <&gpio3 9 0x0>; ?
> Correct
>
> Regards,
>

--
Bremenpl

Reply all
Reply to author
Forward
0 new messages