Lines Matching refs:spi
51 struct spi_device *spi; member
87 err = spi_sync(flash->spi, &m); in sst25l_status()
101 err = spi_write(flash->spi, command, 1); in sst25l_write_enable()
106 err = spi_write(flash->spi, command, 1); in sst25l_write_enable()
112 err = spi_write(flash->spi, command, 2); in sst25l_write_enable()
159 err = spi_write(flash->spi, command, 4); in sst25l_erase_sector()
199 dev_err(&flash->spi->dev, "Erase failed\n"); in sst25l_erase()
247 spi_sync(flash->spi, &message); in sst25l_read()
283 ret = spi_write(flash->spi, command, 5); in sst25l_write()
299 ret = spi_write(flash->spi, command, 2); in sst25l_write()
315 static struct flash_info *sst25l_match_device(struct spi_device *spi) in sst25l_match_device() argument
337 err = spi_sync(spi, &m); in sst25l_match_device()
339 dev_err(&spi->dev, "error reading device id\n"); in sst25l_match_device()
350 dev_err(&spi->dev, "unknown id %.4x\n", id); in sst25l_match_device()
355 static int sst25l_probe(struct spi_device *spi) in sst25l_probe() argument
362 flash_info = sst25l_match_device(spi); in sst25l_probe()
366 flash = devm_kzalloc(&spi->dev, sizeof(*flash), GFP_KERNEL); in sst25l_probe()
370 flash->spi = spi; in sst25l_probe()
372 spi_set_drvdata(spi, flash); in sst25l_probe()
374 data = dev_get_platdata(&spi->dev); in sst25l_probe()
378 flash->mtd.dev.parent = &spi->dev; in sst25l_probe()
389 dev_info(&spi->dev, "%s (%lld KiB)\n", flash_info->name, in sst25l_probe()
409 static int sst25l_remove(struct spi_device *spi) in sst25l_remove() argument
411 struct sst25l_flash *flash = spi_get_drvdata(spi); in sst25l_remove()