spi: add quirks system
Not all SPI chips are the same. Add a system to differentiate them. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
fc6d6a575d
commit
edd8824a74
12
spi.c
12
spi.c
@ -10,10 +10,22 @@
|
||||
#include "rpi.h"
|
||||
#include "spi.h"
|
||||
|
||||
enum ff_spi_quirks {
|
||||
// There is no separate "Write SR 2" command. Instead,
|
||||
// you must write SR2 after writing SR1
|
||||
SQ_SR2_FROM_SR1 = (1 << 0),
|
||||
|
||||
// Don't issue a "Write Enable" command prior to writing
|
||||
// a status register
|
||||
SQ_SKIP_SR_WEL = (1 << 1),
|
||||
};
|
||||
|
||||
struct ff_spi {
|
||||
enum spi_state state;
|
||||
enum spi_type type;
|
||||
enum spi_type desired_type;
|
||||
struct spi_id id;
|
||||
enum ff_spi_quirks quirks;
|
||||
|
||||
struct {
|
||||
int clk;
|
||||
|
Loading…
Reference in New Issue
Block a user