Commit Graph

91 Commits

Author SHA1 Message Date
dholland
f9228f4225 Add d_discard to all struct cdevsw instances I could find.
All have been set to "nodiscard"; some should get a real implementation.
2014-07-25 08:10:31 +00:00
kardel
d70c01ba15 make implementation match gpio(4) man entry. do no change configuration
if no flags are being set (allows non-destructive inquiry via GPIOSET again).
2014-06-29 09:32:24 +00:00
msaitoh
5ac82b4202 Add aprint_naive("\n") for boot -q 2014-05-23 13:57:04 +00:00
christos
d18a4ca216 PR/48701: Timo Buhrmester: spurious messages while booting silently (gpio,
glxsb); use aprint_normal()
>Category:       kern
>Synopsis:       spurious messages while booting silently (gpio, glxsb)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
2014-04-04 14:47:26 +00:00
dholland
a68f9396b6 Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
2014-03-16 05:20:22 +00:00
pooka
4f6fb3bf35 Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
2014-02-25 18:30:08 +00:00
mbalmer
1c2221476f Make the gpiosim(4) device a 64 bit wide GPIO. 2013-05-20 15:48:25 +00:00
mbalmer
25f2bfbcb3 When returning the old value, use the value read from the device. 2013-05-20 15:46:41 +00:00
chs
cbab9cadce split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
2012-10-27 17:17:22 +00:00
dyoung
818ff29c73 Quiet down autoconfiguration by changing some printf() calls to
aprint_normal() calls.
2012-10-17 21:35:38 +00:00
dsl
e21a34c25e Add some pre-processor magic to verify that the type of the data item
passed to sysctl_createv() actually matches the declared type for
  the item itself.
In the places where the caller specifies a function and a structure
  address (typically the 'softc') an explicit (void *) cast is now needed.
Fixes bugs in sys/dev/acpi/asus_acpi.c sys/dev/bluetooth/bcsp.c
  sys/kern/vfs_bio.c sys/miscfs/syncfs/sync_subr.c and setting
  AcpiGbl_EnableAmlDebugObject.
(mostly passing the address of a uint64_t when typed as CTLTYPE_INT).
I've test built quite a few kernels, but there may be some unfixed MD
  fallout. Most likely passing &char[] to char *.
Also add CTLFLAG_UNSIGNED for unsiged decimals - not set yet.
2012-06-02 21:36:41 +00:00
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