Page MenuHomeFreeBSD

spibus: add cs_delay ivar
Needs ReviewPublic

Authored by greg_unrelenting.technology on Apr 1 2021, 1:42 PM.

Details

Reviewers
manu
ian
Group Reviewers
Contributor Reviews (base)
Summary

The Apple MacBook input devices require a delay after toggling CS when working at the correct frequency, otherwise you can see anomalies e.g. an extra junk byte in front of the message.

Add a new ivar to spibus to allow the input driver to set a delay.


I'm not sure if I should try to blindly add support for this into all other SPI controller drivers or whatever…

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

That doesn't seems to be specific to the Apple hardware but to the intel controller.
Linux notes that after changing CS one should wait 2 clock cycles (spi controller clock).
Our driver doesn't seems to do anything about clock and just hardcode based on the one found on the MinowBoard.
Anyway, that seems more controller specific than SPI specific so I'm not sure that this is the correct approach.

In D29534#662122, @manu wrote:

That doesn't seems to be specific to the Apple hardware but to the intel controller.

The delay value is provided in ACPI for the input device.

Linux struct spi_transfer has a delay field, the Linux input driver uses it with the value it gets from ACPI.

Our driver doesn't seems to do anything about clock and just hardcode based on the one found on the MinowBoard.

You didn't notice the parent revision ;)