spi: Get rid of the spi_flash_read() API
This API has been replaced by the spi_mem_xx() one, its only user (spi-nor) has been converted to spi_mem_xx() and all SPI controller drivers that were implementing the ->spi_flash_xxx() hooks are also implementing the spi_mem ones. So we can safely get rid of this API. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Frieder Schrempf <frieder.schrempf@exceet.de> Tested-by: Frieder Schrempf <frieder.schrempf@exceet.de> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:

committed by
Mark Brown

parent
4120f8d158
commit
c1f5ba70de
@@ -26,7 +26,6 @@ struct dma_chan;
|
||||
struct property_entry;
|
||||
struct spi_controller;
|
||||
struct spi_transfer;
|
||||
struct spi_flash_read_message;
|
||||
struct spi_controller_mem_ops;
|
||||
|
||||
/*
|
||||
@@ -382,11 +381,6 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
|
||||
* controller has native support for memory like operations.
|
||||
* @unprepare_message: undo any work done by prepare_message().
|
||||
* @slave_abort: abort the ongoing transfer request on an SPI slave controller
|
||||
* @spi_flash_read: to support spi-controller hardwares that provide
|
||||
* accelerated interface to read from flash devices.
|
||||
* @spi_flash_can_dma: analogous to can_dma() interface, but for
|
||||
* controllers implementing spi_flash_read.
|
||||
* @flash_read_supported: spi device supports flash read
|
||||
* @cs_gpios: Array of GPIOs to use as chip select lines; one per CS
|
||||
* number. Any individual value may be -ENOENT for CS lines that
|
||||
* are not GPIOs (driven by the SPI controller itself).
|
||||
@@ -552,11 +546,6 @@ struct spi_controller {
|
||||
int (*unprepare_message)(struct spi_controller *ctlr,
|
||||
struct spi_message *message);
|
||||
int (*slave_abort)(struct spi_controller *ctlr);
|
||||
int (*spi_flash_read)(struct spi_device *spi,
|
||||
struct spi_flash_read_message *msg);
|
||||
bool (*spi_flash_can_dma)(struct spi_device *spi,
|
||||
struct spi_flash_read_message *msg);
|
||||
bool (*flash_read_supported)(struct spi_device *spi);
|
||||
|
||||
/*
|
||||
* These hooks are for drivers that use a generic implementation
|
||||
@@ -1190,48 +1179,6 @@ static inline ssize_t spi_w8r16be(struct spi_device *spi, u8 cmd)
|
||||
return be16_to_cpu(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* struct spi_flash_read_message - flash specific information for
|
||||
* spi-masters that provide accelerated flash read interfaces
|
||||
* @buf: buffer to read data
|
||||
* @from: offset within the flash from where data is to be read
|
||||
* @len: length of data to be read
|
||||
* @retlen: actual length of data read
|
||||
* @read_opcode: read_opcode to be used to communicate with flash
|
||||
* @addr_width: number of address bytes
|
||||
* @dummy_bytes: number of dummy bytes
|
||||
* @opcode_nbits: number of lines to send opcode
|
||||
* @addr_nbits: number of lines to send address
|
||||
* @data_nbits: number of lines for data
|
||||
* @rx_sg: Scatterlist for receive data read from flash
|
||||
* @cur_msg_mapped: message has been mapped for DMA
|
||||
*/
|
||||
struct spi_flash_read_message {
|
||||
void *buf;
|
||||
loff_t from;
|
||||
size_t len;
|
||||
size_t retlen;
|
||||
u8 read_opcode;
|
||||
u8 addr_width;
|
||||
u8 dummy_bytes;
|
||||
u8 opcode_nbits;
|
||||
u8 addr_nbits;
|
||||
u8 data_nbits;
|
||||
struct sg_table rx_sg;
|
||||
bool cur_msg_mapped;
|
||||
};
|
||||
|
||||
/* SPI core interface for flash read support */
|
||||
static inline bool spi_flash_read_supported(struct spi_device *spi)
|
||||
{
|
||||
return spi->controller->spi_flash_read &&
|
||||
(!spi->controller->flash_read_supported ||
|
||||
spi->controller->flash_read_supported(spi));
|
||||
}
|
||||
|
||||
int spi_flash_read(struct spi_device *spi,
|
||||
struct spi_flash_read_message *msg);
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user