Lines Matching full:nor

7 #include <linux/mtd/spi-nor.h>
19 static int at25fs_nor_lock(struct spi_nor *nor, loff_t ofs, u64 len)
24 static int at25fs_nor_unlock(struct spi_nor *nor, loff_t ofs, u64 len)
29 if (ofs || len != nor->params->size)
33 ret = spi_nor_write_sr_and_check(nor, 0);
35 dev_dbg(nor->dev, "unable to clear BP bits, WP# asserted?\n");
40 static int at25fs_nor_is_locked(struct spi_nor *nor, loff_t ofs, u64 len)
51 static int at25fs_nor_late_init(struct spi_nor *nor)
53 nor->params->locking_ops = &at25fs_nor_locking_ops;
64 * @nor: pointer to 'struct spi_nor'
71 static int atmel_nor_set_global_protection(struct spi_nor *nor, loff_t ofs,
78 if (ofs || len != nor->params->size)
81 ret = spi_nor_read_sr(nor, nor->bouncebuf);
85 sr = nor->bouncebuf[0];
90 ret = spi_nor_write_sr_and_check(nor, sr);
92 dev_dbg(nor->dev, "unable to clear SRWD bit, WP# asserted?\n");
111 nor->bouncebuf[0] = sr;
118 return spi_nor_write_sr(nor, nor->bouncebuf, 1);
121 static int atmel_nor_global_protect(struct spi_nor *nor, loff_t ofs, u64 len)
123 return atmel_nor_set_global_protection(nor, ofs, len, true);
126 static int atmel_nor_global_unprotect(struct spi_nor *nor, loff_t ofs, u64 len)
128 return atmel_nor_set_global_protection(nor, ofs, len, false);
131 static int atmel_nor_is_global_protected(struct spi_nor *nor, loff_t ofs,
136 if (ofs >= nor->params->size || (ofs + len) > nor->params->size)
139 ret = spi_nor_read_sr(nor, nor->bouncebuf);
143 return ((nor->bouncebuf[0] & ATMEL_SR_GLOBAL_PROTECT_MASK) == ATMEL_SR_GLOBAL_PROTECT_MASK);
152 static int atmel_nor_global_protection_late_init(struct spi_nor *nor)
154 nor->params->locking_ops = &atmel_nor_global_protection_ops;