HomeFreeBSD

spibus: extend API: add cs_delay ivar, KEEP_CS and NO_SLEEP flags

Description

spibus: extend API: add cs_delay ivar, KEEP_CS and NO_SLEEP flags

These feature are required for an upcoming Apple MacBook topcase
(HID over SPI) driver:

A delay after toggling CS is required to avoid anomalies like an extra
junk byte in front of the message. Keeping CS asserted is required to
be able to read a status report after writing a command. (The device
won't return the status if CS was deasserted.)

Sleep is not allowed in the interrupt context where the Apple input
driver runs its transactions. Use a flag to tell the SPI driver to
avoid mtx_sleep.

Reviewed by: manu (ok to SPI part of larger patch)
MFC afret: 1 month
Differential revision: https://reviews.freebsd.org/D29534

Details

Provenance
val_packett.coolAuthored on Apr 24 2023, 9:41 AM
wulfCommitted on Apr 24 2023, 9:41 AM
Reviewer
manu
Differential Revision
D29534: spibus: extend API: add cs_delay ivar, KEEP_CS and NO_SLEEP flags
Parents
rGb344bd3a7d2d: ext2fs: extract crc16 into sys/crc16.h
Branches
Unknown
Tags
Unknown