]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/mtd/spi-nor/cadence-quadspi.c
lockup-watchdogs.txt: standardize document format
[karo-tx-linux.git] / drivers / mtd / spi-nor / cadence-quadspi.c
index 9f8102de1b16a1786c5fb06f7980acc872433dd5..53c7d8e0327aa4376bdbb3cb00d78babf70349a4 100644 (file)
@@ -855,15 +855,14 @@ static int cqspi_set_protocol(struct spi_nor *nor, const int read)
        f_pdata->data_width = CQSPI_INST_TYPE_SINGLE;
 
        if (read) {
-               switch (nor->flash_read) {
-               case SPI_NOR_NORMAL:
-               case SPI_NOR_FAST:
+               switch (nor->read_proto) {
+               case SNOR_PROTO_1_1_1:
                        f_pdata->data_width = CQSPI_INST_TYPE_SINGLE;
                        break;
-               case SPI_NOR_DUAL:
+               case SNOR_PROTO_1_1_2:
                        f_pdata->data_width = CQSPI_INST_TYPE_DUAL;
                        break;
-               case SPI_NOR_QUAD:
+               case SNOR_PROTO_1_1_4:
                        f_pdata->data_width = CQSPI_INST_TYPE_QUAD;
                        break;
                default:
@@ -1069,6 +1068,13 @@ static void cqspi_controller_init(struct cqspi_st *cqspi)
 
 static int cqspi_setup_flash(struct cqspi_st *cqspi, struct device_node *np)
 {
+       const struct spi_nor_hwcaps hwcaps = {
+               .mask = SNOR_HWCAPS_READ |
+                       SNOR_HWCAPS_READ_FAST |
+                       SNOR_HWCAPS_READ_1_1_2 |
+                       SNOR_HWCAPS_READ_1_1_4 |
+                       SNOR_HWCAPS_PP,
+       };
        struct platform_device *pdev = cqspi->pdev;
        struct device *dev = &pdev->dev;
        struct cqspi_flash_pdata *f_pdata;
@@ -1123,7 +1129,7 @@ static int cqspi_setup_flash(struct cqspi_st *cqspi, struct device_node *np)
                        goto err;
                }
 
-               ret = spi_nor_scan(nor, NULL, SPI_NOR_QUAD);
+               ret = spi_nor_scan(nor, NULL, &hwcaps);
                if (ret)
                        goto err;
 
@@ -1277,7 +1283,7 @@ static const struct dev_pm_ops cqspi__dev_pm_ops = {
 #define CQSPI_DEV_PM_OPS       NULL
 #endif
 
-static struct of_device_id const cqspi_dt_ids[] = {
+static const struct of_device_id cqspi_dt_ids[] = {
        {.compatible = "cdns,qspi-nor",},
        { /* end of table */ }
 };