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

Configure Feed

Select the types of activity you want to include in your feed.

mtd: rawnand: sunxi: introduce reg_pat_id in sunxi_nfc_caps

The H6/H616 pattern ID register is not at the same offset as the
A10/A23 one, so move its offset into sunxi_nfc_caps.

No functional change.

Signed-off-by: Richard Genoud <richard.genoud@bootlin.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

authored by

Richard Genoud and committed by
Miquel Raynal
ee61bba4 1340fa87

+7 -2
+7 -2
drivers/mtd/nand/raw/sunxi_nand.c
··· 55 55 #define NFC_REG_A10_USER_DATA 0x0050 56 56 #define NFC_REG_USER_DATA(nfc, x) (nfc->caps->reg_user_data + ((x) * 4)) 57 57 #define NFC_REG_SPARE_AREA 0x00A0 58 - #define NFC_REG_PAT_ID 0x00A4 58 + #define NFC_REG_PAT_ID(nfc) (nfc->caps->reg_pat_id) 59 + #define NFC_REG_A10_PAT_ID 0x00A4 59 60 #define NFC_REG_MDMA_ADDR 0x00C0 60 61 #define NFC_REG_MDMA_CNT 0x00C4 61 62 #define NFC_RAM0_BASE 0x0400 ··· 239 238 * @reg_io_data: I/O data register 240 239 * @reg_ecc_err_cnt: ECC error counter register 241 240 * @reg_user_data: User data register 241 + * @reg_pat_id: Pattern ID Register 242 242 * @reg_pat_found: Data Pattern Status Register 243 243 * @random_en_mask: RANDOM_EN mask in NFC_ECC_CTL register 244 244 * @random_dir_mask: RANDOM_DIRECTION mask in NFC_ECC_CTL register ··· 255 253 unsigned int reg_io_data; 256 254 unsigned int reg_ecc_err_cnt; 257 255 unsigned int reg_user_data; 256 + unsigned int reg_pat_id; 258 257 unsigned int reg_pat_found; 259 258 unsigned int random_en_mask; 260 259 unsigned int random_dir_mask; ··· 816 813 if (pattern_found & BIT(step)) { 817 814 u8 pattern; 818 815 819 - if (unlikely(!(readl(nfc->regs + NFC_REG_PAT_ID) & 0x1))) { 816 + if (unlikely(!(readl(nfc->regs + NFC_REG_PAT_ID(nfc)) & 0x1))) { 820 817 pattern = 0x0; 821 818 } else { 822 819 pattern = 0xff; ··· 2236 2233 .reg_io_data = NFC_REG_A10_IO_DATA, 2237 2234 .reg_ecc_err_cnt = NFC_REG_A10_ECC_ERR_CNT, 2238 2235 .reg_user_data = NFC_REG_A10_USER_DATA, 2236 + .reg_pat_id = NFC_REG_A10_PAT_ID, 2239 2237 .reg_pat_found = NFC_REG_ECC_ST, 2240 2238 .random_en_mask = BIT(9), 2241 2239 .random_dir_mask = BIT(10), ··· 2253 2249 .reg_io_data = NFC_REG_A23_IO_DATA, 2254 2250 .reg_ecc_err_cnt = NFC_REG_A10_ECC_ERR_CNT, 2255 2251 .reg_user_data = NFC_REG_A10_USER_DATA, 2252 + .reg_pat_id = NFC_REG_A10_PAT_ID, 2256 2253 .reg_pat_found = NFC_REG_ECC_ST, 2257 2254 .random_en_mask = BIT(9), 2258 2255 .random_dir_mask = BIT(10),