Lines Matching refs:mtd_info
42 struct mtd_info *mtd;
130 int (*ecc)(struct mtd_info *mtd, int section,
132 int (*free)(struct mtd_info *mtd, int section,
151 struct mtd_info { struct
233 int (*_erase) (struct mtd_info *mtd, struct erase_info *instr); argument
235 int (*_point) (struct mtd_info *mtd, loff_t from, size_t len, argument
237 int (*_unpoint) (struct mtd_info *mtd, loff_t from, size_t len); argument
239 unsigned long (*_get_unmapped_area) (struct mtd_info *mtd, argument
243 int (*_read) (struct mtd_info *mtd, loff_t from, size_t len, argument
245 int (*_write) (struct mtd_info *mtd, loff_t to, size_t len, argument
247 int (*_panic_write) (struct mtd_info *mtd, loff_t to, size_t len, argument
249 int (*_read_oob) (struct mtd_info *mtd, loff_t from, argument
251 int (*_write_oob) (struct mtd_info *mtd, loff_t to, argument
253 int (*_get_fact_prot_info) (struct mtd_info *mtd, size_t len, argument
255 int (*_read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, argument
257 int (*_get_user_prot_info) (struct mtd_info *mtd, size_t len, argument
259 int (*_read_user_prot_reg) (struct mtd_info *mtd, loff_t from, argument
261 int (*_write_user_prot_reg) (struct mtd_info *mtd, loff_t to, argument
263 int (*_lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, argument
266 int (*_writev) (struct mtd_info *mtd, const struct kvec *vecs, argument
269 void (*_sync) (struct mtd_info *mtd); argument
270 int (*_lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); argument
271 int (*_unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); argument
272 int (*_is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len); argument
273 int (*_block_isreserved) (struct mtd_info *mtd, loff_t ofs); argument
274 int (*_block_isbad) (struct mtd_info *mtd, loff_t ofs); argument
275 int (*_block_markbad) (struct mtd_info *mtd, loff_t ofs); argument
277 int (*_suspend) (struct mtd_info *mtd); argument
278 void (*_resume) (struct mtd_info *mtd); argument
279 void (*_reboot) (struct mtd_info *mtd); argument
285 int (*_get_device) (struct mtd_info *mtd); argument
286 void (*_put_device) (struct mtd_info *mtd); argument
313 int mtd_ooblayout_ecc(struct mtd_info *mtd, int section, argument
315 int mtd_ooblayout_find_eccregion(struct mtd_info *mtd, int eccbyte,
318 int mtd_ooblayout_get_eccbytes(struct mtd_info *mtd, u8 *eccbuf,
320 int mtd_ooblayout_set_eccbytes(struct mtd_info *mtd, const u8 *eccbuf,
322 int mtd_ooblayout_free(struct mtd_info *mtd, int section,
324 int mtd_ooblayout_get_databytes(struct mtd_info *mtd, u8 *databuf,
326 int mtd_ooblayout_set_databytes(struct mtd_info *mtd, const u8 *databuf,
328 int mtd_ooblayout_count_freebytes(struct mtd_info *mtd);
329 int mtd_ooblayout_count_eccbytes(struct mtd_info *mtd);
331 static inline void mtd_set_ooblayout(struct mtd_info *mtd, in mtd_set_ooblayout()
337 static inline int mtd_oobavail(struct mtd_info *mtd, struct mtd_oob_ops *ops) in mtd_oobavail()
342 int mtd_erase(struct mtd_info *mtd, struct erase_info *instr);
344 int mtd_point(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen,
346 int mtd_unpoint(struct mtd_info *mtd, loff_t from, size_t len);
348 unsigned long mtd_get_unmapped_area(struct mtd_info *mtd, unsigned long len,
350 int mtd_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen,
352 int mtd_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen,
354 int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen,
357 int mtd_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops);
359 static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to, in mtd_write_oob()
370 int mtd_get_fact_prot_info(struct mtd_info *mtd, size_t len, size_t *retlen,
372 int mtd_read_fact_prot_reg(struct mtd_info *mtd, loff_t from, size_t len,
374 int mtd_get_user_prot_info(struct mtd_info *mtd, size_t len, size_t *retlen,
376 int mtd_read_user_prot_reg(struct mtd_info *mtd, loff_t from, size_t len,
378 int mtd_write_user_prot_reg(struct mtd_info *mtd, loff_t to, size_t len,
380 int mtd_lock_user_prot_reg(struct mtd_info *mtd, loff_t from, size_t len);
383 int mtd_writev(struct mtd_info *mtd, const struct kvec *vecs,
387 static inline void mtd_sync(struct mtd_info *mtd) in mtd_sync()
393 int mtd_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
394 int mtd_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
395 int mtd_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len);
396 int mtd_block_isreserved(struct mtd_info *mtd, loff_t ofs);
397 int mtd_block_isbad(struct mtd_info *mtd, loff_t ofs);
398 int mtd_block_markbad(struct mtd_info *mtd, loff_t ofs);
401 static inline int mtd_suspend(struct mtd_info *mtd) in mtd_suspend()
406 static inline void mtd_resume(struct mtd_info *mtd) in mtd_resume()
413 static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd) in mtd_div_by_eb()
421 static inline uint32_t mtd_mod_by_eb(uint64_t sz, struct mtd_info *mtd) in mtd_mod_by_eb()
428 static inline uint32_t mtd_div_by_ws(uint64_t sz, struct mtd_info *mtd) in mtd_div_by_ws()
436 static inline uint32_t mtd_mod_by_ws(uint64_t sz, struct mtd_info *mtd) in mtd_mod_by_ws()
443 static inline int mtd_has_oob(const struct mtd_info *mtd) in mtd_has_oob()
448 static inline int mtd_type_is_nand(const struct mtd_info *mtd) in mtd_type_is_nand()
453 static inline int mtd_can_have_bb(const struct mtd_info *mtd) in mtd_can_have_bb()
463 extern int mtd_device_parse_register(struct mtd_info *mtd,
470 extern int mtd_device_unregister(struct mtd_info *master);
471 extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num);
472 extern int __get_mtd_device(struct mtd_info *mtd);
473 extern void __put_mtd_device(struct mtd_info *mtd);
474 extern struct mtd_info *get_mtd_device_nm(const char *name);
475 extern void put_mtd_device(struct mtd_info *mtd);
480 void (*add)(struct mtd_info *mtd);
481 void (*remove)(struct mtd_info *mtd);
489 void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size);
513 unsigned mtd_mmap_capabilities(struct mtd_info *mtd);
517 int add_mtd_device(struct mtd_info *mtd);
518 int del_mtd_device(struct mtd_info *mtd);
519 int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int);
520 int del_mtd_partitions(struct mtd_info *);
529 void mtd_get_len_incl_bad(struct mtd_info *mtd, uint64_t offset,