spi: set sr2 quirk by default

most chips, it seems, write sr2 just after sr1 instead of having
a separate command.  Set this quirk by default.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2018-12-19 00:01:58 -05:00
parent 27dec515e7
commit 556fdb8e1b

5
spi.c
View File

@ -770,8 +770,9 @@ int spiInit(struct ff_spi *spi) {
gpioWrite(spi->pins.wp, 1);
spi_get_id(spi);
if (spi->id.manufacturer_id == 0x1f)
spi->quirks |= SQ_SR2_FROM_SR1;
spi->quirks |= SQ_SR2_FROM_SR1;
// if (spi->id.manufacturer_id == 0x1f)
if (spi->id.manufacturer_id == 0xef)
spi->quirks |= SQ_SKIP_SR_WEL | SQ_SECURITY_NYBBLE_SHIFT;