summaryrefslogtreecommitdiffstats
path: root/sys/dev/gpio (follow)
Commit message (Collapse)AuthorAgeFilesLines
* kernel: use gettime(9)/getuptime(9) in lieu of time_second(9)/time_uptime(9)cheloha2020-06-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | time_second(9) and time_uptime(9) are widely used in the kernel to quickly get the system UTC or system uptime as a time_t. However, time_t is 64-bit everywhere, so it is not generally safe to use them on 32-bit platforms: you have a split-read problem if your hardware cannot perform atomic 64-bit reads. This patch replaces time_second(9) with gettime(9), a safer successor interface, throughout the kernel. Similarly, time_uptime(9) is replaced with getuptime(9). There is a performance cost on 32-bit platforms in exchange for eliminating the split-read problem: instead of two register reads you now have a lockless read loop to pull the values from the timehands. This is really not *too* bad in the grand scheme of things, but compared to what we were doing before it is several times slower. There is no performance cost on 64-bit (__LP64__) platforms. With input from visa@, dlg@, and tedu@. Several bugs squashed by visa@. ok kettenis@
* gpiodcf(4): unbreak compilationcheloha2020-04-151-2/+2
|
* cleanup unused headers generated by configjsg2020-01-241-2/+2
| | | | ok tedu@ krw@ deraadt@
* gpiodcf(4): tvtohz(9)+timeout_add(9) -> timeout_add_msec(9)cheloha2019-08-101-54/+21
| | | | "looks fine" kettenis@, ok deraadt@
* Delete unnecessary <sys/file.h> includesguenther2017-12-301-2/+1
| | | | ok millert@ krw@
* Test for device_lookup() returning NULL in gpioioctl() and gpioclose().jsg2017-08-181-1/+7
| | | | Coverity CIDs 1453046, 1453184.
* simple sizes for free()deraadt2015-08-271-6/+5
|
* The Swiss Federal Government decided to shut down HBG at the end of 2011.claudio2015-06-072-64/+5
| | | | | | | On 6 September 2012 at 12:02:00 UTC both antenna towers were demolished by controlled explosives. So this is not coming back and we can tedu the support for HBG form the DCF77 drivers. Remided by mbalmer
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-3/+3
| | | | after discussions with beck deraadt kettenis.
* In {gpio,gdium}iic_bb_read_bits(), report the state of the SCL bit in additionmiod2013-04-191-3/+10
| | | | to the state of the SDA bit; the MI i2c code is about to depend upon this.
* Add a 'flag' locator to gpioiic(4), and define a first flagmatthieu2011-10-034-14/+31
| | | | | | value to swap the SDA and SCL pins assigment during attach. Mostly from work with mbalmer@NetBSD. ok miod@
* Remove config_activate() and DVACT_ACTIVATE. PCMCIA's the only thingmatthew2011-07-032-6/+2
| | | | | | | | that's ever used it, and it's long since been changed to use DVACT_{QUIESCE,SUSPEND,RESUME} instead. ok deraadt@, dlg@; miod@ also agreed with this idea when I brought it up a few weeks ago
* Get rid of devact enum, substitute it with an int and coresponding defines.pirofti2009-10-132-6/+6
| | | | | | This is needed for the addition of further suspend/resume actions. Okay deraadt@, marco@.
* submatch functions used with config_found_sm() are required to invoke themiod2009-08-291-2/+5
| | | | | | driver's ca_match function. (only offender in the whole tree) ok deraadt@
* in ca_attach() there is no need to set .value and .flags of sensors to 0,cnst2009-04-261-5/+1
| | | | since autoconf(9) allocates softc with M_ZERO; ok deraadt
* Welcome gpiodcf(4), a driver that attaches to a GPIO pin, decodes thembalmer2008-11-282-1/+619
| | | | signal from an attached DCF77, HG, or TDF receiver and provides a timedelta.
* Add my copyright here, too.mbalmer2008-11-261-1/+2
|
* Change the semantics of gpio(4) devices by locking down pinmbalmer2008-11-262-41/+156
| | | | | | | | | | | configuration and device attachment/detachment to securelevel 0. GPIO pins can now only be configured at securelevel 0. Once the securelevel is raised, only pins that have been configured and set for securelevel access using the GPIOPINSET ioctl are accessible. This also adds the possibility to give GPIO pins a name. ok uwe@
* - Add two new ioctls to gpio(4), GPIOATTACH and GPIODETACH, to allow to attachmbalmer2008-11-245-9/+73
| | | | | | | | | | | | and detach devices on a gpiobus at runtime. The offset and mask locators in kernel config files can still be used for static configuration, so this does not break existing custome kernel configs. - Have gpioow(4) unmap the pins it used from the gpiobus during detach Changes to gpioctl(8) will be a separate committ. ok uwe
* This is a "dummy" GPIO driver used for development and testing only.mbalmer2008-11-231-0/+152
| | | | | | Not enabled in any kernel (and will not be). ok drahn, uwe
* Switch to rwlock(9)jsg2007-06-051-5/+6
| | | | ok grange@
* In a drivers activate() entry point, if on DVACT_DEACTIVATE it doesmiod2006-06-231-2/+2
| | | | | | something, then it MUST return zero on DVACT_ACTIVATE, not EOPNOTSUPP; this very popular bug has been cut and pasted a lot of times... ok deraadt@ mickey@
* Don't allow to change gpio pin state if /dev/gpio was openedgrange2006-03-261-1/+11
| | | | in read-only mode. Spotted by form@.
* Dallas 1-Wire bus support. Includes the following drivers:grange2006-03-042-1/+251
| | | | | | | | | | | gpioow(4) 1-Wire bus bit-banging through GPIO pin onewire(4) 1-Wire bus driver owid(4) 1-Wire ID family type device owtemp(4) 1-Wire temperature family type device Drivers for RS-232 and USB bus masters will follow. ok deraadt@
* Add support for driving SDA in push-pull + tri-state mode.grange2006-01-201-10/+16
|
* Check that SDA pin is able to read input.grange2006-01-181-1/+5
|
* Make it detachable.grange2006-01-171-2/+10
|
* Nit.grange2006-01-151-5/+2
|
* Add a comment.grange2006-01-141-1/+2
|
* Some improvements:grange2006-01-141-5/+59
| | | | | - use gpio_pin_caps() while configuring pins - try to deal not only with open-drain outputs
* Add gpio_pin_caps() method to provide pin capabilities.grange2006-01-142-2/+11
|
* Support for I2C bus bit-banging through the GPIO pins.grange2006-01-142-1/+218
| | | | | | | | | | | Now Soekris people can enjoy our fancy I2C stuff, too: nsclpcsio0 at isa0 port 0x2e/2: NSC PC87366 rev 9: GPIO VLM TMS gpio1 at nsclpcsio0: 29 pins gpioiic0 at gpio1 pins 17 19 iic0 at gpioiic0 maxds0 at iic0 addr 0x48: ds1624, starting maxds1 at iic0 addr 0x49: ds1624, starting
* Finish framework for attaching kernel drivers to the GPIO pins.grange2006-01-053-12/+109
| | | | Not used yet.
* Cosmetics...tdeval2005-03-081-2/+2
| | | | | Mainly remove space between locators parens, replace spaces with tabs where appropriate and consistently align dependencies.
* Let gpio_detach() do something useful.grange2004-11-231-2/+14
| | | | Tested by reyk@ on gpio@ath.
* added detach function to support hotpluggable gpios.reyk2004-11-221-2/+10
| | | | ok grange@
* Tweak in comment.grange2004-09-151-2/+2
|
* A framework for supporting various General Purpose Input/Output (GPIO)grange2004-06-033-0/+311
devices. Such devices provide a set of pins that you can use to connect for example leds to it. The pins can be accessed either from userland through the /dev/gpio* device files or from the kernel drivers. The latter is necessary for implementing timing-sensitive things like i2c or 1-wire master controller. ok deraadt@