[<prev] [next>] [day] [month] [year] [list]
Message-ID: <56CF6844.2070802@vrt.com.au>
Date: Fri, 26 Feb 2016 06:47:00 +1000
From: Stuart Longland <stuartl@....com.au>
To: linux-kernel@...r.kernel.org
Subject: Labelling GPIOs for sysfs access?
Hi all,
I've been porting the mainline Linux kernel to the Technologic Systems
TS-7670 industrial computers which are based on the Freescale i.MX286 SoC.
I've had to make a couple of hacks to get things working, my code is at
https://github.com/vrtsystems/linux/tree/ts7670-4.4.1
Right now, there's a couple of GPIO lines for controlling power to
things like RS-232 and CANBus transceivers. The RS-485 port on these
devices also has a couple of pins that are connected to a CPU-controlled
MOSFET to allow turning an external device on/off.
Previously I used the generic GPIO sysfs interface. This worked well,
but the names suddenly changed on me and so now my scripts don't work.
It's also not that user friendly.
Implementing a kernel driver is doable, but all I'm doing is just
repeating work that the sysfs GPIO interface does already. Currently
I'm doing it with the "LEDs" framework, since they'll have a consistent
name -- users can for example, turn the RS-232 transceivers off by
setting /sys/class/leds/rs232_en/brightness to 0. It's controlled by
device tree.
(Better in the case of RS-232, would be to have the port automatically
turn the transceivers on. I managed to get the CANBus side to do that.)
Is there some sort of mechanism by which GPIO lines could be clearly
labelled to present a consistent interface in sysfs between kernel
revisions?
Regards,
--
_ ___ Stuart Longland - Systems Engineer
\ /|_) | T: +61 7 3535 9619
\/ | \ | 38b Douglas Street F: +61 7 3535 9699
SYSTEMS Milton QLD 4064 http://www.vrt.com.au
Powered by blists - more mailing lists