spinand 22 drivers/mtd/nand/spi/core.c static int spinand_read_reg_op(struct spinand_device *spinand, u8 reg, u8 *val) spinand 25 drivers/mtd/nand/spi/core.c spinand->scratchbuf); spinand 28 drivers/mtd/nand/spi/core.c ret = spi_mem_exec_op(spinand->spimem, &op); spinand 32 drivers/mtd/nand/spi/core.c *val = *spinand->scratchbuf; spinand 36 drivers/mtd/nand/spi/core.c static int spinand_write_reg_op(struct spinand_device *spinand, u8 reg, u8 val) spinand 39 drivers/mtd/nand/spi/core.c spinand->scratchbuf); spinand 41 drivers/mtd/nand/spi/core.c *spinand->scratchbuf = val; spinand 42 drivers/mtd/nand/spi/core.c return spi_mem_exec_op(spinand->spimem, &op); spinand 45 drivers/mtd/nand/spi/core.c static int spinand_read_status(struct spinand_device *spinand, u8 *status) spinand 47 drivers/mtd/nand/spi/core.c return spinand_read_reg_op(spinand, REG_STATUS, status); spinand 50 drivers/mtd/nand/spi/core.c static int spinand_get_cfg(struct spinand_device *spinand, u8 *cfg) spinand 52 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); spinand 54 drivers/mtd/nand/spi/core.c if (WARN_ON(spinand->cur_target < 0 || spinand 55 drivers/mtd/nand/spi/core.c spinand->cur_target >= nand->memorg.ntargets)) spinand 58 drivers/mtd/nand/spi/core.c *cfg = spinand->cfg_cache[spinand->cur_target]; spinand 62 drivers/mtd/nand/spi/core.c static int spinand_set_cfg(struct spinand_device *spinand, u8 cfg) spinand 64 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); spinand 67 drivers/mtd/nand/spi/core.c if (WARN_ON(spinand->cur_target < 0 || spinand 68 drivers/mtd/nand/spi/core.c spinand->cur_target >= nand->memorg.ntargets)) spinand 71 drivers/mtd/nand/spi/core.c if (spinand->cfg_cache[spinand->cur_target] == cfg) spinand 74 drivers/mtd/nand/spi/core.c ret = spinand_write_reg_op(spinand, REG_CFG, cfg); spinand 78 drivers/mtd/nand/spi/core.c spinand->cfg_cache[spinand->cur_target] = cfg; spinand 92 drivers/mtd/nand/spi/core.c int spinand_upd_cfg(struct spinand_device *spinand, u8 mask, u8 val) spinand 97 drivers/mtd/nand/spi/core.c ret = spinand_get_cfg(spinand, &cfg); spinand 104 drivers/mtd/nand/spi/core.c return spinand_set_cfg(spinand, cfg); spinand 116 drivers/mtd/nand/spi/core.c int spinand_select_target(struct spinand_device *spinand, unsigned int target) spinand 118 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); spinand 124 drivers/mtd/nand/spi/core.c if (spinand->cur_target == target) spinand 128 drivers/mtd/nand/spi/core.c spinand->cur_target = target; spinand 132 drivers/mtd/nand/spi/core.c ret = spinand->select_target(spinand, target); spinand 136 drivers/mtd/nand/spi/core.c spinand->cur_target = target; spinand 140 drivers/mtd/nand/spi/core.c static int spinand_init_cfg_cache(struct spinand_device *spinand) spinand 142 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); spinand 143 drivers/mtd/nand/spi/core.c struct device *dev = &spinand->spimem->spi->dev; spinand 147 drivers/mtd/nand/spi/core.c spinand->cfg_cache = devm_kcalloc(dev, spinand 149 drivers/mtd/nand/spi/core.c sizeof(*spinand->cfg_cache), spinand 151 drivers/mtd/nand/spi/core.c if (!spinand->cfg_cache) spinand 155 drivers/mtd/nand/spi/core.c ret = spinand_select_target(spinand, target); spinand 163 drivers/mtd/nand/spi/core.c ret = spinand_read_reg_op(spinand, REG_CFG, spinand 164 drivers/mtd/nand/spi/core.c &spinand->cfg_cache[target]); spinand 172 drivers/mtd/nand/spi/core.c static int spinand_init_quad_enable(struct spinand_device *spinand) spinand 176 drivers/mtd/nand/spi/core.c if (!(spinand->flags & SPINAND_HAS_QE_BIT)) spinand 179 drivers/mtd/nand/spi/core.c if (spinand->op_templates.read_cache->data.buswidth == 4 || spinand 180 drivers/mtd/nand/spi/core.c spinand->op_templates.write_cache->data.buswidth == 4 || spinand 181 drivers/mtd/nand/spi/core.c spinand->op_templates.update_cache->data.buswidth == 4) spinand 184 drivers/mtd/nand/spi/core.c return spinand_upd_cfg(spinand, CFG_QUAD_ENABLE, spinand 188 drivers/mtd/nand/spi/core.c static int spinand_ecc_enable(struct spinand_device *spinand, spinand 191 drivers/mtd/nand/spi/core.c return spinand_upd_cfg(spinand, CFG_ECC_ENABLE, spinand 195 drivers/mtd/nand/spi/core.c static int spinand_write_enable_op(struct spinand_device *spinand) spinand 199 drivers/mtd/nand/spi/core.c return spi_mem_exec_op(spinand->spimem, &op); spinand 202 drivers/mtd/nand/spi/core.c static int spinand_load_page_op(struct spinand_device *spinand, spinand 205 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); spinand 209 drivers/mtd/nand/spi/core.c return spi_mem_exec_op(spinand->spimem, &op); spinand 212 drivers/mtd/nand/spi/core.c static int spinand_read_from_cache_op(struct spinand_device *spinand, spinand 215 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); spinand 224 drivers/mtd/nand/spi/core.c buf = spinand->databuf; spinand 232 drivers/mtd/nand/spi/core.c buf = spinand->oobbuf; spinand 237 drivers/mtd/nand/spi/core.c rdesc = spinand->dirmaps[req->pos.plane].rdesc; spinand 253 drivers/mtd/nand/spi/core.c memcpy(req->databuf.in, spinand->databuf + req->dataoffs, spinand 259 drivers/mtd/nand/spi/core.c spinand->oobbuf, spinand 263 drivers/mtd/nand/spi/core.c memcpy(req->oobbuf.in, spinand->oobbuf + req->ooboffs, spinand 270 drivers/mtd/nand/spi/core.c static int spinand_write_to_cache_op(struct spinand_device *spinand, spinand 273 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); spinand 277 drivers/mtd/nand/spi/core.c void *buf = spinand->databuf; spinand 288 drivers/mtd/nand/spi/core.c memset(spinand->databuf, 0xff, nbytes); spinand 291 drivers/mtd/nand/spi/core.c memcpy(spinand->databuf + req->dataoffs, req->databuf.out, spinand 297 drivers/mtd/nand/spi/core.c spinand->oobbuf, spinand 301 drivers/mtd/nand/spi/core.c memcpy(spinand->oobbuf + req->ooboffs, req->oobbuf.out, spinand 305 drivers/mtd/nand/spi/core.c wdesc = spinand->dirmaps[req->pos.plane].wdesc; spinand 323 drivers/mtd/nand/spi/core.c static int spinand_program_op(struct spinand_device *spinand, spinand 326 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); spinand 330 drivers/mtd/nand/spi/core.c return spi_mem_exec_op(spinand->spimem, &op); spinand 333 drivers/mtd/nand/spi/core.c static int spinand_erase_op(struct spinand_device *spinand, spinand 336 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); spinand 340 drivers/mtd/nand/spi/core.c return spi_mem_exec_op(spinand->spimem, &op); spinand 343 drivers/mtd/nand/spi/core.c static int spinand_wait(struct spinand_device *spinand, u8 *s) spinand 350 drivers/mtd/nand/spi/core.c ret = spinand_read_status(spinand, &status); spinand 362 drivers/mtd/nand/spi/core.c ret = spinand_read_status(spinand, &status); spinand 373 drivers/mtd/nand/spi/core.c static int spinand_read_id_op(struct spinand_device *spinand, u8 *buf) spinand 375 drivers/mtd/nand/spi/core.c struct spi_mem_op op = SPINAND_READID_OP(0, spinand->scratchbuf, spinand 379 drivers/mtd/nand/spi/core.c ret = spi_mem_exec_op(spinand->spimem, &op); spinand 381 drivers/mtd/nand/spi/core.c memcpy(buf, spinand->scratchbuf, SPINAND_MAX_ID_LEN); spinand 386 drivers/mtd/nand/spi/core.c static int spinand_reset_op(struct spinand_device *spinand) spinand 391 drivers/mtd/nand/spi/core.c ret = spi_mem_exec_op(spinand->spimem, &op); spinand 395 drivers/mtd/nand/spi/core.c return spinand_wait(spinand, NULL); spinand 398 drivers/mtd/nand/spi/core.c static int spinand_lock_block(struct spinand_device *spinand, u8 lock) spinand 400 drivers/mtd/nand/spi/core.c return spinand_write_reg_op(spinand, REG_BLOCK_LOCK, lock); spinand 403 drivers/mtd/nand/spi/core.c static int spinand_check_ecc_status(struct spinand_device *spinand, u8 status) spinand 405 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); spinand 407 drivers/mtd/nand/spi/core.c if (spinand->eccinfo.get_status) spinand 408 drivers/mtd/nand/spi/core.c return spinand->eccinfo.get_status(spinand, status); spinand 432 drivers/mtd/nand/spi/core.c static int spinand_read_page(struct spinand_device *spinand, spinand 439 drivers/mtd/nand/spi/core.c ret = spinand_load_page_op(spinand, req); spinand 443 drivers/mtd/nand/spi/core.c ret = spinand_wait(spinand, &status); spinand 447 drivers/mtd/nand/spi/core.c ret = spinand_read_from_cache_op(spinand, req); spinand 454 drivers/mtd/nand/spi/core.c return spinand_check_ecc_status(spinand, status); spinand 457 drivers/mtd/nand/spi/core.c static int spinand_write_page(struct spinand_device *spinand, spinand 463 drivers/mtd/nand/spi/core.c ret = spinand_write_enable_op(spinand); spinand 467 drivers/mtd/nand/spi/core.c ret = spinand_write_to_cache_op(spinand, req); spinand 471 drivers/mtd/nand/spi/core.c ret = spinand_program_op(spinand, req); spinand 475 drivers/mtd/nand/spi/core.c ret = spinand_wait(spinand, &status); spinand 485 drivers/mtd/nand/spi/core.c struct spinand_device *spinand = mtd_to_spinand(mtd); spinand 493 drivers/mtd/nand/spi/core.c if (ops->mode != MTD_OPS_RAW && spinand->eccinfo.ooblayout) spinand 496 drivers/mtd/nand/spi/core.c mutex_lock(&spinand->lock); spinand 499 drivers/mtd/nand/spi/core.c ret = spinand_select_target(spinand, iter.req.pos.target); spinand 503 drivers/mtd/nand/spi/core.c ret = spinand_ecc_enable(spinand, enable_ecc); spinand 507 drivers/mtd/nand/spi/core.c ret = spinand_read_page(spinand, &iter.req, enable_ecc); spinand 524 drivers/mtd/nand/spi/core.c mutex_unlock(&spinand->lock); spinand 535 drivers/mtd/nand/spi/core.c struct spinand_device *spinand = mtd_to_spinand(mtd); spinand 544 drivers/mtd/nand/spi/core.c mutex_lock(&spinand->lock); spinand 547 drivers/mtd/nand/spi/core.c ret = spinand_select_target(spinand, iter.req.pos.target); spinand 551 drivers/mtd/nand/spi/core.c ret = spinand_ecc_enable(spinand, enable_ecc); spinand 555 drivers/mtd/nand/spi/core.c ret = spinand_write_page(spinand, &iter.req); spinand 563 drivers/mtd/nand/spi/core.c mutex_unlock(&spinand->lock); spinand 570 drivers/mtd/nand/spi/core.c struct spinand_device *spinand = nand_to_spinand(nand); spinand 580 drivers/mtd/nand/spi/core.c spinand_select_target(spinand, pos->target); spinand 581 drivers/mtd/nand/spi/core.c spinand_read_page(spinand, &req, false); spinand 591 drivers/mtd/nand/spi/core.c struct spinand_device *spinand = nand_to_spinand(nand); spinand 596 drivers/mtd/nand/spi/core.c mutex_lock(&spinand->lock); spinand 598 drivers/mtd/nand/spi/core.c mutex_unlock(&spinand->lock); spinand 605 drivers/mtd/nand/spi/core.c struct spinand_device *spinand = nand_to_spinand(nand); spinand 616 drivers/mtd/nand/spi/core.c ret = spinand_select_target(spinand, pos->target); spinand 620 drivers/mtd/nand/spi/core.c ret = spinand_write_enable_op(spinand); spinand 624 drivers/mtd/nand/spi/core.c return spinand_write_page(spinand, &req); spinand 630 drivers/mtd/nand/spi/core.c struct spinand_device *spinand = nand_to_spinand(nand); spinand 635 drivers/mtd/nand/spi/core.c mutex_lock(&spinand->lock); spinand 637 drivers/mtd/nand/spi/core.c mutex_unlock(&spinand->lock); spinand 644 drivers/mtd/nand/spi/core.c struct spinand_device *spinand = nand_to_spinand(nand); spinand 648 drivers/mtd/nand/spi/core.c ret = spinand_select_target(spinand, pos->target); spinand 652 drivers/mtd/nand/spi/core.c ret = spinand_write_enable_op(spinand); spinand 656 drivers/mtd/nand/spi/core.c ret = spinand_erase_op(spinand, pos); spinand 660 drivers/mtd/nand/spi/core.c ret = spinand_wait(spinand, &status); spinand 670 drivers/mtd/nand/spi/core.c struct spinand_device *spinand = mtd_to_spinand(mtd); spinand 673 drivers/mtd/nand/spi/core.c mutex_lock(&spinand->lock); spinand 675 drivers/mtd/nand/spi/core.c mutex_unlock(&spinand->lock); spinand 682 drivers/mtd/nand/spi/core.c struct spinand_device *spinand = mtd_to_spinand(mtd); spinand 688 drivers/mtd/nand/spi/core.c mutex_lock(&spinand->lock); spinand 690 drivers/mtd/nand/spi/core.c mutex_unlock(&spinand->lock); spinand 695 drivers/mtd/nand/spi/core.c static int spinand_create_dirmap(struct spinand_device *spinand, spinand 698 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); spinand 708 drivers/mtd/nand/spi/core.c info.op_tmpl = *spinand->op_templates.update_cache; spinand 709 drivers/mtd/nand/spi/core.c desc = devm_spi_mem_dirmap_create(&spinand->spimem->spi->dev, spinand 710 drivers/mtd/nand/spi/core.c spinand->spimem, &info); spinand 714 drivers/mtd/nand/spi/core.c spinand->dirmaps[plane].wdesc = desc; spinand 716 drivers/mtd/nand/spi/core.c info.op_tmpl = *spinand->op_templates.read_cache; spinand 717 drivers/mtd/nand/spi/core.c desc = devm_spi_mem_dirmap_create(&spinand->spimem->spi->dev, spinand 718 drivers/mtd/nand/spi/core.c spinand->spimem, &info); spinand 722 drivers/mtd/nand/spi/core.c spinand->dirmaps[plane].rdesc = desc; spinand 727 drivers/mtd/nand/spi/core.c static int spinand_create_dirmaps(struct spinand_device *spinand) spinand 729 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); spinand 732 drivers/mtd/nand/spi/core.c spinand->dirmaps = devm_kzalloc(&spinand->spimem->spi->dev, spinand 733 drivers/mtd/nand/spi/core.c sizeof(*spinand->dirmaps) * spinand 736 drivers/mtd/nand/spi/core.c if (!spinand->dirmaps) spinand 740 drivers/mtd/nand/spi/core.c ret = spinand_create_dirmap(spinand, i); spinand 763 drivers/mtd/nand/spi/core.c static int spinand_manufacturer_detect(struct spinand_device *spinand) spinand 769 drivers/mtd/nand/spi/core.c ret = spinand_manufacturers[i]->ops->detect(spinand); spinand 771 drivers/mtd/nand/spi/core.c spinand->manufacturer = spinand_manufacturers[i]; spinand 781 drivers/mtd/nand/spi/core.c static int spinand_manufacturer_init(struct spinand_device *spinand) spinand 783 drivers/mtd/nand/spi/core.c if (spinand->manufacturer->ops->init) spinand 784 drivers/mtd/nand/spi/core.c return spinand->manufacturer->ops->init(spinand); spinand 789 drivers/mtd/nand/spi/core.c static void spinand_manufacturer_cleanup(struct spinand_device *spinand) spinand 792 drivers/mtd/nand/spi/core.c if (spinand->manufacturer->ops->cleanup) spinand 793 drivers/mtd/nand/spi/core.c return spinand->manufacturer->ops->cleanup(spinand); spinand 797 drivers/mtd/nand/spi/core.c spinand_select_op_variant(struct spinand_device *spinand, spinand 800 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); spinand 813 drivers/mtd/nand/spi/core.c ret = spi_mem_adjust_op_size(spinand->spimem, &op); spinand 817 drivers/mtd/nand/spi/core.c if (!spi_mem_supports_op(spinand->spimem, &op)) spinand 845 drivers/mtd/nand/spi/core.c int spinand_match_and_init(struct spinand_device *spinand, spinand 849 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); spinand 861 drivers/mtd/nand/spi/core.c spinand->eccinfo = table[i].eccinfo; spinand 862 drivers/mtd/nand/spi/core.c spinand->flags = table[i].flags; spinand 863 drivers/mtd/nand/spi/core.c spinand->select_target = table[i].select_target; spinand 865 drivers/mtd/nand/spi/core.c op = spinand_select_op_variant(spinand, spinand 870 drivers/mtd/nand/spi/core.c spinand->op_templates.read_cache = op; spinand 872 drivers/mtd/nand/spi/core.c op = spinand_select_op_variant(spinand, spinand 877 drivers/mtd/nand/spi/core.c spinand->op_templates.write_cache = op; spinand 879 drivers/mtd/nand/spi/core.c op = spinand_select_op_variant(spinand, spinand 881 drivers/mtd/nand/spi/core.c spinand->op_templates.update_cache = op; spinand 889 drivers/mtd/nand/spi/core.c static int spinand_detect(struct spinand_device *spinand) spinand 891 drivers/mtd/nand/spi/core.c struct device *dev = &spinand->spimem->spi->dev; spinand 892 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); spinand 895 drivers/mtd/nand/spi/core.c ret = spinand_reset_op(spinand); spinand 899 drivers/mtd/nand/spi/core.c ret = spinand_read_id_op(spinand, spinand->id.data); spinand 903 drivers/mtd/nand/spi/core.c spinand->id.len = SPINAND_MAX_ID_LEN; spinand 905 drivers/mtd/nand/spi/core.c ret = spinand_manufacturer_detect(spinand); spinand 908 drivers/mtd/nand/spi/core.c spinand->id.data); spinand 912 drivers/mtd/nand/spi/core.c if (nand->memorg.ntargets > 1 && !spinand->select_target) { spinand 918 drivers/mtd/nand/spi/core.c dev_info(&spinand->spimem->spi->dev, spinand 919 drivers/mtd/nand/spi/core.c "%s SPI NAND was found.\n", spinand->manufacturer->name); spinand 920 drivers/mtd/nand/spi/core.c dev_info(&spinand->spimem->spi->dev, spinand 952 drivers/mtd/nand/spi/core.c static int spinand_init(struct spinand_device *spinand) spinand 954 drivers/mtd/nand/spi/core.c struct device *dev = &spinand->spimem->spi->dev; spinand 955 drivers/mtd/nand/spi/core.c struct mtd_info *mtd = spinand_to_mtd(spinand); spinand 963 drivers/mtd/nand/spi/core.c spinand->scratchbuf = kzalloc(SPINAND_MAX_ID_LEN, GFP_KERNEL); spinand 964 drivers/mtd/nand/spi/core.c if (!spinand->scratchbuf) spinand 967 drivers/mtd/nand/spi/core.c ret = spinand_detect(spinand); spinand 976 drivers/mtd/nand/spi/core.c spinand->databuf = kzalloc(nanddev_page_size(nand) + spinand 979 drivers/mtd/nand/spi/core.c if (!spinand->databuf) { spinand 984 drivers/mtd/nand/spi/core.c spinand->oobbuf = spinand->databuf + nanddev_page_size(nand); spinand 986 drivers/mtd/nand/spi/core.c ret = spinand_init_cfg_cache(spinand); spinand 990 drivers/mtd/nand/spi/core.c ret = spinand_init_quad_enable(spinand); spinand 994 drivers/mtd/nand/spi/core.c ret = spinand_upd_cfg(spinand, CFG_OTP_ENABLE, 0); spinand 998 drivers/mtd/nand/spi/core.c ret = spinand_manufacturer_init(spinand); spinand 1006 drivers/mtd/nand/spi/core.c ret = spinand_create_dirmaps(spinand); spinand 1016 drivers/mtd/nand/spi/core.c ret = spinand_select_target(spinand, i); spinand 1020 drivers/mtd/nand/spi/core.c ret = spinand_lock_block(spinand, BL_ALL_UNLOCKED); spinand 1041 drivers/mtd/nand/spi/core.c if (spinand->eccinfo.ooblayout) spinand 1042 drivers/mtd/nand/spi/core.c mtd_set_ooblayout(mtd, spinand->eccinfo.ooblayout); spinand 1062 drivers/mtd/nand/spi/core.c spinand_manufacturer_cleanup(spinand); spinand 1065 drivers/mtd/nand/spi/core.c kfree(spinand->databuf); spinand 1066 drivers/mtd/nand/spi/core.c kfree(spinand->scratchbuf); spinand 1070 drivers/mtd/nand/spi/core.c static void spinand_cleanup(struct spinand_device *spinand) spinand 1072 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); spinand 1075 drivers/mtd/nand/spi/core.c spinand_manufacturer_cleanup(spinand); spinand 1076 drivers/mtd/nand/spi/core.c kfree(spinand->databuf); spinand 1077 drivers/mtd/nand/spi/core.c kfree(spinand->scratchbuf); spinand 1082 drivers/mtd/nand/spi/core.c struct spinand_device *spinand; spinand 1086 drivers/mtd/nand/spi/core.c spinand = devm_kzalloc(&mem->spi->dev, sizeof(*spinand), spinand 1088 drivers/mtd/nand/spi/core.c if (!spinand) spinand 1091 drivers/mtd/nand/spi/core.c spinand->spimem = mem; spinand 1092 drivers/mtd/nand/spi/core.c spi_mem_set_drvdata(mem, spinand); spinand 1093 drivers/mtd/nand/spi/core.c spinand_set_of_node(spinand, mem->spi->dev.of_node); spinand 1094 drivers/mtd/nand/spi/core.c mutex_init(&spinand->lock); spinand 1095 drivers/mtd/nand/spi/core.c mtd = spinand_to_mtd(spinand); spinand 1098 drivers/mtd/nand/spi/core.c ret = spinand_init(spinand); spinand 1109 drivers/mtd/nand/spi/core.c spinand_cleanup(spinand); spinand 1116 drivers/mtd/nand/spi/core.c struct spinand_device *spinand; spinand 1120 drivers/mtd/nand/spi/core.c spinand = spi_mem_get_drvdata(mem); spinand 1121 drivers/mtd/nand/spi/core.c mtd = spinand_to_mtd(spinand); spinand 1127 drivers/mtd/nand/spi/core.c spinand_cleanup(spinand); spinand 81 drivers/mtd/nand/spi/gigadevice.c static int gd5fxgq4xa_ecc_get_status(struct spinand_device *spinand, spinand 135 drivers/mtd/nand/spi/gigadevice.c static int gd5fxgq4uexxg_ecc_get_status(struct spinand_device *spinand, spinand 152 drivers/mtd/nand/spi/gigadevice.c ret = spi_mem_exec_op(spinand->spimem, &op); spinand 177 drivers/mtd/nand/spi/gigadevice.c static int gd5fxgq4ufxxg_ecc_get_status(struct spinand_device *spinand, spinand 245 drivers/mtd/nand/spi/gigadevice.c static int gigadevice_spinand_detect(struct spinand_device *spinand) spinand 247 drivers/mtd/nand/spi/gigadevice.c u8 *id = spinand->id.data; spinand 263 drivers/mtd/nand/spi/gigadevice.c ret = spinand_match_and_init(spinand, gigadevice_spinand_table, spinand 52 drivers/mtd/nand/spi/macronix.c static int mx35lf1ge4ab_get_eccsr(struct spinand_device *spinand, u8 *eccsr) spinand 59 drivers/mtd/nand/spi/macronix.c int ret = spi_mem_exec_op(spinand->spimem, &op); spinand 67 drivers/mtd/nand/spi/macronix.c static int mx35lf1ge4ab_ecc_get_status(struct spinand_device *spinand, spinand 70 drivers/mtd/nand/spi/macronix.c struct nand_device *nand = spinand_to_nand(spinand); spinand 86 drivers/mtd/nand/spi/macronix.c if (mx35lf1ge4ab_get_eccsr(spinand, &eccsr)) spinand 121 drivers/mtd/nand/spi/macronix.c static int macronix_spinand_detect(struct spinand_device *spinand) spinand 123 drivers/mtd/nand/spi/macronix.c u8 *id = spinand->id.data; spinand 133 drivers/mtd/nand/spi/macronix.c ret = spinand_match_and_init(spinand, macronix_spinand_table, spinand 67 drivers/mtd/nand/spi/micron.c static int mt29f2g01abagd_ecc_get_status(struct spinand_device *spinand, spinand 105 drivers/mtd/nand/spi/micron.c static int micron_spinand_detect(struct spinand_device *spinand) spinand 107 drivers/mtd/nand/spi/micron.c u8 *id = spinand->id.data; spinand 117 drivers/mtd/nand/spi/micron.c ret = spinand_match_and_init(spinand, micron_spinand_table, spinand 70 drivers/mtd/nand/spi/paragon.c static int pn26g0xa_ecc_get_status(struct spinand_device *spinand, spinand 120 drivers/mtd/nand/spi/paragon.c static int paragon_spinand_detect(struct spinand_device *spinand) spinand 122 drivers/mtd/nand/spi/paragon.c u8 *id = spinand->id.data; spinand 130 drivers/mtd/nand/spi/paragon.c ret = spinand_match_and_init(spinand, paragon_spinand_table, spinand 58 drivers/mtd/nand/spi/toshiba.c static int tc58cxgxsx_ecc_get_status(struct spinand_device *spinand, spinand 61 drivers/mtd/nand/spi/toshiba.c struct nand_device *nand = spinand_to_nand(spinand); spinand 79 drivers/mtd/nand/spi/toshiba.c if (spi_mem_exec_op(spinand->spimem, &op)) spinand 159 drivers/mtd/nand/spi/toshiba.c static int toshiba_spinand_detect(struct spinand_device *spinand) spinand 161 drivers/mtd/nand/spi/toshiba.c u8 *id = spinand->id.data; spinand 171 drivers/mtd/nand/spi/toshiba.c ret = spinand_match_and_init(spinand, toshiba_spinand_table, spinand 63 drivers/mtd/nand/spi/winbond.c static int w25m02gv_select_target(struct spinand_device *spinand, spinand 70 drivers/mtd/nand/spi/winbond.c spinand->scratchbuf, spinand 73 drivers/mtd/nand/spi/winbond.c *spinand->scratchbuf = target; spinand 74 drivers/mtd/nand/spi/winbond.c return spi_mem_exec_op(spinand->spimem, &op); spinand 102 drivers/mtd/nand/spi/winbond.c static int winbond_spinand_detect(struct spinand_device *spinand) spinand 104 drivers/mtd/nand/spi/winbond.c u8 *id = spinand->id.data; spinand 114 drivers/mtd/nand/spi/winbond.c ret = spinand_match_and_init(spinand, winbond_spinand_table, spinand 122 drivers/mtd/nand/spi/winbond.c static int winbond_spinand_init(struct spinand_device *spinand) spinand 124 drivers/mtd/nand/spi/winbond.c struct nand_device *nand = spinand_to_nand(spinand); spinand 132 drivers/mtd/nand/spi/winbond.c spinand_select_target(spinand, i); spinand 133 drivers/mtd/nand/spi/winbond.c spinand_upd_cfg(spinand, WINBOND_CFG_BUF_READ, spinand 209 include/linux/mtd/spinand.h int (*detect)(struct spinand_device *spinand); spinand 210 include/linux/mtd/spinand.h int (*init)(struct spinand_device *spinand); spinand 211 include/linux/mtd/spinand.h void (*cleanup)(struct spinand_device *spinand); spinand 268 include/linux/mtd/spinand.h int (*get_status)(struct spinand_device *spinand, u8 status); spinand 304 include/linux/mtd/spinand.h int (*select_target)(struct spinand_device *spinand, spinand 382 include/linux/mtd/spinand.h int (*select_target)(struct spinand_device *spinand, spinand 413 include/linux/mtd/spinand.h static inline struct mtd_info *spinand_to_mtd(struct spinand_device *spinand) spinand 415 include/linux/mtd/spinand.h return nanddev_to_mtd(&spinand->base); spinand 436 include/linux/mtd/spinand.h spinand_to_nand(struct spinand_device *spinand) spinand 438 include/linux/mtd/spinand.h return &spinand->base; spinand 448 include/linux/mtd/spinand.h static inline void spinand_set_of_node(struct spinand_device *spinand, spinand 451 include/linux/mtd/spinand.h nanddev_set_of_node(&spinand->base, np); spinand 458 include/linux/mtd/spinand.h int spinand_upd_cfg(struct spinand_device *spinand, u8 mask, u8 val); spinand 459 include/linux/mtd/spinand.h int spinand_select_target(struct spinand_device *spinand, unsigned int target);