summaryrefslogtreecommitdiff
path: root/sys/dev/gpio
AgeCommit message (Collapse)Author
2023-06-24Fix typo in comment.msaitoh
2023-05-10gpiosim(4): Use config_detach_children.riastradh
2023-05-10gpioow(4): Use config_detach_children.riastradh
2023-05-10gpioiic(4): Use config_detach_children.riastradh
2022-12-13Never fib about pin count in GPIOINFO ioctl results. The number of pinsjakllsch
on a controller simply does not change depending on the privileges of the caller.
2022-04-27I have been using this for a while and forgot to commit it. This addbrad
a number of KERNEL_LOCK() calls and at the very least prevents gpioiic from panicing the system. This may be a fix for kern/56438.
2022-03-31For device modules that provide both auto-config and /dev/xxxpgoyette
interfaces, make sure that initialization and destruction follow the proper sequence. This is triggered by the recent changes to the devsw stuff; per riastradh@ the required call sequence is: devsw_attach() config_init_component() or config_cf*_attach() ... config_fini_component() or config_cf*_detach() devsw_detach() While here, add a few missing calls to some of the detach routines. Testing of these changes has been limited to: 1. compile without build break 2. no related test failures from atf 3. modload/modunload work as well as before. No functional device testing done, since I don't have any of these devices. Let me know of any damage I might cause here! XXX Some of the modules affected by this commit are already XXX broken; see kern/56772. This commit does not break any additional modules (as far as I know).
2022-03-29gpiopps module requires the gpio module to resolve several symbolspgoyette
2022-01-17When initializing pins, try to get the default pin name from thethorpej
"gpio-line-names" property. If not present, then fall back on the default name for the pin from the parent, if there is one.
2021-09-21use l->l_cred since it is available.christos
2021-08-09fix various typos in compatibility, mainly in comments.andvar
2021-08-07Merge thorpej-cfargs2.thorpej
2021-04-24Merge thorpej-cfargs branch:thorpej
Simplify and make extensible the config_search() / config_found() / config_attach() interfaces: rather than having different variants for which arguments you want pass along, just have a single call that takes a variadic list of tag-value arguments. Adjust all call sites: - Simplify wherever possible; don't pass along arguments that aren't actually needed. - Don't be explicit about what interface attribute is attaching if the device only has one. (More simplification.) - Add a config_probe() function to be used in indirect configuiration situations, making is visibly easier to see when indirect config is in play, and allowing for future change in semantics. (As of now, this is just a wrapper around config_match(), but that is an implementation detail.) Remove unnecessary or redundant interface attributes where they're not needed. There are currently 5 "cfargs" defined: - CFARG_SUBMATCH (submatch function for direct config) - CFARG_SEARCH (search function for indirect config) - CFARG_IATTR (interface attribte) - CFARG_LOCATORS (locators array) - CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles) ...and a sentinel value CFARG_EOL. Add some extra sanity checking to ensure that interface attributes aren't ambiguous. Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark ports to associate those device handles with device_t instance. This will trickle trough to more places over time (need back-end for pre-OFW Sun OBP; any others?).
2019-12-22Cleanup i2c bus acquire / release, centralizing all of the logic intothorpej
iic_acquire_bus() / iic_release_bus(). "acquire" and "release" hooks no longer need to be provided by back-end controller drivers (only if they need special handling, e.g. powering on the i2c controller). This results in the removal of a bunch of rendundant code from each back-end controller driver. Assert that we are not in hard interrupt context in iic_acquire_bus(), iic_exec(), and iic_release_bus().
2019-12-06localifymaxv
2019-11-30onewire:ad
- Re-do the signalling to be a little more forgiving and efficient. - If bus reset fails during probe, try a second time. - Spread out kernel threads for many busses to avoid thundering herd effect.
2019-10-20gpio: make GPIOREAD return also the symbolic name of the pin, if it is settnn
2019-10-15convert more KM_NOSLEEP to KM_SLEEP and remove code to handle failures.chs
2019-01-27Merge the [pgoyette-compat] branchpgoyette
2018-06-01Fix a paste-o that prevented the 2-pin interrupt messages from beingthorpej
printed correctly (but no other harmful effects). Pointed out by Brad Spencer.
2018-05-20Add a 1PPS-over-GPIO driver, originally by Brad Spencer, with changes bythorpej
me to adapt to the new GPIO interrupt interface and support a wider variety of GPIO pin configuations. PR kern/51676
2018-05-19Add an example "gpioirq" driver that demonstrates interrupts on GPIOthorpej
pins. Will be enhanced in the future to support sending events to user space on edge-triggered interrupt events. Based on initial work by Brad Spencer. PR kern/51676
2018-05-19Overhaul of GPIO interrupt support (that wasn't even used by anything).thorpej
- Remove the old, not-expressive-enough interrupt flags, and replace them with a new set of interrupt-specific flags that can express a wide variety of interrupt configurations (pos, neg, and double-edge, high and low level). - Remove old, unused gpio_pin_ctl_intr() and gpio_pin_irqen(), and replace them with gpio_intr_establish(), gpio_intr_disestablish(), and gpio_intr_str(). Corresponding fields in the gpio_chipset_tag are also added for back-end controllers, which now handle the actual dispatch of GPIO interrupts in order to properly support level-triggered interrupts as well as interoperate properly with FDT-registered interrupts. Piggy-back on the 8.99.18 version bump. Inspired by initial work from Brad Spencer. PR kern/51676
2017-10-28Kill some more extern struct cfdriver declarations.riastradh
Down with externs in .c!
2017-07-06Let the controller provide a default name for pins. This makes pins easierjmcneill
to locate when we have multiple banks and a variable number of pins per bank.
2017-01-20Check pmf_device_register return value. NFCmaya
Appeases static analyzers.
2016-07-14- Use aprint*() instead of printf() in xxx_attach().msaitoh
- Add missing aprint_naive("\n"); - KNF
2016-05-11As proposed inbouyer
http://mail-index.netbsd.org/tech-kern/2016/04/28/msg020504.html add gpio interrupt support to the gpio framework, and an implementation for the allwinner gpio backend (tested on A20 only). gpio(4) has new public functions: - gpio_intr() called by backends when an interrupt condition for a gpio pin is present - gpio_find_device() and gpio_get_name(), support functions for gpio(4) users, wich respectively returns a void * cookie for a gpio device given its name, and returns the name given the cookie. - gpio_pin_ctl_intr(), which is used to configure interrupts on a gpio pin and registers a callback. - gpio_pin_irqen(), which is used to mask/unmask interrupts on a pin. Nothing in the NetBSD tree uses this yet, but I have a i2c driver (at https://github.com/mbouyer/marine_chartplotter/tree/master/software/NetBSD/driver) which uses it.
2015-10-15pull in sysmon_taskqjmcneill
2015-10-04Use sysmon_taskq instead of our own workqueue for submitting button events.jmcneill
2015-09-01i2c_acquire_bus() should return 0 on success.phx
Fixed bug in gpioiic_bb_set_bits(), which was introduced with the SDA/SCL- reverse feature. Now the driver is confirmed to work. Tested with Raspberry Pi GPIO.
2015-08-20include "ioconf.h" to get the 'void <driver>attach(int count);' prototype.christos
2015-08-20Use needs-count for # of pseudo instances; suggested by cube@.uebayasi
2015-05-30remove debug printfjmcneill
2015-05-30Simple driver for GPIO power/sleep buttons.jmcneill
2015-05-29Simple driver for gpio control of rf enable/disable pins.jmcneill
2014-07-25Add d_discard to all struct cdevsw instances I could find.dholland
All have been set to "nodiscard"; some should get a real implementation.
2014-06-29make implementation match gpio(4) man entry. do no change configurationkardel
if no flags are being set (allows non-destructive inquiry via GPIOSET again).
2014-05-23Add aprint_naive("\n") for boot -qmsaitoh
2014-04-04PR/48701: Timo Buhrmester: spurious messages while booting silently (gpio,christos
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-03-16Change (mostly mechanically) every cdevsw/bdevsw I can find to usedholland
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-02-25Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist beforepooka
the sysctl link sets are processed, and remove redundancy. Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate lines of code.
2013-05-20Make the gpiosim(4) device a 64 bit wide GPIO.mbalmer
2013-05-20When returning the old value, use the value read from the device.mbalmer
2012-10-27split device_t/softc for all remaining drivers.chs
replace "struct device *" with "device_t". use device_xname(), device_unit(), etc.
2012-10-17Quiet down autoconfiguration by changing some printf() calls todyoung
aprint_normal() calls.
2012-06-02Add some pre-processor magic to verify that the type of the data itemdsl
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.
2011-11-25Don't ignore the gpiobus_close() return value. Found by joerg@ using clang.mbalmer
2011-11-14Initialize ga.ga_dvname in gpio_search to prevent a stack fault in config_matchmbalmer
2011-11-13Remove an unused variable.mbalmer