Lines Matching refs:flash

40 	struct m25p *flash = nor->priv;  in m25p80_read_reg()  local
41 struct spi_device *spi = flash->spi; in m25p80_read_reg()
68 struct m25p *flash = nor->priv; in m25p80_write_reg() local
69 struct spi_device *spi = flash->spi; in m25p80_write_reg()
71 flash->command[0] = opcode; in m25p80_write_reg()
73 memcpy(&flash->command[1], buf, len); in m25p80_write_reg()
75 return spi_write(spi, flash->command, len + 1); in m25p80_write_reg()
81 struct m25p *flash = nor->priv; in m25p80_write() local
82 struct spi_device *spi = flash->spi; in m25p80_write()
92 flash->command[0] = nor->program_opcode; in m25p80_write()
93 m25p_addr2cmd(nor, to, flash->command); in m25p80_write()
95 t[0].tx_buf = flash->command; in m25p80_write()
127 struct m25p *flash = nor->priv; in m25p80_read() local
128 struct spi_device *spi = flash->spi; in m25p80_read()
139 flash->command[0] = nor->read_opcode; in m25p80_read()
140 m25p_addr2cmd(nor, from, flash->command); in m25p80_read()
142 t[0].tx_buf = flash->command; in m25p80_read()
159 struct m25p *flash = nor->priv; in m25p80_erase() local
162 flash->mtd.erasesize / 1024, (u32)offset); in m25p80_erase()
165 flash->command[0] = nor->erase_opcode; in m25p80_erase()
166 m25p_addr2cmd(nor, offset, flash->command); in m25p80_erase()
168 spi_write(flash->spi, flash->command, m25p_cmdsz(nor)); in m25p80_erase()
182 struct m25p *flash; in m25p_probe() local
190 flash = devm_kzalloc(&spi->dev, sizeof(*flash), GFP_KERNEL); in m25p_probe()
191 if (!flash) in m25p_probe()
194 nor = &flash->spi_nor; in m25p_probe()
204 nor->mtd = &flash->mtd; in m25p_probe()
205 nor->priv = flash; in m25p_probe()
207 spi_set_drvdata(spi, flash); in m25p_probe()
208 flash->mtd.priv = nor; in m25p_probe()
209 flash->spi = spi; in m25p_probe()
217 flash->mtd.name = data->name; in m25p_probe()
237 return mtd_device_parse_register(&flash->mtd, NULL, &ppdata, in m25p_probe()
245 struct m25p *flash = spi_get_drvdata(spi); in m25p_remove() local
248 return mtd_device_unregister(&flash->mtd); in m25p_remove()