From bf4c4b78c152b08f7ebf19a8c26fe4ea99f2b385 Mon Sep 17 00:00:00 2001 From: Dmitry Ermakov <7954832+dimerr@users.noreply.github.com> Date: Fri, 6 Nov 2026 18:59:34 +0000 Subject: [PATCH] hi3519dv500: bsp-sfc: do not use quad Quad gives more problems than benefits on these cameras, and this is the same bsp-sfc code that hi3516cv6xx dropped quad from: the OpenIPC config leaves CLOSE_SPI_8PIN_4IO unset, so quad is on. Take the quad modes out of bsp-sfc, at probe and at resume. spi_nor_quad_enable() then returns early and SR is not written for it. CLOSE_SPI_8PIN_4IO no longer has any effect here. With no quad in hwcaps, spi_nor_dtrclear_pinreset() now reaches spi_nor_sr3_to_reset() on Winbond and GigaDevice parts. That writes SR3 with no WREN before it, so it should do nothing with WEL clear. Build-tested only: drivers/mtd/spi-nor with the hi3519dv500 config from OpenIPC/firmware. --- drivers/mtd/spi-nor/controllers/bsp-sfc.c | 7 ------- drivers/mtd/spi-nor/core.c | 7 ------- 2 files changed, 14 deletions(-) diff --git a/drivers/mtd/spi-nor/controllers/bsp-sfc.c b/drivers/mtd/spi-nor/controllers/bsp-sfc.c index 42c11bea722..e0995671bbc 100644 --- a/drivers/mtd/spi-nor/controllers/bsp-sfc.c +++ b/drivers/mtd/spi-nor/controllers/bsp-sfc.c @@ -585,13 +585,6 @@ static int bsp_spi_nor_register(struct device_node *np, nor->priv = priv; nor->controller_ops = &bsp_controller_ops; -#ifndef CONFIG_CLOSE_SPI_8PIN_4IO - hwcaps.mask |= SNOR_HWCAPS_READ_1_1_4 | - SNOR_HWCAPS_READ_1_4_4 | - SNOR_HWCAPS_PP_1_1_4 | - SNOR_HWCAPS_PP_1_4_4; -#endif - ret = spi_nor_scan(nor, NULL, &hwcaps); if (ret) return ret; diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 073769c4787..6f7db779210 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -3416,13 +3416,6 @@ int bsp_spi_nor_resume(struct spi_nor *nor) #endif SNOR_HWCAPS_PP, }; -#ifndef CONFIG_CLOSE_SPI_8PIN_4IO - hwcaps.mask |= SNOR_HWCAPS_READ_1_1_4 | - SNOR_HWCAPS_READ_1_4_4 | - SNOR_HWCAPS_PP_1_1_4 | - SNOR_HWCAPS_PP_1_4_4; -#endif - if (!info) info = spi_nor_read_id(nor);