Lines Matching refs:nand_chip
25 struct nand_chip nand_chip; member
36 static void socrates_nand_write_buf(struct nand_chip *this, const uint8_t *buf, in socrates_nand_write_buf()
55 static void socrates_nand_read_buf(struct nand_chip *this, uint8_t *buf, in socrates_nand_read_buf()
75 static uint8_t socrates_nand_read_byte(struct nand_chip *this) in socrates_nand_read_byte()
85 static void socrates_nand_cmd_ctrl(struct nand_chip *nand_chip, int cmd, in socrates_nand_cmd_ctrl() argument
88 struct socrates_nand_host *host = nand_get_controller_data(nand_chip); in socrates_nand_cmd_ctrl()
110 static int socrates_nand_device_ready(struct nand_chip *nand_chip) in socrates_nand_device_ready() argument
112 struct socrates_nand_host *host = nand_get_controller_data(nand_chip); in socrates_nand_device_ready()
126 struct nand_chip *nand_chip; in socrates_nand_probe() local
140 nand_chip = &host->nand_chip; in socrates_nand_probe()
141 mtd = nand_to_mtd(nand_chip); in socrates_nand_probe()
145 nand_set_controller_data(nand_chip, host); in socrates_nand_probe()
146 nand_set_flash_node(nand_chip, ofdev->dev.of_node); in socrates_nand_probe()
150 nand_chip->legacy.cmd_ctrl = socrates_nand_cmd_ctrl; in socrates_nand_probe()
151 nand_chip->legacy.read_byte = socrates_nand_read_byte; in socrates_nand_probe()
152 nand_chip->legacy.write_buf = socrates_nand_write_buf; in socrates_nand_probe()
153 nand_chip->legacy.read_buf = socrates_nand_read_buf; in socrates_nand_probe()
154 nand_chip->legacy.dev_ready = socrates_nand_device_ready; in socrates_nand_probe()
156 nand_chip->ecc.mode = NAND_ECC_SOFT; /* enable ECC */ in socrates_nand_probe()
157 nand_chip->ecc.algo = NAND_ECC_HAMMING; in socrates_nand_probe()
160 nand_chip->legacy.chip_delay = 20; /* 20us command delay time */ in socrates_nand_probe()
164 res = nand_scan(nand_chip, 1); in socrates_nand_probe()
172 nand_release(nand_chip); in socrates_nand_probe()
186 nand_release(&host->nand_chip); in socrates_nand_remove()