]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/mtd/spi-nor/mtk-quadspi.c
lockup-watchdogs.txt: standardize document format
[karo-tx-linux.git] / drivers / mtd / spi-nor / mtk-quadspi.c
index b6377707ce321e077c0d0d18005b6ccca3833f0f..8a20ec4991c878eb00b7a2b0551cf50e2320a7dd 100644 (file)
@@ -123,20 +123,20 @@ static void mt8173_nor_set_read_mode(struct mt8173_nor *mt8173_nor)
 {
        struct spi_nor *nor = &mt8173_nor->nor;
 
-       switch (nor->flash_read) {
-       case SPI_NOR_FAST:
+       switch (nor->read_proto) {
+       case SNOR_PROTO_1_1_1:
                writeb(nor->read_opcode, mt8173_nor->base +
                       MTK_NOR_PRGDATA3_REG);
                writeb(MTK_NOR_FAST_READ, mt8173_nor->base +
                       MTK_NOR_CFG1_REG);
                break;
-       case SPI_NOR_DUAL:
+       case SNOR_PROTO_1_1_2:
                writeb(nor->read_opcode, mt8173_nor->base +
                       MTK_NOR_PRGDATA3_REG);
                writeb(MTK_NOR_DUAL_READ_EN, mt8173_nor->base +
                       MTK_NOR_DUAL_REG);
                break;
-       case SPI_NOR_QUAD:
+       case SNOR_PROTO_1_1_4:
                writeb(nor->read_opcode, mt8173_nor->base +
                       MTK_NOR_PRGDATA4_REG);
                writeb(MTK_NOR_QUAD_READ_EN, mt8173_nor->base +
@@ -408,6 +408,11 @@ static int mt8173_nor_write_reg(struct spi_nor *nor, u8 opcode, u8 *buf,
 static int mtk_nor_init(struct mt8173_nor *mt8173_nor,
                        struct device_node *flash_node)
 {
+       const struct spi_nor_hwcaps hwcaps = {
+               .mask = SNOR_HWCAPS_READ_FAST |
+                       SNOR_HWCAPS_READ_1_1_2 |
+                       SNOR_HWCAPS_PP,
+       };
        int ret;
        struct spi_nor *nor;
 
@@ -426,7 +431,7 @@ static int mtk_nor_init(struct mt8173_nor *mt8173_nor,
        nor->write_reg = mt8173_nor_write_reg;
        nor->mtd.name = "mtk_nor";
        /* initialized with NULL */
-       ret = spi_nor_scan(nor, NULL, SPI_NOR_DUAL);
+       ret = spi_nor_scan(nor, NULL, &hwcaps);
        if (ret)
                return ret;