Skip to content

All: For platforms that use spi-gpio, create separate device drivers for faster GPIO access #6

@ts-kris

Description

@ts-kris

See comments near the top of spi-gpio.c for more details:

/*
 * Because the overhead of going through four GPIO procedure calls
 * per transferred bit can make performance a problem, this code
 * is set up so that you can use it in either of two ways:
 *
 *   - The slow generic way:  set up platform_data to hold the GPIO
 *     numbers used for MISO/MOSI/SCK, and issue procedure calls for
 *     each of them.  This driver can handle several such busses.
 *
 *   - The quicker inlined way:  only helps with platform GPIO code
 *     that inlines operations for constant GPIOs.  This can give
 *     you tight (fast!) inner loops, but each such bus needs a
 *     new driver.  You'll define a new C file, with Makefile and
 *     Kconfig support; the C code can be a total of six lines:
 *
 *              #define DRIVER_NAME     "myboard_spi2"
 *              #define SPI_MISO_GPIO   119
 *              #define SPI_MOSI_GPIO   120
 *              #define SPI_SCK_GPIO    121
 *              #define SPI_N_CHIPSEL   4
 *              #include "spi-gpio.c"
 */

This would be especially useful on, e.g. TS-7990, where solo CPUs have Wi-Fi using spi-gpio

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions