]> git.baikalelectronics.ru Git - kernel.git/commit
spi: spi-mem: Extend the SPI mem interface to set a custom memory name
authorFrieder Schrempf <frieder.schrempf@exceet.de>
Thu, 2 Aug 2018 12:53:53 +0000 (14:53 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 2 Aug 2018 14:35:41 +0000 (15:35 +0100)
commit63fb7a906168df2268afae3ab38f7b23958ae2a8
tree81c1eee84492a7b65a991d5069838b86227414c0
parent543e12b8ec5325e63ff78bbbc6253c8a0f5950d5
spi: spi-mem: Extend the SPI mem interface to set a custom memory name

When porting (Q)SPI controller drivers from the MTD layer to the SPI
layer, the naming scheme for the memory devices changes. To be able
to keep compatibility with the old drivers naming scheme, a name
field is added to struct spi_mem and a hook is added to let controller
drivers set a custom name for the memory device.

Example for the FSL QSPI driver:

Name with the old driver: 21e0000.qspi,
or with multiple devices: 21e0000.qspi-0, 21e0000.qspi-1, ...

Name with the new driver without spi_mem_get_name: spi4.0

Suggested-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Frieder Schrempf <frieder.schrempf@exceet.de>
Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-mem.c
include/linux/spi/spi-mem.h