kernel: copy kernel 4.19 code to 5.4
[oweals/openwrt.git] / target / linux / generic / backport-5.4 / 461-v5.3-mtd-spinand-Add-support-for-two-byte-device-IDs.patch
1 From 53dd94a79d3bfdaae30e5a4ebf474ea1af1d572e Mon Sep 17 00:00:00 2001
2 From: Jeff Kletsky <git-commits@allycomm.com>
3 Date: Wed, 22 May 2019 15:05:54 -0700
4 Subject: [PATCH 2/3] mtd: spinand: Add support for two-byte device IDs
5
6 The GigaDevice GD5F1GQ4UFxxG SPI NAND utilizes two-byte device IDs.
7
8 http://www.gigadevice.com/datasheet/gd5f1gq4xfxxg/
9
10 Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
11 Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
12 Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
13 ---
14  drivers/mtd/nand/spi/core.c | 2 +-
15  include/linux/mtd/spinand.h | 4 ++--
16  2 files changed, 3 insertions(+), 3 deletions(-)
17
18 --- a/drivers/mtd/nand/spi/core.c
19 +++ b/drivers/mtd/nand/spi/core.c
20 @@ -853,7 +853,7 @@ spinand_select_op_variant(struct spinand
21   */
22  int spinand_match_and_init(struct spinand_device *spinand,
23                            const struct spinand_info *table,
24 -                          unsigned int table_size, u8 devid)
25 +                          unsigned int table_size, u16 devid)
26  {
27         struct nand_device *nand = spinand_to_nand(spinand);
28         unsigned int i;
29 --- a/include/linux/mtd/spinand.h
30 +++ b/include/linux/mtd/spinand.h
31 @@ -290,7 +290,7 @@ struct spinand_ecc_info {
32   */
33  struct spinand_info {
34         const char *model;
35 -       u8 devid;
36 +       u16 devid;
37         u32 flags;
38         struct nand_memory_organization memorg;
39         struct nand_ecc_req eccreq;
40 @@ -445,7 +445,7 @@ static inline void spinand_set_of_node(s
41  
42  int spinand_match_and_init(struct spinand_device *dev,
43                            const struct spinand_info *table,
44 -                          unsigned int table_size, u8 devid);
45 +                          unsigned int table_size, u16 devid);
46  
47  int spinand_upd_cfg(struct spinand_device *spinand, u8 mask, u8 val);
48  int spinand_select_target(struct spinand_device *spinand, unsigned int target);