| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
- s/slighly/slightly/
(cherry picked from commit fa3b320668ba6068014337bbbb05dbd39ac8dfb6)
|
| |
|
|
|
|
|
|
|
|
| |
Fall-through to non-FDT probe code if no matching device node is found.
While here, fix indentation of the switch statement.
Also, make the device description for the hints-based attachment the
same as for FDT attachment.
Fixes: 2486b446db ds1307: add support for the EPSON RX-8035SA I2C RTC
(cherry picked from commit 34694f3da7f9537c34b1878206c65a8cda16c6c0)
|
| |
|
|
|
|
|
|
|
|
| |
While "fast" taskqueue may be more expensive due to spinlock use,
when used mainly for timeout tasks it allows to avoid extra context
switches to and from callout thread, that is even more expensive.
MFC after: 1 month
(cherry picked from commit 358453ce9bdd99eb69641b02f2d7e29cedecbe27)
|
| |
|
|
|
|
|
|
|
|
| |
taskqueue_enqueue_timeout(0) is equivalent to taskqueue_enqueue(),
so no need to create a separate periodic_task and event_task to run
exactly the same handler.
MFC after: 1 month
(cherry picked from commit a8f80c0c16c7fb38c46ddccd7e1b06dc46c407b1)
|
| |
|
|
|
|
|
|
|
|
| |
My previous commit by reducing precision reduced the sampling rate
from 60Hz to 40Hz on idle system. Return it back to 60-80Hz range,
that should be good for mouse smoothness on 60Hz displays.
MFC after: 1 months
(cherry picked from commit 68e457df0268113646264883515412af4c8808cb)
|
| |
|
|
|
|
|
|
|
|
|
| |
It should make pause interval less strict.
While there, add cpu_spinwait() into a tight spin wait loop to burn
less power and let other SMT thread work more.
MFC after: 1 month
(cherry picked from commit a74df3f96e3ea4cc632088be870d9b0b0198859c)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In sampling mode some devices return same data indefinitely even if
there is nothing to report. Previous idle hysteresis implementation
activated only when device returned no data, so some devices ended up
polled at fast rate all the time. This new implementation compares
each new report with the previous, and, if they are identical, after
reaching threshold also drop sampling rate to slow.
On my Dell XPS 13 9310 with iichid(4) touchscreen and touchpad this
reduces idle power consumption by ~0.5W by reducing number of context
switches in the driver from ~4000 to ~700 per second when not touched.
MFC after: 1 month
(cherry picked from commit 8c86b981240324c1daaa387d4d3f8e3e53db3d2e)
|
| |
|
|
|
|
|
| |
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
Similar commit in current:
(cherry picked from commit 031beb4e239b)
|
| |
|
|
|
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
Similar commit in current:
(cherry picked from commit 685dc743dc3b)
|
| |
|
|
|
|
|
| |
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
Similar commit in current:
(cherry picked from commit 95ee2897e98f)
|
| |
|
|
|
|
|
|
|
|
|
| |
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
(cherry picked from commit eebd9d53665e1b691ffada910b940b37b6f62cc4)
|
| |
|
|
|
|
|
|
|
|
|
| |
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
(cherry picked from commit b61a573019428cbdc38ed03be9ecd2482011ea66)
|
| |
|
|
|
|
|
|
|
|
|
| |
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
(cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
(cherry picked from commit deac4c7f0753841de8da4d7f37d7e49620b3bbb4)
|
| |
|
|
|
|
|
|
|
| |
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.
(cherry picked from commit 34e051c45cfc25f74dbfaa42e0dee45d670fecd3)
|
| |
|
|
|
|
|
|
| |
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.
(cherry picked from commit 6b1da3d223a88d544439d1be4115714f0aee75be)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
(cherry picked from commit e2386f18eca2f6f75f7c5c2d49d603e3d2674509)
|
| |
|
|
|
|
| |
Sponsored by: Netflix
(cherry picked from commit 875145ffd48e1cad1e3aa2ee6c134d45523558b0)
|
| |
|
|
|
|
| |
Sponsored by: Netflix
(cherry picked from commit 22127c7c1b9c0f8feb73f13a829b8b757f2274eb)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
Sponsored by: Traverse Technologies
Differential Revision: https://reviews.freebsd.org/D35837
(cherry picked from commit 2486b446db8270a7d6dc7f3c6df0a88c4745b527)
|
| |
|
|
|
|
| |
- s/overriden/overridden/
(cherry picked from commit b0e86eed27ec98204978685d4d3dd384267dd60f)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Reviewed by: mmel (earlier version), avg
Sponsored by: Traverse Technologies (providing Ten64 HW for testing)
Differential Revision: https://reviews.freebsd.org/D35701
(cherry picked from commit 97dbd37753ae1bf9c4f6a23e46e21f0a9f408c82)
|
| |
|
|
|
|
|
|
|
|
|
| |
Programming-wise tca6416 and tca9539 seem identical so all we have to
do is add the extra ofw_compat_data line.
Reviewed by: mw
Sponsored by: Traverse Technologies (providing Ten64 HW for testing)
Differential Revision: https://reviews.freebsd.org/D35702
(cherry picked from commit c4b98101c5b1dc34d077f078d04d777df3cf9e38)
|
| |
|
|
|
|
| |
Sponsored by: Beckhoff Automation GmbH & Co. KG
(cherry picked from commit 4f118605ad5f8aa5df749e99ee9822f5f1c997b5)
|
| |
|
|
|
|
|
|
|
|
| |
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
(cherry picked from commit 36498b14083d5be64052e65bd7d1c81c1352dce4)
|
| |
|
|
|
|
| |
- s/occured/occurred/
(cherry picked from commit 7fad3ed8e9bdba1ad81a141a47544cd0481da8b9)
|
| |
|
|
|
|
|
|
| |
in sampling mode to workaround firmware bug.
This fixes reboot or poweroff on frame.work laptops after first touch.
(cherry picked from commit c508b0818b245ea136d6538d68868cb3541f8f8f)
|
| |
|
|
| |
(cherry picked from commit 46e0c03795443675f95db6da2195825d24a9fb7c)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make sure to reset 'message_done' flag when jumping from a message to the
next one within the same interrupt handler call. This happens only when
a write with no-stop flag message is followed by a write with no-start
flag message.
Without this fix the second message would be prematurely "completed"
without waiting for an ACK (or NACK) for its first byte and without
sending subsequent bytes (if any).
Fixes: ff1e8581 twsi: support more message combinations in transfers
(cherry picked from commit e5268c3d435e0a0f0fef64e6213504dd189272f6)
|
| |
|
|
|
| |
(cherry picked from commit 1256067c5c575474e626e5f119f50275ea2d975e)
(cherry picked from commit b277ef3304fa97da041c191b02b2fcfb74378c75)
|
| |
|
|
| |
(cherry picked from commit b416345d5b13c77d82708cab94f43cb6144fbaf7)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most prominently, add support for a transfer where a write with no-stop
flag is followed by a write with no-start flag. Logically, it's a
single larger write, but consumers may want to split it like that
because one part can be a register ID and the other part can be data to
be written to (or starting at) that register.
Such a transfer can be created by i2c tool and iic(4) driver, e.g., for
an EEPROM write at specific offset:
i2c -m tr -a 0x50 -d w -w 16 -o 0 -c 8 -v < /dev/random
This should be fixed by new code that handles the end of data transfer
for both reads and writes. It handles two existing conditions and one
new. Namely:
- the last message has been completed -- end of transfer;
- a message has been completed and the next one requires the start
condition;
- a message has been completed and the next one should be sent without
the start condition.
In the last case we simply switch to the next message and start sending
its data. Reads without the start condition are not supported yet,
though. That's because we NACK the last byte of the previous message,
so the device stops sending data. To fix this we will need to add a
look-ahead at the next message when handling the penultimate byte of the
current one.
This change also fixed a bug where msg_idx was not incremented after a
read message. Apparently, typically a read message is a last message in
a transfer, so the bug did not cause much trouble.
PR: 258994
(cherry picked from commit ff1e8581806f70e54fecddf8a6a23488dc7b968a)
|
| |
|
|
|
|
|
|
|
|
|
| |
Assert that we are not receiving data beyond the requested length.
Assert that we have not NACK-ed incoming data prematurely.
Abort the current transfer if the incoming data is NACK-ed or not
NACK-ed unexpectedly.
Add debug logging of received data to complement logging of sent data.
(cherry picked from commit 00c07d9559c6197957b00811a0b29876a5c8b573)
|
| |
|
|
|
|
|
| |
The write at the end of twsi_intr() already handles all cases, no need
to have another write for TWSI_STATUS_START / TWSI_STATUS_RPTD_START.
(cherry picked from commit aeacf172fd29b16b3661ff057c9abb238baba813)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the code set TWSI_CONTROL_ACK in twsi_transfer() based on
whether the first message had a length of one. That was done regardless
of whether the message was a read or write and what kind of messages
followed it.
Now the bit is set or cleared while handling TWSI_STATUS_ADDR_R_ACK
state transition based on the current (read) message.
The old code did not correctly work in a scenario where a single byte
was read from an EEPROM device with two byte addressing.
For example:
i2c -m tr -a 0x50 -d r -w 16 -o 0 -c 1 -v
The reason is that the first message (a write) has two bytes, so
TWSI_CONTROL_ACK was set and never cleared.
Since the controller did not send NACK the EEPROM sent more data resulting
in a buffer overrun.
While working on TWSI_STATUS_ADDR_R_ACK I also added support for
the zero-length read access and then I did the same for zero-length write
access.
While rare, those types of I2C transactions are completely valid and are
used by some devices.
PR: 258994
(cherry picked from commit 04622a7f21157827fe75276a4520a52d3a571a86)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
twsi_error() is a new function that stops the current transfer and sets
up softc when an error condition is detected.
TWSI_STATUS_DATA_WR_NACK, TWSI_STATUS_BUS_ERROR and
TWSI_STATUS_ARBITRATION_LOST are now handled explicitly rather than
via the catch-all unknown status.
Also, twsi_intr() now calls wakeup() in a single place when the
transfer is finished.
(cherry picked from commit a4fe8922085dfc1e5e6a6bac73ccc738e373165f)
|
| |
|
|
|
|
|
|
| |
- use 0x prefix for hex values
- print indexes and counts as decimals
- break too long lines
(cherry picked from commit 578707ed4efda4ec1c91ab1a8f1bace6b1eb714a)
|
| |
|
|
| |
(cherry picked from commit cb167e1ae95473d836393a07456d8dbcfbb7f758)
|
| |
|
|
| |
(cherry picked from commit bc02583c4dd65275da89838a723bd3514cb316cf)
|
| |
|
|
|
|
|
|
|
| |
All accesses to softc are now done under a mutex to prevent data races
between the open context and the interrupt handler.
Additionally, the wait time in twsi_transfer is bounded now.
Previously we could get stuck there forever if an interrupt got lost.
(cherry picked from commit 69cfa60ddd4df814b507699f9bb7253ece054f40)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Debug messages can now be enabled per driver instance via a new sysctl.
Also, debug messages in TWSI_READ and TWSI_WRITE require debug level
greater than 1 as they are mostly redundant because callers of those
functions already log most interesting results.
NB: the twsi drivers call their device iichb, so the new sysctl will
appear under dev.iichb.N.
(cherry picked from commit a2793d6182256b8edf647c11c642ad3c7c83809e)
|
| |
|
|
| |
(cherry picked from commit f00bc54f62c455c7ed44afee736c3c64873a305a)
|
| |
|
|
|
|
| |
For completeness and for future use.
(cherry picked from commit de86f339cdda0a10130033ff1771fb13cfacd9d0)
|
| |
|
|
| |
(cherry picked from commit 26559dd1770bb49c68f58a5fbcea3b4c96534c94)
|
| |
|
|
|
|
|
|
|
| |
On-board devices should be configured via the FDT and overlays.
Hints are primarily useful for external and temporarily attached devices.
Adding hints is much easier and faster than writing and compiling
an overlay.
(cherry picked from commit 01e3492337cb48484e03be38340cc67ac5e30a5b)
|
| |
|
|
|
|
|
|
|
| |
On-board devices should be configured via the FDT and overlays.
Hints are primarily useful for external and temporarily attached devices.
Adding hints is much easier and faster than writing and compiling
an overlay.
(cherry picked from commit 27645265c4e49ad7eaa25847a280307acb138da8)
|
| |
|
|
|
|
| |
At the moment only PCA9548A is supported and has been tested.
(cherry picked from commit c0525ab1d1ce69ab3d589e95733caedb04e0dcbd)
|
| |
|
|
| |
(cherry picked from commit 6354154ef520d359492badf0de9c8ae5d7080ae7)
|
| |
|
|
| |
(cherry picked from commit ff6fe2983550aeab0852e982e7fe5ac4c672c205)
|
| |
|
|
| |
(cherry picked from commit a60b30469741392e66ec6fd21a8d5c4810a2d407)
|