mtd: use new MTDIOC_SETSPEED ioctl

set SPI speed to 10MHz
This commit is contained in:
Andrew Tridgell
2014-01-16 17:00:25 +11:00
committed by Lorenz Meier
parent 352dea6754
commit ff59aa9a0f
+5 -1
View File
@@ -144,7 +144,7 @@ ramtron_attach(void)
/* find the right spi */
struct spi_dev_s *spi = up_spiinitialize(2);
/* this resets the spi bus, set correct bus speed again */
SPI_SETFREQUENCY(spi, 40 * 1000 * 1000);
SPI_SETFREQUENCY(spi, 10 * 1000 * 1000);
SPI_SETBITS(spi, 8);
SPI_SETMODE(spi, SPIDEV_MODE3);
SPI_SELECT(spi, SPIDEV_FLASH, false);
@@ -170,6 +170,10 @@ ramtron_attach(void)
if (mtd_dev == NULL)
errx(1, "failed to initialize mtd driver");
int ret = mtd_dev->ioctl(mtd_dev, MTDIOC_SETSPEED, (unsigned long)10*1000*1000);
if (ret != OK)
warnx(1, "failed to set bus speed");
attached = true;
}
#else