gpio-nct5104d: fix compilation with kernel 6.6
[openwrt/openwrt.git] / target / linux / generic / pending-5.15 / 479-mtd-spi-nor-add-xtx-xt25f128b.patch
1 From patchwork Thu Feb 6 17:19:41 2020
2 Content-Type: text/plain; charset="utf-8"
3 MIME-Version: 1.0
4 Content-Transfer-Encoding: 7bit
5 X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
6 X-Patchwork-Id: 1234465
7 Date: Thu, 6 Feb 2020 19:19:41 +0200
8 From: Daniel Golle <daniel@makrotopia.org>
9 To: linux-mtd@lists.infradead.org
10 Subject: [PATCH v2] mtd: spi-nor: Add support for xt25f128b chip
11 Message-ID: <20200206171941.GA2398@makrotopia.org>
12 MIME-Version: 1.0
13 Content-Disposition: inline
14 List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-mtd>,
15 <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>
16 Cc: Eitan Cohen <eitan@neot-semadar.com>, Piotr Dymacz <pepe2k@gmail.com>,
17 Tudor Ambarus <tudor.ambarus@microchip.com>
18 Sender: "linux-mtd" <linux-mtd-bounces@lists.infradead.org>
19 Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org
20
21 Add XT25F128B made by XTX Technology (Shenzhen) Limited.
22 This chip supports dual and quad read and uniform 4K-byte erase.
23 Verified on Teltonika RUT955 which comes with XT25F128B in recent
24 versions of the device.
25
26 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
27 Signed-off-by: Felix Fietkau <nbd@nbd.name>
28 ---
29 drivers/mtd/spi-nor/spi-nor.c | 4 ++++
30 1 file changed, 4 insertions(+)
31
32 --- a/drivers/mtd/spi-nor/Makefile
33 +++ b/drivers/mtd/spi-nor/Makefile
34 @@ -17,6 +17,7 @@ spi-nor-objs += sst.o
35 spi-nor-objs += winbond.o
36 spi-nor-objs += xilinx.o
37 spi-nor-objs += xmc.o
38 +spi-nor-objs += xtx.o
39 obj-$(CONFIG_MTD_SPI_NOR) += spi-nor.o
40
41 obj-$(CONFIG_MTD_SPI_NOR) += controllers/
42 --- /dev/null
43 +++ b/drivers/mtd/spi-nor/xtx.c
44 @@ -0,0 +1,15 @@
45 +// SPDX-License-Identifier: GPL-2.0
46 +#include <linux/mtd/spi-nor.h>
47 +
48 +#include "core.h"
49 +
50 +static const struct flash_info xtx_parts[] = {
51 + /* XTX Technology (Shenzhen) Limited */
52 + { "xt25f128b", INFO(0x0B4018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
53 +};
54 +
55 +const struct spi_nor_manufacturer spi_nor_xtx = {
56 + .name = "xtx",
57 + .parts = xtx_parts,
58 + .nparts = ARRAY_SIZE(xtx_parts),
59 +};
60 --- a/drivers/mtd/spi-nor/core.c
61 +++ b/drivers/mtd/spi-nor/core.c
62 @@ -1860,6 +1860,7 @@ static const struct spi_nor_manufacturer
63 &spi_nor_winbond,
64 &spi_nor_xilinx,
65 &spi_nor_xmc,
66 + &spi_nor_xtx,
67 };
68
69 static const struct flash_info *
70 --- a/drivers/mtd/spi-nor/core.h
71 +++ b/drivers/mtd/spi-nor/core.h
72 @@ -489,6 +489,7 @@ extern const struct spi_nor_manufacturer
73 extern const struct spi_nor_manufacturer spi_nor_winbond;
74 extern const struct spi_nor_manufacturer spi_nor_xilinx;
75 extern const struct spi_nor_manufacturer spi_nor_xmc;
76 +extern const struct spi_nor_manufacturer spi_nor_xtx;
77
78 extern const struct attribute_group *spi_nor_sysfs_groups[];
79