summaryrefslogtreecommitdiff
path: root/sys/dev/spi
AgeCommit message (Collapse)Author
2022-12-03Split the BMP280 / BME280 driver into common code and create I2C andbrad
SPI attachments.
2022-10-26fix various typos in comments and makefs README file.andvar
2022-05-17fix few typos in comments.andvar
2022-05-08Trailing whitespaceskrll
2022-03-28Fix sanity check for zero sized buffer.mlelstv
2022-01-19Use spi_compatible_lookup().thorpej
2022-01-19Provide a spi_compatible_lookup() function to go along withthorpej
spi_compatible_match().
2022-01-19Stash the device_t in spi_softc.thorpej
2022-01-19Try to fix the build.martin
2022-01-19Pass the device_t into spi_configure(), and make the API contract thatthorpej
spi_configure() will print errors if they occur; the driver is off the hook.
2022-01-19Probe / match routines should not have side-effects: do the spi_configure()thorpej
calls in the attach routines.
2022-01-17G/C mcpgpio_softc::sc_phandle; nothing is using it.thorpej
2022-01-17Re-factor and overhaul the "mcp23s17gpio" driver as "mcpgpio", andthorpej
add support for 8-bit and I2C variants of the chip: - MCP23008 / MCP23S08: 8-bit (I2C / SPI) - MCP23017 / MCP23S17: 16-bit (I2C / SPI) - MCP23018 / MCP23S18: 16-bit (I2C / SPI), open-drain outputs The MCP23x17 and MCP23x18 are essentially identical, software-wise; we merely report different GPIO pin capabilities (no push-pull output for MCP23x18). Also, remove the tri-state capability that was previously advertised by the old version of this driver; these chips have no way to put the pin into a HI-Z mode. All 3 I2C versions are supported, but the SPI front-end still only supports the MCP23S17 for now (SPI autoconfiguration needs an overhaul). mcp23s17gpio(4) remains present as a link to the new mcpgpio(4) man page. XXX Still to-do: FDT integration, interrupt suppoort.
2021-12-07A driver and user land utility for the Sparkfun Serial Controlled Motorbrad
Driver module as illustrated here: https://www.sparkfun.com/products/13911 A SCMD module is a ARM SOC simular to a Arduino in front of a motor driver chip. The single SCMD module can control two motors and up to 16 additional modules can be chained together using an internal I2C bus. One can interface with the SCMD using tty uart commands, SPI or I2C. The driver in this commit adds a kernel driver for the I2C and SPI interfaces. The command line utility provides a set of convenience commands that support most of the functions of the SCMD and is able to use the tty uart mode, SPI user land or the included kernel driver in a uniform manor. The use of the SCMD module is mostly for small robots and the like, but it can control anything that is controllable by voltage.
2021-08-19ssdfb: add support for SSD1306 and SH1106 at spi attachmenttnn
Only support the 4-wire mode for now. Support for 3-wire mode is theoretically possible but most (all?) modules in circulation have the BS0 / IM0 3-wire config pin internally grounded within the flat-flex assembly so it is not easy to enable & test.
2021-08-19ssdfb_spi: fix issues with command xfers needed for SSD1306 & SH1106tnn
These controllers require D/C# to be deasserted for the entire duration of the command, contrary to docs and how newer controllers like SSD1353 behave. Probably this is needed for all controllers that do not have the WRITE_RAM (0x5c) command. Also support using alternate padding commands for 3-wire mode when WRITE_RAM is not available.
2021-08-07Merge thorpej-cfargs2.thorpej
2021-08-05ssdfb: fix some constant names. NFC because the same cmd code is usedtnn
2021-08-05ssdfb: support SSD1353 at spi(4)tnn
2021-08-03ssdfb: support having an optional reset pintnn
2021-08-01ssdfb: support the 4-wire SPI interfacetnn
2021-07-24Fix all remaining typos, mainly in comments but also in few definitions and ↵andvar
log messages, reported by me in PR kern/54889. Also fixed some additional typos in comments, found on review of same files or typos.
2021-05-16Protect ioctl and declare MPSAFE.mlelstv
2021-05-14Replace aprint_error with aprint_error_dev in config_interrupts callback.jmcneill
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?).
2021-01-27Use DEVICE_COMPAT_EOL.thorpej
2021-01-18Change the device_compatible_match() function to only perform the match.thorpej
Introduce a device_compatible_lookup() function to return an entry based on the same matching criteria (a'la of_search_compatible()). Update iic_compatible_match() to reflect the above change, and introduce iic_compatible_lookup(). This pattern is less awkward to use.
2021-01-17Use designated initializers and a consistent termination style inthorpej
compat_data[].
2020-08-04Use mutex for lwp/interrupt coordination. using splX() simply does not workkardel
on multiprocessor systems. fixes PR kern/55506
2020-06-11Update for proplib(3) API changes.thorpej
2019-11-27Remove GPIO driver attach defer.hkenken
2019-11-26Change manufacturer to Micron from Numonyx.hkenken
N25Q -> MT25Q
2019-11-02add fdt device_compatible_entrytnn
2019-11-02fix hang when SSDFB_ATTACH_FLAG_CONSOLE used with spitnn
2019-11-02add spi(4) bus frontend for ssdfb(4)tnn
2019-09-14On second thought revert that. Let's open this can of worms some other day.tnn
2019-09-14KB -> kBtnn
2019-09-05Add support for Winbond W25Q128.V (128mb) chips, as found on newer lime2-emmcbouyer
boards. While there fix a missing \n in dmesg.
2019-08-21Make this at least compile - I have no way to test.martin
2019-08-19Fix typo.hkenken
2019-08-13m25p: add compatible entry for "jedec,spi-nor" and match on ittnn
2019-08-13spi: prepare for fdt direct attachment of spi slavestnn
Introduce sba_child_devices array in spibus_attach_args. If the parent has populated sba_child_devices then attach them first. Then do any devices devices the user has wired in the kernel config, if any.
2019-08-05spi: make the "slave" config(5) locator optionaltnn
needed to be able to support FDT direct attachment of SPI slaves
2019-08-04m25p: change devices recently added from 4kB "sector size" to 64kB ...tnn
... even though it is wrong and these devices really use 4kB sector size. Despite the struct member being named sector size it is actually used as block size. Our spiflash driver doesn't issue sector erase commands. Stopgap measure to fix data corruption until the driver is fixed.
2019-08-04m25p: add GigaDevice 25Q127CSIGtnn
(This is the boot ROM found on ROCKPro64.)
2019-08-03m25p: add some ~2010 vintage parts found in junk drawertnn
2019-08-03m25p: print vendor & device id before bailing out on unknown devicestnn
2019-07-04Avoid workqueue_check_duplication().hkenken
2019-03-09More input validation. Fix off-by-1 for size limit.mlelstv
2019-02-23Add userland driver to spi framework.mlelstv
Previously spi would configure the controller to use the lowest speed of all connected devices since the kernel started and to fail attempted mode changes. This is now improved to keep individual modes and speeds for each slave and to reconfigure the controller as necessary for each transfer. Added man page for spi(9).