Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: nand: mediatek: add support for different MTK NAND FLASH Controller IP

ECC strength and spare size supported may be different among MTK NAND
FLASH Controller IPs.

This patch contains changes as following:
(1) add new struct mtk_nfc_caps to support different spare size.
(2) add new struct mtk_ecc_caps to support different ecc strength.
(3) remove ECC_CNFG_xBIT define, use a for loop to do ecc strength config.
(4) remove PAGEFMT_SPARE_ define, use a for loop to do spare format config.
(5) malloc ecc->eccdata buffer according to max ecc strength of this IP.

Signed-off-by: Xiaolei Li <xiaolei.li@mediatek.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>

authored by

Xiaolei Li and committed by
Boris Brezillon
7ec4a37c 582212ce

+153 -199
+75 -106
drivers/mtd/nand/mtk_ecc.c
··· 33 33 34 34 #define ECC_ENCCON (0x00) 35 35 #define ECC_ENCCNFG (0x04) 36 - #define ECC_CNFG_4BIT (0) 37 - #define ECC_CNFG_6BIT (1) 38 - #define ECC_CNFG_8BIT (2) 39 - #define ECC_CNFG_10BIT (3) 40 - #define ECC_CNFG_12BIT (4) 41 - #define ECC_CNFG_14BIT (5) 42 - #define ECC_CNFG_16BIT (6) 43 - #define ECC_CNFG_18BIT (7) 44 - #define ECC_CNFG_20BIT (8) 45 - #define ECC_CNFG_22BIT (9) 46 - #define ECC_CNFG_24BIT (0xa) 47 - #define ECC_CNFG_28BIT (0xb) 48 - #define ECC_CNFG_32BIT (0xc) 49 - #define ECC_CNFG_36BIT (0xd) 50 - #define ECC_CNFG_40BIT (0xe) 51 - #define ECC_CNFG_44BIT (0xf) 52 - #define ECC_CNFG_48BIT (0x10) 53 - #define ECC_CNFG_52BIT (0x11) 54 - #define ECC_CNFG_56BIT (0x12) 55 - #define ECC_CNFG_60BIT (0x13) 56 36 #define ECC_MODE_SHIFT (5) 57 37 #define ECC_MS_SHIFT (16) 58 38 #define ECC_ENCDIADDR (0x08) ··· 46 66 #define DEC_CNFG_CORRECT (0x3 << 12) 47 67 #define ECC_DECIDLE (0x10C) 48 68 #define ECC_DECENUM0 (0x114) 49 - #define ERR_MASK (0x3f) 50 69 #define ECC_DECDONE (0x124) 51 70 #define ECC_DECIRQ_EN (0x200) 52 71 #define ECC_DECIRQ_STA (0x204) ··· 57 78 #define ECC_IRQ_REG(op) ((op) == ECC_ENCODE ? \ 58 79 ECC_ENCIRQ_EN : ECC_DECIRQ_EN) 59 80 81 + struct mtk_ecc_caps { 82 + u32 err_mask; 83 + const u8 *ecc_strength; 84 + u8 num_ecc_strength; 85 + }; 86 + 60 87 struct mtk_ecc { 61 88 struct device *dev; 89 + const struct mtk_ecc_caps *caps; 62 90 void __iomem *regs; 63 91 struct clk *clk; 64 92 ··· 73 87 struct mutex lock; 74 88 u32 sectors; 75 89 76 - u8 eccdata[112]; 90 + u8 *eccdata; 91 + }; 92 + 93 + /* ecc strength that mt2701 supports */ 94 + static const u8 ecc_strength_mt2701[] = { 95 + 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36, 96 + 40, 44, 48, 52, 56, 60 77 97 }; 78 98 79 99 static inline void mtk_ecc_wait_idle(struct mtk_ecc *ecc, ··· 128 136 return IRQ_HANDLED; 129 137 } 130 138 131 - static void mtk_ecc_config(struct mtk_ecc *ecc, struct mtk_ecc_config *config) 139 + static int mtk_ecc_config(struct mtk_ecc *ecc, struct mtk_ecc_config *config) 132 140 { 133 - u32 ecc_bit = ECC_CNFG_4BIT, dec_sz, enc_sz; 134 - u32 reg; 141 + u32 ecc_bit, dec_sz, enc_sz; 142 + u32 reg, i; 135 143 136 - switch (config->strength) { 137 - case 4: 138 - ecc_bit = ECC_CNFG_4BIT; 139 - break; 140 - case 6: 141 - ecc_bit = ECC_CNFG_6BIT; 142 - break; 143 - case 8: 144 - ecc_bit = ECC_CNFG_8BIT; 145 - break; 146 - case 10: 147 - ecc_bit = ECC_CNFG_10BIT; 148 - break; 149 - case 12: 150 - ecc_bit = ECC_CNFG_12BIT; 151 - break; 152 - case 14: 153 - ecc_bit = ECC_CNFG_14BIT; 154 - break; 155 - case 16: 156 - ecc_bit = ECC_CNFG_16BIT; 157 - break; 158 - case 18: 159 - ecc_bit = ECC_CNFG_18BIT; 160 - break; 161 - case 20: 162 - ecc_bit = ECC_CNFG_20BIT; 163 - break; 164 - case 22: 165 - ecc_bit = ECC_CNFG_22BIT; 166 - break; 167 - case 24: 168 - ecc_bit = ECC_CNFG_24BIT; 169 - break; 170 - case 28: 171 - ecc_bit = ECC_CNFG_28BIT; 172 - break; 173 - case 32: 174 - ecc_bit = ECC_CNFG_32BIT; 175 - break; 176 - case 36: 177 - ecc_bit = ECC_CNFG_36BIT; 178 - break; 179 - case 40: 180 - ecc_bit = ECC_CNFG_40BIT; 181 - break; 182 - case 44: 183 - ecc_bit = ECC_CNFG_44BIT; 184 - break; 185 - case 48: 186 - ecc_bit = ECC_CNFG_48BIT; 187 - break; 188 - case 52: 189 - ecc_bit = ECC_CNFG_52BIT; 190 - break; 191 - case 56: 192 - ecc_bit = ECC_CNFG_56BIT; 193 - break; 194 - case 60: 195 - ecc_bit = ECC_CNFG_60BIT; 196 - break; 197 - default: 198 - dev_err(ecc->dev, "invalid strength %d, default to 4 bits\n", 199 - config->strength); 144 + for (i = 0; i < ecc->caps->num_ecc_strength; i++) { 145 + if (ecc->caps->ecc_strength[i] == config->strength) 146 + break; 200 147 } 148 + 149 + if (i == ecc->caps->num_ecc_strength) { 150 + dev_err(ecc->dev, "invalid ecc strength %d\n", 151 + config->strength); 152 + return -EINVAL; 153 + } 154 + 155 + ecc_bit = i; 201 156 202 157 if (config->op == ECC_ENCODE) { 203 158 /* configure ECC encoder (in bits) */ ··· 171 232 if (config->sectors) 172 233 ecc->sectors = 1 << (config->sectors - 1); 173 234 } 235 + 236 + return 0; 174 237 } 175 238 176 239 void mtk_ecc_get_stats(struct mtk_ecc *ecc, struct mtk_ecc_stats *stats, ··· 188 247 offset = (i >> 2) << 2; 189 248 err = readl(ecc->regs + ECC_DECENUM0 + offset); 190 249 err = err >> ((i % 4) * 8); 191 - err &= ERR_MASK; 192 - if (err == ERR_MASK) { 250 + err &= ecc->caps->err_mask; 251 + if (err == ecc->caps->err_mask) { 193 252 /* uncorrectable errors */ 194 253 stats->failed++; 195 254 continue; ··· 263 322 } 264 323 265 324 mtk_ecc_wait_idle(ecc, op); 266 - mtk_ecc_config(ecc, config); 325 + 326 + ret = mtk_ecc_config(ecc, config); 327 + if (ret) 328 + return ret; 329 + 267 330 writew(ECC_OP_ENABLE, ecc->regs + ECC_CTL_REG(op)); 268 331 269 332 init_completion(&ecc->done); ··· 354 409 } 355 410 EXPORT_SYMBOL(mtk_ecc_encode); 356 411 357 - void mtk_ecc_adjust_strength(u32 *p) 412 + void mtk_ecc_adjust_strength(struct mtk_ecc *ecc, u32 *p) 358 413 { 359 - u32 ecc[] = {4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36, 360 - 40, 44, 48, 52, 56, 60}; 414 + const u8 *ecc_strength = ecc->caps->ecc_strength; 361 415 int i; 362 416 363 - for (i = 0; i < ARRAY_SIZE(ecc); i++) { 364 - if (*p <= ecc[i]) { 417 + for (i = 0; i < ecc->caps->num_ecc_strength; i++) { 418 + if (*p <= ecc_strength[i]) { 365 419 if (!i) 366 - *p = ecc[i]; 367 - else if (*p != ecc[i]) 368 - *p = ecc[i - 1]; 420 + *p = ecc_strength[i]; 421 + else if (*p != ecc_strength[i]) 422 + *p = ecc_strength[i - 1]; 369 423 return; 370 424 } 371 425 } 372 426 373 - *p = ecc[ARRAY_SIZE(ecc) - 1]; 427 + *p = ecc_strength[ecc->caps->num_ecc_strength - 1]; 374 428 } 375 429 EXPORT_SYMBOL(mtk_ecc_adjust_strength); 430 + 431 + static const struct mtk_ecc_caps mtk_ecc_caps_mt2701 = { 432 + .err_mask = 0x3f, 433 + .ecc_strength = ecc_strength_mt2701, 434 + .num_ecc_strength = 20, 435 + }; 436 + 437 + static const struct of_device_id mtk_ecc_dt_match[] = { 438 + { 439 + .compatible = "mediatek,mt2701-ecc", 440 + .data = &mtk_ecc_caps_mt2701, 441 + }, 442 + {}, 443 + }; 376 444 377 445 static int mtk_ecc_probe(struct platform_device *pdev) 378 446 { 379 447 struct device *dev = &pdev->dev; 380 448 struct mtk_ecc *ecc; 381 449 struct resource *res; 450 + const struct of_device_id *of_ecc_id = NULL; 451 + u32 max_eccdata_size; 382 452 int irq, ret; 383 453 384 454 ecc = devm_kzalloc(dev, sizeof(*ecc), GFP_KERNEL); 385 455 if (!ecc) 456 + return -ENOMEM; 457 + 458 + of_ecc_id = of_match_device(mtk_ecc_dt_match, &pdev->dev); 459 + if (!of_ecc_id) 460 + return -ENODEV; 461 + 462 + ecc->caps = of_ecc_id->data; 463 + 464 + max_eccdata_size = ecc->caps->num_ecc_strength - 1; 465 + max_eccdata_size = ecc->caps->ecc_strength[max_eccdata_size]; 466 + max_eccdata_size = (max_eccdata_size * ECC_PARITY_BITS + 7) >> 3; 467 + max_eccdata_size = round_up(max_eccdata_size, 4); 468 + ecc->eccdata = devm_kzalloc(dev, max_eccdata_size, GFP_KERNEL); 469 + if (!ecc->eccdata) 386 470 return -ENOMEM; 387 471 388 472 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ··· 481 507 482 508 static SIMPLE_DEV_PM_OPS(mtk_ecc_pm_ops, mtk_ecc_suspend, mtk_ecc_resume); 483 509 #endif 484 - 485 - static const struct of_device_id mtk_ecc_dt_match[] = { 486 - { .compatible = "mediatek,mt2701-ecc" }, 487 - {}, 488 - }; 489 510 490 511 MODULE_DEVICE_TABLE(of, mtk_ecc_dt_match); 491 512
+1 -1
drivers/mtd/nand/mtk_ecc.h
··· 42 42 int mtk_ecc_wait_done(struct mtk_ecc *, enum mtk_ecc_operation); 43 43 int mtk_ecc_enable(struct mtk_ecc *, struct mtk_ecc_config *); 44 44 void mtk_ecc_disable(struct mtk_ecc *); 45 - void mtk_ecc_adjust_strength(u32 *); 45 + void mtk_ecc_adjust_strength(struct mtk_ecc *ecc, u32 *p); 46 46 47 47 struct mtk_ecc *of_mtk_ecc_get(struct device_node *); 48 48 void mtk_ecc_release(struct mtk_ecc *);
+77 -92
drivers/mtd/nand/mtk_nand.c
··· 24 24 #include <linux/module.h> 25 25 #include <linux/iopoll.h> 26 26 #include <linux/of.h> 27 + #include <linux/of_device.h> 27 28 #include "mtk_ecc.h" 28 29 29 30 /* NAND controller register definition */ ··· 39 38 #define NFI_PAGEFMT (0x04) 40 39 #define PAGEFMT_FDM_ECC_SHIFT (12) 41 40 #define PAGEFMT_FDM_SHIFT (8) 42 - #define PAGEFMT_SPARE_16 (0) 43 - #define PAGEFMT_SPARE_26 (1) 44 - #define PAGEFMT_SPARE_27 (2) 45 - #define PAGEFMT_SPARE_28 (3) 46 - #define PAGEFMT_SPARE_32 (4) 47 - #define PAGEFMT_SPARE_36 (5) 48 - #define PAGEFMT_SPARE_40 (6) 49 - #define PAGEFMT_SPARE_44 (7) 50 - #define PAGEFMT_SPARE_48 (8) 51 - #define PAGEFMT_SPARE_49 (9) 52 - #define PAGEFMT_SPARE_50 (0xa) 53 - #define PAGEFMT_SPARE_51 (0xb) 54 - #define PAGEFMT_SPARE_52 (0xc) 55 - #define PAGEFMT_SPARE_62 (0xd) 56 - #define PAGEFMT_SPARE_63 (0xe) 57 - #define PAGEFMT_SPARE_64 (0xf) 58 - #define PAGEFMT_SPARE_SHIFT (4) 59 41 #define PAGEFMT_SEC_SEL_512 BIT(2) 60 42 #define PAGEFMT_512_2K (0) 61 43 #define PAGEFMT_2K_4K (1) ··· 99 115 #define MTK_RESET_TIMEOUT (1000000) 100 116 #define MTK_MAX_SECTOR (16) 101 117 #define MTK_NAND_MAX_NSELS (2) 118 + #define MTK_NFC_MIN_SPARE (16) 119 + 120 + struct mtk_nfc_caps { 121 + const u8 *spare_size; 122 + u8 num_spare_size; 123 + u8 pageformat_spare_shift; 124 + }; 102 125 103 126 struct mtk_nfc_bad_mark_ctl { 104 127 void (*bm_swap)(struct mtd_info *, u8 *buf, int raw); ··· 146 155 struct mtk_ecc *ecc; 147 156 148 157 struct device *dev; 158 + const struct mtk_nfc_caps *caps; 149 159 void __iomem *regs; 150 160 151 161 struct completion done; 152 162 struct list_head chips; 153 163 154 164 u8 *buffer; 165 + }; 166 + 167 + /* 168 + * supported spare size of each IP. 169 + * order should be the same with the spare size bitfiled defination of 170 + * register NFI_PAGEFMT. 171 + */ 172 + static const u8 spare_size_mt2701[] = { 173 + 16, 26, 27, 28, 32, 36, 40, 44, 48, 49, 50, 51, 52, 62, 63, 64 155 174 }; 156 175 157 176 static inline struct mtk_nfc_nand_chip *to_mtk_nand(struct nand_chip *nand) ··· 309 308 struct nand_chip *chip = mtd_to_nand(mtd); 310 309 struct mtk_nfc_nand_chip *mtk_nand = to_mtk_nand(chip); 311 310 struct mtk_nfc *nfc = nand_get_controller_data(chip); 312 - u32 fmt, spare; 311 + u32 fmt, spare, i; 313 312 314 313 if (!mtd->writesize) 315 314 return 0; ··· 353 352 if (chip->ecc.size == 1024) 354 353 spare >>= 1; 355 354 356 - switch (spare) { 357 - case 16: 358 - fmt |= (PAGEFMT_SPARE_16 << PAGEFMT_SPARE_SHIFT); 359 - break; 360 - case 26: 361 - fmt |= (PAGEFMT_SPARE_26 << PAGEFMT_SPARE_SHIFT); 362 - break; 363 - case 27: 364 - fmt |= (PAGEFMT_SPARE_27 << PAGEFMT_SPARE_SHIFT); 365 - break; 366 - case 28: 367 - fmt |= (PAGEFMT_SPARE_28 << PAGEFMT_SPARE_SHIFT); 368 - break; 369 - case 32: 370 - fmt |= (PAGEFMT_SPARE_32 << PAGEFMT_SPARE_SHIFT); 371 - break; 372 - case 36: 373 - fmt |= (PAGEFMT_SPARE_36 << PAGEFMT_SPARE_SHIFT); 374 - break; 375 - case 40: 376 - fmt |= (PAGEFMT_SPARE_40 << PAGEFMT_SPARE_SHIFT); 377 - break; 378 - case 44: 379 - fmt |= (PAGEFMT_SPARE_44 << PAGEFMT_SPARE_SHIFT); 380 - break; 381 - case 48: 382 - fmt |= (PAGEFMT_SPARE_48 << PAGEFMT_SPARE_SHIFT); 383 - break; 384 - case 49: 385 - fmt |= (PAGEFMT_SPARE_49 << PAGEFMT_SPARE_SHIFT); 386 - break; 387 - case 50: 388 - fmt |= (PAGEFMT_SPARE_50 << PAGEFMT_SPARE_SHIFT); 389 - break; 390 - case 51: 391 - fmt |= (PAGEFMT_SPARE_51 << PAGEFMT_SPARE_SHIFT); 392 - break; 393 - case 52: 394 - fmt |= (PAGEFMT_SPARE_52 << PAGEFMT_SPARE_SHIFT); 395 - break; 396 - case 62: 397 - fmt |= (PAGEFMT_SPARE_62 << PAGEFMT_SPARE_SHIFT); 398 - break; 399 - case 63: 400 - fmt |= (PAGEFMT_SPARE_63 << PAGEFMT_SPARE_SHIFT); 401 - break; 402 - case 64: 403 - fmt |= (PAGEFMT_SPARE_64 << PAGEFMT_SPARE_SHIFT); 404 - break; 405 - default: 406 - dev_err(nfc->dev, "invalid spare per sector %d\n", spare); 355 + for (i = 0; i < nfc->caps->num_spare_size; i++) { 356 + if (nfc->caps->spare_size[i] == spare) 357 + break; 358 + } 359 + 360 + if (i == nfc->caps->num_spare_size) { 361 + dev_err(nfc->dev, "invalid spare size %d\n", spare); 407 362 return -EINVAL; 408 363 } 364 + 365 + fmt |= i << nfc->caps->pageformat_spare_shift; 409 366 410 367 fmt |= mtk_nand->fdm.reg_size << PAGEFMT_FDM_SHIFT; 411 368 fmt |= mtk_nand->fdm.ecc_size << PAGEFMT_FDM_ECC_SHIFT; ··· 1090 1131 } 1091 1132 } 1092 1133 1093 - static void mtk_nfc_set_spare_per_sector(u32 *sps, struct mtd_info *mtd) 1134 + static int mtk_nfc_set_spare_per_sector(u32 *sps, struct mtd_info *mtd) 1094 1135 { 1095 1136 struct nand_chip *nand = mtd_to_nand(mtd); 1096 - u32 spare[] = {16, 26, 27, 28, 32, 36, 40, 44, 1097 - 48, 49, 50, 51, 52, 62, 63, 64}; 1098 - u32 eccsteps, i; 1137 + struct mtk_nfc *nfc = nand_get_controller_data(nand); 1138 + const u8 *spare = nfc->caps->spare_size; 1139 + u32 eccsteps, i, closest_spare = 0; 1099 1140 1100 1141 eccsteps = mtd->writesize / nand->ecc.size; 1101 1142 *sps = mtd->oobsize / eccsteps; ··· 1103 1144 if (nand->ecc.size == 1024) 1104 1145 *sps >>= 1; 1105 1146 1106 - for (i = 0; i < ARRAY_SIZE(spare); i++) { 1107 - if (*sps <= spare[i]) { 1108 - if (!i) 1109 - *sps = spare[i]; 1110 - else if (*sps != spare[i]) 1111 - *sps = spare[i - 1]; 1112 - break; 1147 + if (*sps < MTK_NFC_MIN_SPARE) 1148 + return -EINVAL; 1149 + 1150 + for (i = 0; i < nfc->caps->num_spare_size; i++) { 1151 + if (*sps >= spare[i] && spare[i] >= spare[closest_spare]) { 1152 + closest_spare = i; 1153 + if (*sps == spare[i]) 1154 + break; 1113 1155 } 1114 1156 } 1115 1157 1116 - if (i >= ARRAY_SIZE(spare)) 1117 - *sps = spare[ARRAY_SIZE(spare) - 1]; 1158 + *sps = spare[closest_spare]; 1118 1159 1119 1160 if (nand->ecc.size == 1024) 1120 1161 *sps <<= 1; 1162 + 1163 + return 0; 1121 1164 } 1122 1165 1123 1166 static int mtk_nfc_ecc_init(struct device *dev, struct mtd_info *mtd) 1124 1167 { 1125 1168 struct nand_chip *nand = mtd_to_nand(mtd); 1169 + struct mtk_nfc *nfc = nand_get_controller_data(nand); 1126 1170 u32 spare; 1127 - int free; 1171 + int free, ret; 1128 1172 1129 1173 /* support only ecc hw mode */ 1130 1174 if (nand->ecc.mode != NAND_ECC_HW) { ··· 1156 1194 nand->ecc.size = 1024; 1157 1195 } 1158 1196 1159 - mtk_nfc_set_spare_per_sector(&spare, mtd); 1197 + ret = mtk_nfc_set_spare_per_sector(&spare, mtd); 1198 + if (ret) 1199 + return ret; 1160 1200 1161 1201 /* calculate oob bytes except ecc parity data */ 1162 1202 free = ((nand->ecc.strength * ECC_PARITY_BITS) + 7) >> 3; ··· 1178 1214 } 1179 1215 } 1180 1216 1181 - mtk_ecc_adjust_strength(&nand->ecc.strength); 1217 + mtk_ecc_adjust_strength(nfc->ecc, &nand->ecc.strength); 1182 1218 1183 1219 dev_info(dev, "eccsize %d eccstrength %d\n", 1184 1220 nand->ecc.size, nand->ecc.strength); ··· 1276 1312 return -EINVAL; 1277 1313 } 1278 1314 1279 - mtk_nfc_set_spare_per_sector(&chip->spare_per_sector, mtd); 1315 + ret = mtk_nfc_set_spare_per_sector(&chip->spare_per_sector, mtd); 1316 + if (ret) 1317 + return ret; 1318 + 1280 1319 mtk_nfc_set_fdm(&chip->fdm, mtd); 1281 1320 mtk_nfc_set_bad_mark_ctl(&chip->bad_mark, mtd); 1282 1321 ··· 1321 1354 return 0; 1322 1355 } 1323 1356 1357 + static const struct mtk_nfc_caps mtk_nfc_caps_mt2701 = { 1358 + .spare_size = spare_size_mt2701, 1359 + .num_spare_size = 16, 1360 + .pageformat_spare_shift = 4, 1361 + }; 1362 + 1363 + static const struct of_device_id mtk_nfc_id_table[] = { 1364 + { 1365 + .compatible = "mediatek,mt2701-nfc", 1366 + .data = &mtk_nfc_caps_mt2701, 1367 + }, 1368 + {} 1369 + }; 1370 + MODULE_DEVICE_TABLE(of, mtk_nfc_id_table); 1371 + 1324 1372 static int mtk_nfc_probe(struct platform_device *pdev) 1325 1373 { 1326 1374 struct device *dev = &pdev->dev; 1327 1375 struct device_node *np = dev->of_node; 1328 1376 struct mtk_nfc *nfc; 1329 1377 struct resource *res; 1378 + const struct of_device_id *of_nfc_id = NULL; 1330 1379 int ret, irq; 1331 1380 1332 1381 nfc = devm_kzalloc(dev, sizeof(*nfc), GFP_KERNEL); ··· 1405 1422 dev_err(dev, "failed to set dma mask\n"); 1406 1423 goto clk_disable; 1407 1424 } 1425 + 1426 + of_nfc_id = of_match_device(mtk_nfc_id_table, &pdev->dev); 1427 + if (!of_nfc_id) { 1428 + ret = -ENODEV; 1429 + goto clk_disable; 1430 + } 1431 + 1432 + nfc->caps = of_nfc_id->data; 1408 1433 1409 1434 platform_set_drvdata(pdev, nfc); 1410 1435 ··· 1493 1502 1494 1503 static SIMPLE_DEV_PM_OPS(mtk_nfc_pm_ops, mtk_nfc_suspend, mtk_nfc_resume); 1495 1504 #endif 1496 - 1497 - static const struct of_device_id mtk_nfc_id_table[] = { 1498 - { .compatible = "mediatek,mt2701-nfc" }, 1499 - {} 1500 - }; 1501 - MODULE_DEVICE_TABLE(of, mtk_nfc_id_table); 1502 1505 1503 1506 static struct platform_driver mtk_nfc_driver = { 1504 1507 .probe = mtk_nfc_probe,