Commit Graph

470 Commits

Author SHA1 Message Date
Warner Losh
031beb4e23 sys: Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:54:58 -06:00
Warner Losh
685dc743dc sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:36 -06:00
Warner Losh
95ee2897e9 sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:11 -06:00
Emmanuel Vadot
ddefad7c4f arm64: rockchip: Tweak i2c, pmic and iodomain order
We need i2c first to set it to MIDDLE, then we need one of the pmics
so set them to LATE, only then we can attach iodomain which needs some
regulators exposed by the pmic so set it to LAST.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-08-08 15:58:26 +02:00
Vladimir Kondratyev
4b1712817e hid: Add child device parameter to HID methods
Some devices like Apple HID-over-SPI may contain more than one report
descriptors necessitating creation of multiple hidbus children.
Add indentificator of child devices to distinct them.
No functional changes intended.

Differential Revision:	https://reviews.freebsd.org/D41246
2023-08-03 19:10:50 +03:00
Warner Losh
eebd9d5366 spdx: Simplify BSD-2-Clause AND BSD-2-Clause
After removing the -FreeBSD and -NetBSD, we're left with a nuber of
BSD-2-Clause AND BSD-2-Clause, so tidy that up.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:04 -06:00
Warner Losh
b61a573019 spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD
The SPDX folks have obsoleted the BSD-2-Clause-NetBSD 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
2023-05-12 10:44:04 -06:00
Warner Losh
4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
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
2023-05-12 10:44:03 -06:00
Zhenlei Huang
deac4c7f07 iicbus(4): Use the existing CTLFLAG_RWTUN flag definition
Use it when possible, instead of separated flags.

No functional change intended.

Reviewed by:	hselasky, erj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D39466
2023-04-12 12:20:38 +08:00
Justin Hibbits
da247e0dac Mechanically convert ic(4) to IfAPI
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37851
2023-02-06 12:32:12 -05:00
Ganbold Tsagaankhuu
90737b632e Use BSD-2-Clause for the SPDX license id as -FreeBSD variant has been deprecated. 2023-01-06 08:15:44 +00:00
Søren Schmidt
571e5792f9 Change probe priority so order is correct. 2022-12-24 12:33:42 +00:00
Wojciech Macek
9476c1675c lm75: fix typo
s/sesnor/sensor/
2022-12-05 07:30:12 +01:00
Kornel Dulęba
6f9c622690 rx8803: Improve probing logic
Add a PNP macro in order to load this driver automatically.
While here check if the device is enabled in DT before probing it.

Reviewed by:	wma
Sponsored by:	Alstom
Obtained from:	Semihalf
Differential Revision: https://reviews.freebsd.org/D37579
2022-12-01 10:14:58 +01:00
Jakub Kolodziej
da35578998 lm75: Refactor code to fix io error
Use correct resolution by compat table. If dtb is not defined use default 9 bit mode.
11 bit detection is called if 9 bit mode is used.
Sysctl resolution variable is added to change resolution in case.
Some sensors didn't pull ACK while reading from nonexistent registers and it caused I2C
read error and detect failure, so now detect failure does not cause driver break.

Obtained from:		Semihalf
Sponsored by:		Alstom
Differential revision:	https://reviews.freebsd.org/D37497
2022-12-01 09:12:39 +01:00
Jakub Kołodziej
f1717ffd7a gpio: Fix typo causing GPIO configuration mismatch
Polarity inversion register was mistekanly filled with the value of
the direction configuration register.
Correct that.

Reviewed by:	kd
Obtained from:	Semihalf
Differential Revision: https://reviews.freebsd.org/D37262
2022-11-08 14:14:59 +01:00
Andrew Turner
47218e711e Include opt_platform.h to ensure FDT is defined
We need to include opt_platform.h as it's where FDT will be defined.

Sponsored by:	The FreeBSD Foundation
2022-10-04 17:38:56 +01:00
Jakub Kołodziej
b8a083ea32 gpio: Merge TCA6416 & TCA6408 drivers into TCA64XX
This merges TCA6416, TCA6408 drivers and adds PCA9555 support.
They handle 8 pin and 16 pin ICs with basic INPUT/OUTPUT functionality.
The register map is fairly similar so there is no point in having two
separate drivers.

