summaryrefslogtreecommitdiff
path: root/sys/dev/pcf
AgeCommit message (Collapse)Author
2025-06-21newbus: replace leftover device unit wildcardsAhmad Khalifa
Reviewed by: imp, jhb Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D50913
2025-01-02bus_generic_detach: Delete children after detaching themJohn Baldwin
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
2024-12-06Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin
Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
2023-11-26sys: Automated cleanup of cdefs and other formattingWarner Losh
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
2023-08-16sys: Remove $FreeBSD$: one-line .c patternWarner Losh
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16sys: Remove $FreeBSD$: two-line .h patternWarner Losh
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-05-12spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
2022-05-09pcf: Remove unused devclass argument to DRIVER_MODULE.John Baldwin
2022-05-06Remove unused iicbus_devclass.John Baldwin
2020-09-01pcf: clean up empty lines in .c and .h filesMateusz Guzik
Notes: svn path=/head/; revision=365179
2020-02-03Remove sparc64 kernel supportWarner Losh
Remove all sparc64 specific files Remove all sparc64 ifdefs Removee indireeect sparc64 ifdefs Notes: svn path=/head/; revision=357455
2019-01-27pcf(4): fix parentheses in if conditionAndriy Voskoboinyk
PR: 210709 Submitted by: David Binderman <dcb314@hotmail.com> MFC after: 5 days Notes: svn path=/head/; revision=343496
2017-11-27sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
2016-05-03sys/dev: minor spelling fixes.Pedro F. Giffuni
Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
2016-04-10Cleanup unnecessary semicolons from the kernel.Pedro F. Giffuni
Found with devel/coccinelle. Notes: svn path=/head/; revision=297793
2016-01-27Convert rman to use rman_res_t instead of u_longJustin Hibbits
Summary: Migrate to using the semi-opaque type rman_res_t to specify rman resources. For now, this is still compatible with u_long. This is step one in migrating rman to use uintmax_t for resources instead of u_long. Going forward, this could feasibly be used to specify architecture-specific definitions of resource ranges, rather than baking a specific integer type into the API. This change has been broken out to facilitate MFC'ing drivers back to 10 without breaking ABI. Reviewed By: jhb Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D5075 Notes: svn path=/head/; revision=294883
2015-10-09Use IIC_EBUSBSY and IIC_BUSERR status values consistantly across all drivers.Ian Lepore
Make it clearer what each one means in the comments that define them. IIC_BUSBSY was used in many places to mean two different things, either "someone else has reserved the bus so you have to wait until they're done" or "the signal level on the bus was not in the state I expected before/after issuing some command". Now IIC_BUSERR is used consistantly to refer to protocol/signaling errors, and IIC_BUSBSY refers to ownership/reservation of the bus. Notes: svn path=/head/; revision=289093
2012-03-15Make ofw_bus_get_node() consistently return -1 when there is no associatedNathan Whitehorn
OF node, instead of a random mixture of 0 and -1. Update all checks for 0 to check for -1 instead. MFC after: 4 weeks Notes: svn path=/head/; revision=233018
2009-06-11strict kobj signatures: fix iicbus_write impl in dev/pcfAndriy Gapon
input buf is const Reviewed by: imp, current@ Approved by: jhb (mentor) Notes: svn path=/head/; revision=194026
2008-08-05- Consolidate module version for the pcf module into just pcf.c insteadJohn Baldwin
of having duplicate versions in each bus attachment. - Add a DRIVER_MODULE() instance so that the iicbus(4) driver will actually attach to pcf(4) driver instances. - Fix compile of envctrl.c. Pointy hat: jhb (3) Notes: svn path=/head/; revision=181332
2008-08-04Add locking to the various iicbus(4) bridge drivers:John Baldwin
- Just grab Giant in the ixp425_iic(4) driver since this driver uses a shared address/data register window pair to access the actual I2C registers. None of the other ixp425 drivers lock access to these shared address/data registers yet and that would need to be done before this could use any meaningful locking. - Add locking to the interrupt handler and 'iicbus_reset' methods of the at91_twi(4) driver. - Add locking to the pcf(4) driver. Other pcf(4) fixes include: - Don't needlessly zero the softc. - Use bus_foo rather than bus_space_foo and remove bus space tag and handle from softc. - The lpbb(4) driver just grabs Giant for now. This will be refined later when ppbus(4) is locked. - As was done with smbus earlier, move the DRIVER_MODULE() lines to match the bus driver (either iicbus or iicbb) to the bridge driver into the bridge drivers. Tested by: sam (arm/ixp425) Notes: svn path=/head/; revision=181303
2007-03-21Don't call bus_deactivate_resource() explicitly before callingYoshihiro Takahashi
bus_release_resource(). This is needed for pc98 by upcoming nexus related change. Notes: svn path=/head/; revision=167753
2007-02-23o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati
bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@ Notes: svn path=/head/; revision=166901
2006-02-22- Use bus_setup_intr() and bus_teardown_intr() to register device driverJohn Baldwin
interrupt handlers rather than BUS_SETUP_INTR() and BUS_TEARDOWN_INTR(). Uses of the BUS_*() versions in the implementation of foo_intr methods in bus drivers were not changed. Mostly this just means that some drivers might start printing diagnostic messages like [FAST] when appropriate as well as honoring mpsafenet=0. - Fix two more of the ppbus drivers' identify routines to function correctly in the mythical case of a machine with more than one ppbus. Notes: svn path=/head/; revision=155921
2006-02-02If the device has a PNPID, don't bother to attach. There were someWarner Losh
instances where the probe that was here would falsely grab a device. Notes: svn path=/head/; revision=155233
2005-06-04Account for ebus(4) defaulting to SYS_RES_MEMORY for memory resourcesMarius Strobl
since ebus.c rev. 1.22. Notes: svn path=/head/; revision=146966
2004-08-12- Introduce an ofw_bus kobj-interface for retrieving the OFW node and aMarius Strobl
subset ("compatible", "device_type", "model" and "name") of the standard properties in drivers for devices on Open Firmware supported busses. The standard properties "reg", "interrupts" und "address" are not covered by this interface because they are only of interest in the respective bridge code. There's a remaining standard property "status" which is unclear how to support properly but which also isn't used in FreeBSD at present. This ofw_bus kobj-interface allows to replace the various (ebus_get_node(), ofw_pci_get_node(), etc.) and partially inconsistent (central_get_type() vs. sbus_get_device_type(), etc.) existing IVAR ones with a common one. This in turn allows to simplify and remove code-duplication in drivers for devices that can hang off of more than one OFW supported bus. - Convert the sparc64 Central, EBus, FHC, PCI and SBus bus drivers and the drivers for their children to use the ofw_bus kobj-interface. The IVAR- interfaces of the Central, EBus and FHC are entirely replaced by this. The PCI bus driver used its own kobj-interface and now also uses the ofw_bus one. The IVARs special to the SBus, e.g. for retrieving the burst size, remain. Beware: this causes an ABI-breakage for modules of drivers which used the IVAR-interfaces, i.e. esp(4), hme(4), isp(4) and uart(4), which need to be recompiled. The style-inconsistencies introduced in some of the bus drivers will be fixed by tmm@ in a generic clean-up of the respective drivers later (he requested to add the changes in the "new" style). - Convert the powerpc MacIO bus driver and the drivers for its children to use the ofw_bus kobj-interface. This invloves removing the IVARs related to the "reg" property which were unused and a leftover from the NetBSD origini of the code. There's no ABI-breakage caused by this because none of these driver are currently built as modules. There are other powerpc bus drivers which can be converted to the ofw_bus kobj-interface, e.g. the PCI bus driver, which should be done together with converting powerpc to use the OFW PCI code from sparc64. - Make the SBus and FHC front-end of zs(4) and the sparc64 eeprom(4) take advantage of the ofw_bus kobj-interface and simplify them a bit. Reviewed by: grehan, tmm Approved by: re (scottl) Discussed with: tmm Tested with: Sun AX1105, AXe, Ultra 2, Ultra 60; PPC cross-build on i386 Notes: svn path=/head/; revision=133589
2004-08-11Unbreak after struct resource was hidden. Tested with EBus front-end onMarius Strobl
Sun AXe board. Notes: svn path=/head/; revision=133522
2004-07-04Consistently use __inline instead of __inline__ as the former is an empty macroStefan Farfeleder
in <sys/cdefs.h> for compilers without support for inline. Notes: svn path=/head/; revision=131575
2004-06-10Add a first version of a pcf(4) front-end for the Sun i2c devices ("i2c"Marius Strobl
is the actual name here) on EBus and which are PCF8584 (on systems having a boot-bus controller the i2c are said to not be a PCF8584). Similar to the SUNW,envctrl devices, onboard slaves for monitoring fans, temperatures and such hang off of these i2c devices. But there's also stuff like EEPROMs housing the hostid of the system and the boards usally have a connector to add custom slave devices (on CP1500 there's actually a second PCF8584 with its own I2C bus for these). This driver already works fine but I'm not yet sure if access to the slave devices on CP1400/CP1500 marked as "reserved for factory use" in the docs should be blocked (most likely these are the voltage controllers wich aren't meant to be controller by software and even not by the firmware). Once the issues with polled mode are fixed in the common pcf(4) part in pcf.c, this front-end should probably honour the poll-mode property of the i2c devices. Tested on Ultra AXe and CP1500 (Netra t1 100). OK'ed by: joerg, nsouch Notes: svn path=/head/; revision=130320
2004-06-10- Add missing <sys/module.h>.Marius Strobl
- Use "envctrl" as the name when registering this module rather than "pcf"; we can't have "pcf" as the name for all pcf(4) front-ends or we would get conflicts. OK'ed by: joerg Notes: svn path=/head/; revision=130319
2004-06-10- Add missing <sys/module.h>.Marius Strobl
- s,pcf_,pcf_isa, to better reflect the purpose of this front-end and to avoid conflicts. - Don't use this front-end for attaching to EBus, declaring it as an EBus driver was a cut&paste accident according to joerg. OK'ed by: joerg, nsouch Notes: svn path=/head/; revision=130318
2004-06-10- #define\tFOO\tBARMarius Strobl
- Remove two tabs from an otherwise empty line. OK'ed by: nsouch Notes: svn path=/head/; revision=130317
2004-05-31Necessary modifications do get pcf working again for ISA. Tested withNicolas Souchu
my Elektor card. Note that the hints are necessary to specify the IO base of the pcf chip. This enables to check the IO base when the probe routine is called during ISA enumeration. The interrupt driven code is mixed with polled mode, which is wrong and produces supposed spurious interrupts at each access. I still have to work on it. Notes: svn path=/head/; revision=129893
2004-05-25Round #1 of improving pcf(4).Joerg Wunsch
This splits the driver into a bus-independant backend, plus bus-specific frontends. The old pcf(4) (i386/ISA) frontend is now in pcf_isa.c, the frontend in envctrl.c is for sparc64/Ebus2 (Sun device name: SUNW,envctrl from Sun E450 machines). More frontends are expected to appear in future. This is not yet ready for public consumption, but it basically works. Nicolas will bring over his ISA-specific fixes soon. Reviewed by: nsouch Notes: svn path=/head/; revision=129704
2004-03-14Remove isa compat stuff.Warner Losh
Only cy, bs and wd in the tree still use it. I have a replacement for cy that I need to test on ISA and PCI cards. bs and wd are pc98 only drivers that appear to no longer be necessary. I'll be removing them when I hear back from the pc98 people. Notes: svn path=/head/; revision=126996
2003-06-20fix another LP64 problem. READ_IVAR takes a pointer to an uintptr_t, notJohn-Mark Gurney
an int. Notes: svn path=/head/; revision=116599
2003-06-02Use __FBSDID().David E. O'Brien
Notes: svn path=/head/; revision=115703
2003-01-01Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,Jens Schweikhardt
especially in troff files. Notes: svn path=/head/; revision=108533
2002-03-25Fix bktr and pcf compilation with LINTNicolas Souchu
Notes: svn path=/head/; revision=93165
2001-12-10Update to C99, s/__FUNCTION__/__func__/,David E. O'Brien
also don't use ANSI string concatenation. Notes: svn path=/head/; revision=87599
2000-10-15Remove unneeded #include <machine/clock.h>Poul-Henning Kamp
Notes: svn path=/head/; revision=67164
2000-04-19Remove ~25 unneeded #include <sys/conf.h>Poul-Henning Kamp
Remove ~60 unneeded #include <sys/malloc.h> Notes: svn path=/head/; revision=59391
2000-01-14Port of ppbus standalone framework to the newbus system.Nicolas Souchu
Note1: the correct interrupt level is invoked correctly for each driver. For this purpose, drivers request the bus before being able to call BUS_SETUP_INTR and BUS_TEARDOWN_INTR call is forced by the ppbus core when drivers release it. Thus, when BUS_SETUP_INTR is called at ppbus driver level, ppbus checks that the caller owns the bus and stores the interrupt handler cookie (in order to unregister it later). Printing is impossible while plip link is up is still TRUE. vpo (ZIP driver) and lpt are make in such a way that using the ZIP and printing concurrently is permitted is also TRUE. Note2: specific chipset detection is not done by default. PPC_PROBE_CHIPSET is now needed to force chipset detection. If set, the flags 0x40 still avoid detection at boot. Port of the pcf(4) driver to the newbus system (was previously directly connected to the rootbus and attached by a bogus pcf_isa_probe function). Notes: svn path=/head/; revision=55939
1999-12-03Remove the 'ivars' arguement to device_add_child() andMatthew N. Dodd
device_add_child_ordered(). 'ivars' may now be set using the device_set_ivars() function. This makes it easier for us to change how arbitrary data structures are associated with a device_t. Eventually we won't be modifying device_t to add additional pointers for ivars, softc data etc. Despite my best efforts I've probably forgotten something so let me know if this breaks anything. I've been running with this change for months and its been quite involved actually isolating all the changes from the rest of the local changes in my tree. Reviewed by: peter, dfr Notes: svn path=/head/; revision=54073
1999-10-11Trim some unused #includesPeter Wemm
Submitted by: phk Notes: svn path=/head/; revision=52123
1999-08-28$Id$ -> $FreeBSD$Peter Wemm
Notes: svn path=/head/; revision=50477
1999-07-29Alter the behavior of sys/kern/subr_bus.c:device_print_child()Matthew N. Dodd
- device_print_child() either lets the BUS_PRINT_CHILD method produce the entire device announcement message or it prints "foo0: not found\n" Alter sys/kern/subr_bus.c:bus_generic_print_child() to take on the previous behavior of device_print_child() (printing the "foo0: <FooDevice 1.1>" bit of the announce message.) Provide bus_print_child_header() and bus_print_child_footer() to actually print the output for bus_generic_print_child(). These functions should be used whenever possible (unless you can just use bus_generic_print_child()) The BUS_PRINT_CHILD method now returns int instead of void. Modify everything else that defines or uses a BUS_PRINT_CHILD method to comply with the above changes. - Devices are 'on' a bus, not 'at' it. - If a custom BUS_PRINT_CHILD method does the same thing as bus_generic_print_child(), use bus_generic_print_child() - Use device_get_nameunit() instead of both device_get_name() and device_get_unit() - All BUS_PRINT_CHILD methods return the number of characters output. Reviewed by: dfr, peter Notes: svn path=/head/; revision=49195
1999-05-08Move the declaration of the interrupt type from the driver structureDoug Rabson
to the BUS_SETUP_INTR call. Notes: svn path=/head/; revision=46743
1999-05-06Missing 'int' in declaration of variables.Peter Wemm
Notes: svn path=/head/; revision=46573