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().
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -498,6 +498,10 @@ struct spi_nor_locking_ops { · 497 unmodified lines | |||
| 498 | * @convert_addr: converts an absolute address into something the flash | 498 | * @convert_addr: converts an absolute address into something the flash |
| 499 | * will understand. Particularly useful when pagesize is | 499 | * 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 | */ |
| 503 | struct spi_nor_flash_parameter { | 507 | struct 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 | }; |