Reviewed by:	kd
Obtained from:	Semihalf
Differential Revision: https://reviews.freebsd.org/D36559
2022-09-19 09:18:08 +02:00
Tetsuya Uemura
e2386f18ec nxprtc: Fix timing issue with register access.
My Adafruit PCF8523 RTC on either RPi2B or RPi3B+ failed to work around
80 ~ 90 % of boot-ups, by printing the following log lines.

nxprtc0: <NXP PCF8523 RTC> at addr 0xd0 on iicbus0
nxprtc0: cannot set up timer
Warning: no time-of-day clock registered, system time will not be set accurately

This is due to pcf8523_start_timer(sc) returned non-zero in
nxprtc_start() due to a register read failure of PCF8523_R_TMR_A_FREQ or
PCF8523_R_TMR_CLKOUT or a failure to program a new value.

The pause_sbt("nxpbat") sleep was too short and caused the register
access failures.

PR: 266093
2022-09-14 07:34:15 -06:00
Mateusz Kozyra
6665c7a628 TMP461: Add support for ADT7461 sensor
The register map is fairly similar, with one difference in the local
sensor temperature register width.
Both devices support reading two sensors - "local" and "remote".
While here add support for the latter one.
The ADT7461 doesn't update the temperature correctly, unless a write
transaction is done before every read.
Do just that as a workaround for this issue.

Tested on LS1046ARDB.

Reviewed by:	manu
Obtained from:	Semihalf
Differential Revision: https://reviews.freebsd.org/D36464
2022-09-09 13:42:28 +02:00
Albert Jakieła
59c2babcab mv_twsi: Use the clock API on armv7
With the addition of clkgen devices to the Armada38x, there is
no longer any need to use the get_tclk() hack.

Reviewed by:	manu
Obtained from:	Semihalf
Differential Revision: https://reviews.freebsd.org/D36456
2022-09-07 09:44:59 +02:00
Gordon Bergling
b0e86eed27 ltc430x(4): Fix a typo in a source code comment
- s/overriden/overridden/

MFC after:	3 days
2022-09-03 15:43:05 +02:00
Mathew McBride
2486b446db ds1307: add support for the EPSON RX-8035SA I2C RTC
The EPSON RX-8035SA I2C RTC has a similar time register layout to the
ds1307 family, with some minor differences in bit positions, polarity
and control registers.  Further generalize ds1307 to make it easier
to add more compatible chips and add support for the EPSON RX-8035SA.

MFC after:	6 days
Sponsored by:	Traverse Technologies
Differential Revision: https://reviews.freebsd.org/D35837
2022-09-02 00:51:42 +00:00
Søren Schmidt
90098ee30e Fix reading the correct ID and REV.
Reviewed by:	manu
2022-09-01 07:36:37 +00:00
Ganbold Tsagaankhuu
53b80f4d41 Add support for TCS4525 pmic.
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D36209
2022-09-01 07:31:08 +00:00
Søren Schmidt
66a3e51341 Add RockChip rk809/rk817 pmic support to existing
RockChip pmic drivers.

Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D36149
2022-08-16 07:55:18 +00:00
Bjoern A. Zeeb
97dbd37753 pca954x: harmonize pca9547 and pca954x and add pca9540 support
The two implementations for the pca9548 switch and the pca9547 mux
seemed close enough so we can put them together and with a bit more
abstraction add pca9540 support.

While here apply a bit of consistency in variable and driver naming and
use device_has_property instead of the FDT-only OF_ variant.

This disconnects pca9547 from the build but does not yet delete it.

MFC after:	2 weeks
Reviewed by:	mmel (earlier version), avg
Differential Revision: https://reviews.freebsd.org/D35701
2022-07-04 19:12:01 +00:00
Bjoern A. Zeeb
c4b98101c5 tca6416: add support for tca9539
Programming-wise tca6416 and tca9539 seem identical so all we have to
do is add the extra ofw_compat_data line.

