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
498498 * @convert_addr: converts an absolute address into something the flash
499499 * will understand. Particularly useful when pagesize is
500500 * 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.
501505 * @locking_ops: SPI NOR locking methods.
502506 */
503507 struct spi_nor_flash_parameter {
@@ -513,6 +517,7 @@ struct spi_nor_flash_parameter { · 9 unmodified lines
513517 int (*quad_enable)(struct spi_nor *nor);
514518 int (*set_4byte)(struct spi_nor *nor, bool enable);
515519 u32 (*convert_addr)(struct spi_nor *nor, u32 addr);
520+ int (*setup)(struct spi_nor *nor, const struct spi_nor_hwcaps *hwcaps);
516521
517522 const struct spi_nor_locking_ops *locking_ops;
518523 };

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