mbalmer
70a43050a4
Don't ignore the gpiobus_close() return value. Found by joerg@ using clang.
2011-11-25 13:49:43 +00:00
mbalmer
e6dceed514
Initialize ga.ga_dvname in gpio_search to prevent a stack fault in config_match
2011-11-14 07:45:54 +00:00
mbalmer
092935d865
Remove an unused variable.
2011-11-13 14:02:01 +00:00
mbalmer
a2091c8232
Remove software pulsing in gpio(4), this functionality is now provided
...
by the gpiopwm(4) driver.
2011-11-13 13:20:02 +00:00
mbalmer
0826f67b74
On detach, set the pin to low state.
2011-11-13 13:16:33 +00:00
mbalmer
d4bc0f70c1
gpiopwm(4) is a driver to pulse GPIO pins in software. This obsoletes
...
the software pulsing facilities in gpio(4) (and gpioctl(8)) which will
later be removed.
2011-11-13 12:33:00 +00:00
mbalmer
cf39ee7883
Fix non-COMPAT_50 compilation.
2011-10-03 11:31:56 +00:00
mbalmer
de05db530c
Unbreak and move the list of child devices to COMPAT_50.
2011-10-03 11:28:28 +00:00
mbalmer
d394843f35
Remove the GPIODETACH gpio(4) ioctl (it is still available in COMPAT_50) and
...
the 'detach' command line option from gpioctl(8). Drivers that are
attached to gpio pins can be detached using the drvctl(8) command.
2011-10-03 11:16:47 +00:00
mbalmer
a429601b29
Don't cast void pointers.
2011-10-03 08:23:58 +00:00
mbalmer
550019b8a7
Add the flag locator (missed in the previous commit).
2011-10-02 10:01:25 +00:00
mbalmer
90077b6e6d
Add a ga_flags field to the gpio_attach structure to hand driver
...
specific flags to drivers being attached at gpio pins. gpioiic(4)
uses this to reverse the SDA/SCL signal order. gpioctl(8) accepts
the flag values as optional argument to the attach command.
While here, make sure we retain backwards compatability and wrap compat
code in #ifdef COMPAT_50/#endif.
2011-10-02 09:33:18 +00:00
mbalmer
5ff9b946b6
Newline is \n, not /n.
2011-09-07 07:43:05 +00:00
mbalmer
44d0145a0a
Make sure error is not used unitialized when sc->sc_attach_busy is 0.
2011-09-02 06:50:20 +00:00
mbalmer
aeaf43d1cc
Switch von u_int_XY to uintXY
2011-08-31 12:25:05 +00:00
mbalmer
5d1f2a00ee
Add glue code to build as module.
2011-08-31 12:23:32 +00:00
mbalmer
d020095c80
Remove what I committed accidentally...
2011-08-31 12:20:35 +00:00
mbalmer
582e442d26
gpio(4) keeps track of child devices attached using the GPIOATTACH ioctl(),
...
so remove those references and free the memory in gpio_childdetached().
Protect access to the list of child devices with a kcondvar.
2011-08-31 12:07:26 +00:00
mbalmer
86a49d8281
Unconditionally include <sys/modules.h>.
2011-08-30 07:22:11 +00:00
mbalmer
ffbe93dc4f
Register as built-in module when compiled wo/ _MODULE.
2011-08-29 15:14:04 +00:00
jmcneill
1343ee48da
build with WARNS=3
2011-08-28 11:36:17 +00:00
mbalmer
92ced822d1
Add a new ioctl, GPIOPULSE to gpio(4) to allow for pulsing a pin.
...
If a pin can pulse in hardware, that will be used, else it will
be pulsed in software. There is no way yet to set the pulse frequency
for pins that pulse in hardware. While here, make the code mpsafe and
allow more than one thread in the driver (access to ioctl is serialized).
2011-08-28 07:48:50 +00:00
mbalmer
edd34c0a58
u_int32_t -> uin32_t.
2011-08-26 15:00:07 +00:00
mbalmer
c97eb22ebc
fix indents
2011-08-14 18:49:17 +00:00
mbalmer
b50c50a270
gpio(4) and gpiosim(4) can now be built and used as modules. While here,
...
make some functions static.
2011-08-12 08:00:52 +00:00
mbalmer
57a529d87b
When reading the bits from the I2C bus, also report SCL. Fixes PR43275.
...
Fix originally from Maxim Weber, thanks.
2011-07-23 09:03:38 +00:00
joerg
d4d21d35eb
Annotate that gpiobus_close's return value is undesired here
2011-06-09 14:46:06 +00:00
ad
9b61e54ab7
console spam
2010-04-25 11:23:34 +00:00
dyoung
c1b390d493
A pointer typedef entails trading too much flexibility to declare const
...
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
2010-02-24 22:37:54 +00:00
mbalmer
26bb6ca79d
Unfold, bump copyright.
2010-01-24 12:25:20 +00:00
dyoung
3022acc4eb
Expand PMF_FN_* macros.
2010-01-08 19:42:11 +00:00
dyoung
711b27c90c
Delete unnecessary device-activation hooks. Simplify the rest.
2009-12-06 22:33:44 +00:00
dyoung
171b2851cf
Simplify activation hook.
2009-11-12 19:22:08 +00:00
dyoung
bb8630fab4
Delete the useless activation hook. Add a child-detached hook and
...
a rescan hook. Detach children before detaching self.
2009-11-05 18:20:40 +00:00
mbalmer
bf79ac9a26
Prevent the creation of duplicate pin names in GPIOSET.
...
Problem noticed by rmind a while ago.
2009-08-23 12:08:56 +00:00
mbalmer
adac122864
Before trying to attach a child device driver, make sure the GPIO pins can
...
be mapped. This prevents drivers from later failing in the attach routine.
Problem found by me, solution suggested by jmcneill.
2009-08-21 12:53:42 +00:00
mbalmer
066a225399
unfold short lines, fold long line.
2009-08-17 12:44:44 +00:00
mbalmer
385b2e3631
Move the keylock.h header from sys/sys to sys/dev where it really belongs.
...
Add keylock options to the ALL kernel configuration.
2009-08-15 09:43:58 +00:00
mbalmer
3ab4ce4739
Add support for multi-position electro-mechanical keylocks. An example
...
driver, gpiolock(4), is provided as an example how to interface real hardware.
A new securemodel, securemodel_keylock, is provided to show how this can
be used to tie keylocks to overall system security. This is experimental
code. The diff has been on tech-kern for several weeks.
Reviewed by many, kauth(9) integration reviewed by Elad Efrat; approved by
tonnerre@ and tron@. Thanks to everyone who provided feedback.
2009-08-14 21:17:21 +00:00
mbalmer
8fc23e3158
gpioiic(4), a driver to do use GPIO pins in bit-banging mode to form an I2C
...
bus. Ported from OpenBSD.
2009-08-09 08:18:00 +00:00
mbalmer
fa4785b09a
Register with the PMF, and when detaching, just the right order.
2009-08-08 10:38:17 +00:00
mbalmer
61e768bf92
Don't use an identifier name that probably clashes with the C standard.
...
Requested by many.
2009-08-07 08:15:52 +00:00
mbalmer
2ce40e808d
Properly teardown the sysctl node and detach child driver if gpiosim gets
...
detached itself (e.g. when the 'drvctl -d gpiosimX' command is entered).
2009-08-07 08:08:18 +00:00
mbalmer
d2c70191a8
Fold long line.
2009-08-07 08:05:48 +00:00
mbalmer
133c6e2a65
For the sake of correctness, call pmf_device_deregister() in the detach
...
function.
2009-08-06 13:16:49 +00:00
mbalmer
4b41fced4d
unfold short line; debracket
2009-08-03 17:24:40 +00:00
mbalmer
38b252cce6
Be more careful when attaching drivers at runtime, call the drivers match
...
routine before attaching the device. Prevents non-working driver instances
from being created.
2009-08-03 12:43:56 +00:00
mbalmer
e1a16b3665
A better match routine that checks also the number of pins instead
...
of checking the pins in the attach routine; malconfigured devices will
no longer attach. While here, replace some printf uses by aprint_....
2009-08-03 12:42:45 +00:00
drochner
c07937acdd
add dummy pmf registration to allow suspend
2009-07-28 15:28:24 +00:00
mbalmer
9d8b69b23a
Do not attach gpiosim(4) at root, but make it a pseudo device.
...
With help from Matthias Drochner, thanks!
2009-07-27 17:40:57 +00:00