MFC after:	2 weeks
Reviewed by:	mw
Differential Revision: https://reviews.freebsd.org/D35702
2022-07-03 22:11:30 +00:00
John Baldwin
3a86615217 iicbus: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-06 15:39:30 -07:00
John Baldwin
c6d3976514 Remove unused smbus_devclass. 2022-05-06 15:39:30 -07:00
John Baldwin
85447c525b Remove unused ofw_iicbus_devclass. 2022-05-06 15:39:30 -07:00
John Baldwin
676ea8e177 Remove unused iicbus_devclass. 2022-05-06 15:39:30 -07:00
John Baldwin
8c13dd83a3 Remove unused iicbb_devclass. 2022-05-06 15:39:30 -07:00
Gordon Bergling
7fad3ed8e9 iicbus(4): Fix two typos in kernel error messages
- s/occured/occurred/

MFC after:3 days
2022-04-20 12:55:44 +02:00
John Baldwin
dd636cb9d0 ad7417: Avoid an unused but set warning when compiled with NO_SYSCTL_DESCR.
Use a ternary operator for the description string passed to
SYSCTL_ADD_PROC instead of a helper variable.
2022-04-13 16:08:23 -07:00
John Baldwin
0a4089c734 gpio tca6416: Remove unused variable. 2022-04-13 16:08:22 -07:00
John Baldwin
773cfd2bf8 adt746x: Remove unused variables. 2022-04-12 14:58:58 -07:00
John Baldwin
d8e7d35acf iicoc: Remove unused variable. 2022-04-12 14:58:57 -07:00
John Baldwin
48c21c2155 tca6408: Remove unused variable. 2022-04-08 17:25:14 -07:00
Warner Losh
2d4ae2ed36 tmp461_signed_extend32 is unused, remove it
Sponsored by:		Netflix
2022-04-04 22:29:39 -06:00
Warner Losh
875145ffd4 rx8803_settime: remove write only variable bus
Sponsored by:		Netflix
2022-04-04 22:29:38 -06:00
Warner Losh
22127c7c1b tca6416: remove write only sc
Sponsored by:		Netflix
2022-04-04 22:29:36 -06:00
Vladimir Kondratyev
34e051c45c iichid(4): Add support for ASUS C300 chromebook.
Some chromebooks e.g. ASUS C300 have no valid _CID and _DSM ACPI
objects required for device identification and HID descriptor address
detection. Add quirk to allow required data to be hardcoded in to
driver.

MFC after:	2 month
2022-03-03 02:35:23 +03:00
Vladimir Kondratyev
6b1da3d223 iichid(4): Implement I2CRDWR command in hid_ioctl method
This command is intended to be compatible with I2CRDWR ioctl.
It is required to perform arbitrary I2C transfers by device
drivers which can switch between HID and native non-HID modes.

MFC after:	2 month
2022-03-03 02:35:23 +03:00
Warner Losh
cae7d9ec83 bus: Add ACPI locator support
Add support for printing ACPI paths. This is a bit of a degenerate case
for this interface since it's always just the device handle if the
device has one. But it is illustrtive of how to do this for a few nodes
in the tree.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32748
2022-03-01 08:06:41 -07:00
Emmanuel Vadot
36498b1408 twsi: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33823
2022-02-21 17:28:44 +01:00
Emmanuel Vadot
4f118605ad twsi: Plug set but not used variable
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-02-21 11:08:21 +01:00
Emmanuel Vadot
89f8aa7d41 pmic: rockchip: Plug set but not used variable
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-02-21 11:08:12 +01:00
Michal Meloun
7504f32c2e ofw_iicbus: Use uint32_t for iic bus address argument, not int.
The iicbus devinfo uses uint32_t for storing iic bus address and new method
should comply with this fact.

MFC with:	1bd3e8ba696633ccd7525030d951b58ade167814#
2022-02-20 14:17:50 +01:00
Michal Meloun
1bd3e8ba69 ofw_iicbus: Add method for manual setting of basic OFW parameters.
Some IIC multifunction devices may have multiple I2C addresses per chip, but
only the primary address is listed in the DT (e.g. MAX776200). In this case,
the sub-devices for the secondary addresses must be created manually with
fixed OFW parameters (node, name, compatibility string, IIC address).
Add a bus method to the ofw_iicbus interface that does this.

MFC after:	4 weeks
2022-02-20 12:25:58 +01:00