I had trouble (viz. gave up) working with input pins with the device tree.
I ended up doing all the init at run time (once I'd made sure nothing else
was using the same pins in the device tree).
Check that you have removed any reference to the HDMI in your
'am335x-bone-common-no-capemgr.dtsi' file. I had to remove a 'status =
"okay"' from the standard ''am335x-bone-common.dtsi', not sure if this is
the same in the 'no cape' variant.
For BBB expansion header P9, pin 23 (GPIO 1_17), AKA pin 49, I do the
following to intialise an input for use as a switch:
echo "49" > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio49/direction
echo 1 > /sys/class/gpio/gpio49/active_low
To read in the state I then use:
head -1 /sys/class/gpio/gpio49/value
e.g., in a script, use:
SWITCH=$(head -1 /sys/class/gpio/gpio49/value)
if [ ${SWITCH} = "1" ]; then
...
fi
For outputs I use the 'standard' led interface, as already used in the BBB
device tree for the heartbeat/mmc leds.
e.g., with the pnmux as you have done, add something like the following to
the 'leds' section in the common dtsi file:
led@6 {
label = "my_led";
gpios <&gpio1 16 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "none";
default-state = "off";
};
Then set the output state as follows:
echo 1 > /sys/devices/leds.4/leds/my_led/value
Hope that helps.
Andrew.
On Wednesday, 19 August 2015 01:16:30 UTC+12, Paco Dupont wrote:
>
> I've replace the last part I added (&ocp...) by Nelson's advice on this
> post :
> https://groups.google.com/d/msg/beagleboard/iW4i-xy9zJw/JFrr5M9_IwAJ
> &gpio3 {
> torout0 {
> gpio-hog;
> gpios = <107 0>;
> output-low;
> line-name = "TOR input";
> };
> };
>
> Just trying for 1 pin but still the same output no change ...
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.