aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/iicbus/controller
Commit message (Collapse)AuthorAgeFilesLines
* newbus: replace leftover device unit wildcardsAhmad Khalifa2025-06-212-2/+3
| | | | | | Reviewed by: imp, jhb Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D50913
* machine/stdarg.h -> sys/stdarg.hBrooks Davis2025-06-111-1/+1
| | | | | | | | | | | | | Switch to using sys/stdarg.h for va_list type and va_* builtins. Make an attempt to insert the include in a sensible place. Where style(9) was followed this is easy, where it was ignored, aim for the first block of sys/*.h headers and don't get too fussy or try to fix other style bugs. Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595
* QCOM GENI I²C driverPoul-Henning Kamp2025-04-083-0/+877
| | | | | | | | | | | | | | | This is a from scratch, minimally viable, I²C driver for QCOM's GENI serial engine. No QCOM documentation is available, so other FOSS device drivers were consulted to figure things out The driver works on T14s G6 "Snapdragon" hardware, to such a degree that ACPI clients and HID devices work (polling mode & needs modifications to iichid) Differential Revision: https://reviews.freebsd.org/D49676 Reviews by: adrian
* Remove now-redundant calls to device_delete_childrenJohn Baldwin2025-01-021-1/+0
| | | | | | | Earlier calls to bus_generic_detach now take care of deleting children. Differential Revision: https://reviews.freebsd.org/D47962
* bus_generic_detach: Delete children after detaching themJohn Baldwin2025-01-024-20/+1
| | | | | | | | | | | | | | | | | This provides better semantics as a standalone DEVMETHOD for device_attach as bus drivers should remove child devices they created as part of detach cleanup. The implementation calls bus_detach_children() first to permit child devices an opportunity to veto the detach operation. If that succeeds, device_delete_children() is used to delete the child devices. This requires fixing various drivers that were deleting devices explicitly (via a device_t pointer cached in the softc) after calling bus_generic_detach to stop doing that and just rely on bus_generic_detach to remove child devices. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47959
* bus_delayed_attach_children: Switch return type to voidJohn Baldwin2024-12-061-1/+2
| | | | | | | This function never fails similar to bus_attach_children. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47677
* Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin2024-12-064-4/+4
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
* vf_i2c: Don't hold a mutex across bus_generic_detachJohn Baldwin2024-10-311-7/+7
| | | | | | | This was also leaking the lock if bus_generic_detach failed. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47221
* Use bus_delayed_attach_children instead of its inline implementationJohn Baldwin2024-10-211-1/+1
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47186
* newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh2024-07-254-4/+4
| | | | Sponsored by: Netflix
* rk_i2c: use the register read mode even if the read ends with IIC_M_NOSTOPAndriy Gapon2024-06-271-1/+1
| | | | | | Tested with max44009(4). MFC after: 2 weeks
* rk_i2c: emulate repeated startAndriy Gapon2024-06-271-12/+22
| | | | | | | | | | | | | | | | | | | | | rk_i2c_send_stop is modified so that it sends a stop condition, like it always did, if there is no IIC_M_NOSTOP flag. But if the flag is set then the function completely resets the control register and sets the driver state to transfer completed. Something like this was previously done for a write with IIC_M_NOSTOP. Now it is done for a read with IIC_M_NOSTOP as well. Linux code says that the hardware does not support the repeated start condition and the documentation, indeed, does not mention it. But according to the Linux driver clearing the control register and then sending a start condition acts as if it were a repeated start. While here, add braces around a single-line 'if' branch to balance it with a multi-line 'else' branch. Tested with max44009(4). MFC after: 2 weeks
* vf_i2c: update I2C controller logicPierre-Luc Drouin2024-03-294-92/+65
| | | | | | | | | | | Update the I2C controller logic to be more consistent with the newer version of the controller reference manual. This makes it work better on modern LS/LX platforms and avoids unnecessary delays. Also fixes a lock leak. MFC after: 7 days Tested by: bz (LS1088a FDT), Pierre-Luc Drouin (Honeycomb, ACPI) Differential Revision: https://reviews.freebsd.org/D44021
* vf_i2c: split up and add ACPI attachments in addition to FDTPierre-Luc Drouin2024-03-294-0/+911
| | | | | | | | | | | Move the code from the arm specific to the iicbus controller directory. Split up between general logic and bus attachment code. Add support for ACPI attachment in addition to FDT. MFC after: 7 days Tested by: bz (LS1088a FDT), Pierre-Luc Drouin (Honeycomb, ACPI) Based on: D24917 by Val Packett (initial early version) Differential Revision: https://reviews.freebsd.org/D44020
* hwreset: Move reset code in dev/hwresetEmmanuel Vadot2024-01-101-1/+1
| | | | | | | | | | | We've removed kernel option EXT_RESOURCES almost two years ago. While it was ok to have some code under a common 'extres' subdirectory at first, we now have a lot of consumer of it and we made it mandatory so no need to have it under a cryptic name. Reviewed by: imp Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43192
* clk: Move clock code in dev/clkEmmanuel Vadot2024-01-106-6/+6
| | | | | | | | | | | We've removed kernel option EXT_RESOURCES almost two years ago. While it was ok to have some code under a common 'extres' subdirectory at first, we now have a lot of consumer of it and we made it mandatory so no need to have it under a cryptic name. Reviewed by: mhorne Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43191
* iicbus: Move rockchip driver into the common directoryEmmanuel Vadot2024-01-101-0/+731
| | | | | | | | | | No need to keep it under sys/arm64/rockchip It's easier to find which controller we support by looking under one directory. While here remove the condition on SOC option, device rk_i2c is enough as all Rockchip SoC that we support have this controller. Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43184
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-277-7/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* i2c: Add cadence iic driverEmmanuel Vadot2023-10-031-0/+707
| | | | | | | This IP is found in Xilinx SoC, it only been tested on ZynqMP (arm64) so only enable it there for now. Differential Revision: https://reviews.freebsd.org/D41994
* iicbus: Move opencores i2c driver into controller subdirectoryEmmanuel Vadot2023-10-034-0/+711
| | | | | Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D41914
* iicbus: Move twsi under a new controller subdirectoryEmmanuel Vadot2023-10-034-0/+1343
The folder is a mess so start moving stuff into sub-directories. Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D41907