Skip to content

Dual/Quadmode spidev#226

Open
mfield4 wants to merge 2 commits intogoogle:mainfrom
mfield4:quadmode-spidev
Open

Dual/Quadmode spidev#226
mfield4 wants to merge 2 commits intogoogle:mainfrom
mfield4:quadmode-spidev

Conversation

@mfield4
Copy link

@mfield4 mfield4 commented Mar 5, 2026

This change adds the ability to explicitly request Single, Dual, or Quad SPI modes via a new operation_mode option in the SPI transport. It includes the necessary logic to map these modes to the appropriate spidev bit counts and SPI NOR opcodes.

  1. New libhoth_spi_mode Enum: Added LIBHOTH_SPI_MODE_SINGLE, LIBHOTH_SPI_MODE_DUAL, and LIBHOTH_SPI_MODE_QUAD.
  2. Enhanced Initialization: libhoth_spi_open now configures the SPI device mode using SPI_IOC_WR_MODE32 and verifies the setting.
  3. Sticky Mode Prevention: The original SPI mode is now backed up during initialization and restored in libhoth_spi_close to ensure that mode settings do not persist across different processes.
  4. Opcodes and Bitmasks; Added helper functions to correctly set the opcodes and *_nbits fields based on the selected mode.

mfield4 added 2 commits March 4, 2026 16:56
Add new cmdline option, to be read by spidev transport, along with
supporting code in spi transport. Will enable appliable spi mode,
enabling the userspace driver to take advantage of high speed
spi read & program.

Does not poll SFDP to check for support, but will instead fail
on hardware that does not support higher speeds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant