Lines Matching refs:nor
7 #include <linux/mtd/spi-nor.h>
48 struct spi_nor *nor = mtd_to_spi_nor(mtd);
52 dev_dbg(nor->dev, "to 0x%08x, len %zd\n", (u32)to, len);
54 ret = spi_nor_lock_and_prep(nor);
58 ret = spi_nor_write_enable(nor);
62 nor->sst_write_second = false;
66 nor->program_opcode = SPINOR_OP_BP;
69 ret = spi_nor_write_data(nor, to, 1, buf);
73 ret = spi_nor_wait_till_ready(nor);
83 nor->program_opcode = SPINOR_OP_AAI_WP;
86 ret = spi_nor_write_data(nor, to, 2, buf + actual);
90 ret = spi_nor_wait_till_ready(nor);
94 nor->sst_write_second = true;
96 nor->sst_write_second = false;
98 ret = spi_nor_write_disable(nor);
102 ret = spi_nor_wait_till_ready(nor);
108 ret = spi_nor_write_enable(nor);
112 nor->program_opcode = SPINOR_OP_BP;
113 ret = spi_nor_write_data(nor, to, 1, buf + actual);
117 ret = spi_nor_wait_till_ready(nor);
123 ret = spi_nor_write_disable(nor);
127 spi_nor_unlock_and_unprep(nor);
131 static void sst_default_init(struct spi_nor *nor)
133 nor->flags |= SNOR_F_HAS_LOCK;
136 static void sst_post_sfdp_fixups(struct spi_nor *nor)
138 if (nor->info->flags & SST_WRITE)
139 nor->mtd._write = sst_write;