History

mtd: spi-nor: Add a ->setup() method

nor->params.setup() configures the SPI NOR memory. Useful for SPI NOR flashes that have peculiarities to the SPI NOR standard, e.g. different opcodes, specific address calculation, page size, etc. Right now the only user will be the S3AN chips, but other manufacturers can implement it if needed. Move spi_nor_setup() related code in order to avoid a forward declaration to spi_nor_default_setup().

Tudor Ambarus committed 7 years ago

Commit 2d7ff851 parent 36499592 files · +226 −211Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/mtd/spi-nor.h+5−0
@@ -498,6 +498,10 @@ struct spi_nor_locking_ops { · 497 unmodified lines
498 * @convert_addr: converts an absolute address into something the flash498 * @convert_addr: converts an absolute address into something the flash
499 * will understand. Particularly useful when pagesize is499 * will understand. Particularly useful when pagesize is
500 * not a power-of-2.500 * not a power-of-2.
501 * @setup: configures the SPI NOR memory. Useful for SPI NOR
502 * flashes that have peculiarities to the SPI NOR standard
503 * e.g. different opcodes, specific address calculation,
504 * page size, etc.
501 * @locking_ops: SPI NOR locking methods.505 * @locking_ops: SPI NOR locking methods.
502 */506 */
503struct spi_nor_flash_parameter {507struct spi_nor_flash_parameter {
@@ -513,6 +517,7 @@ struct spi_nor_flash_parameter { · 9 unmodified lines
513 int (*quad_enable)(struct spi_nor *nor);517 int (*quad_enable)(struct spi_nor *nor);
514 int (*set_4byte)(struct spi_nor *nor, bool enable);518 int (*set_4byte)(struct spi_nor *nor, bool enable);
515 u32 (*convert_addr)(struct spi_nor *nor, u32 addr);519 u32 (*convert_addr)(struct spi_nor *nor, u32 addr);
520 int (*setup)(struct spi_nor *nor, const struct spi_nor_hwcaps *hwcaps);
516 521
517 const struct spi_nor_locking_ops *locking_ops;522 const struct spi_nor_locking_ops *locking_ops;
518};523};

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t