Lines Matching defs:mtd_info

23 struct mtd_info;
107 int (*ecc)(struct mtd_info *mtd, int section,
109 int (*free)(struct mtd_info *mtd, int section,
183 int (*get_info)(struct mtd_info *mtd, int wunit,
185 int (*get_wunit)(struct mtd_info *mtd,
189 struct module; /* only needed for owner field in mtd_info */
210 * This struct is embedded in mtd_info and contains partition-specific
228 * This struct is embedded in mtd_info and contains master-specific
238 struct mtd_info {
252 * Any driver registering a struct mtd_info must ensure a writesize of
316 int (*_erase) (struct mtd_info *mtd, struct erase_info *instr);
317 int (*_point) (struct mtd_info *mtd, loff_t from, size_t len,
319 int (*_unpoint) (struct mtd_info *mtd, loff_t from, size_t len);
320 int (*_read) (struct mtd_info *mtd, loff_t from, size_t len,
322 int (*_write) (struct mtd_info *mtd, loff_t to, size_t len,
324 int (*_panic_write) (struct mtd_info *mtd, loff_t to, size_t len,
326 int (*_read_oob) (struct mtd_info *mtd, loff_t from,
328 int (*_write_oob) (struct mtd_info *mtd, loff_t to,
330 int (*_get_fact_prot_info) (struct mtd_info *mtd, size_t len,
332 int (*_read_fact_prot_reg) (struct mtd_info *mtd, loff_t from,
334 int (*_get_user_prot_info) (struct mtd_info *mtd, size_t len,
336 int (*_read_user_prot_reg) (struct mtd_info *mtd, loff_t from,
338 int (*_write_user_prot_reg) (struct mtd_info *mtd, loff_t to,
341 int (*_lock_user_prot_reg) (struct mtd_info *mtd, loff_t from,
343 int (*_erase_user_prot_reg) (struct mtd_info *mtd, loff_t from,
345 int (*_writev) (struct mtd_info *mtd, const struct kvec *vecs,
347 void (*_sync) (struct mtd_info *mtd);
348 int (*_lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
349 int (*_unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
350 int (*_is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
351 int (*_block_isreserved) (struct mtd_info *mtd, loff_t ofs);
352 int (*_block_isbad) (struct mtd_info *mtd, loff_t ofs);
353 int (*_block_markbad) (struct mtd_info *mtd, loff_t ofs);
354 int (*_max_bad_blocks) (struct mtd_info *mtd, loff_t ofs, size_t len);
355 int (*_suspend) (struct mtd_info *mtd);
356 void (*_resume) (struct mtd_info *mtd);
357 void (*_reboot) (struct mtd_info *mtd);
362 int (*_get_device) (struct mtd_info *mtd);
363 void (*_put_device) (struct mtd_info *mtd);
394 struct mtd_info *parent;
403 static inline struct mtd_info *mtd_get_master(struct mtd_info *mtd)
411 static inline u64 mtd_get_master_ofs(struct mtd_info *mtd, u64 ofs)
421 static inline bool mtd_is_partition(const struct mtd_info *mtd)
426 static inline bool mtd_has_partitions(const struct mtd_info *mtd)
431 int mtd_ooblayout_ecc(struct mtd_info *mtd, int section,
433 int mtd_ooblayout_find_eccregion(struct mtd_info *mtd, int eccbyte,
436 int mtd_ooblayout_get_eccbytes(struct mtd_info *mtd, u8 *eccbuf,
438 int mtd_ooblayout_set_eccbytes(struct mtd_info *mtd, const u8 *eccbuf,
440 int mtd_ooblayout_free(struct mtd_info *mtd, int section,
442 int mtd_ooblayout_get_databytes(struct mtd_info *mtd, u8 *databuf,
444 int mtd_ooblayout_set_databytes(struct mtd_info *mtd, const u8 *databuf,
446 int mtd_ooblayout_count_freebytes(struct mtd_info *mtd);
447 int mtd_ooblayout_count_eccbytes(struct mtd_info *mtd);
449 static inline void mtd_set_ooblayout(struct mtd_info *mtd,
455 static inline void mtd_set_pairing_scheme(struct mtd_info *mtd,
461 static inline void mtd_set_of_node(struct mtd_info *mtd,
469 static inline struct device_node *mtd_get_of_node(struct mtd_info *mtd)
474 static inline u32 mtd_oobavail(struct mtd_info *mtd, struct mtd_oob_ops *ops)
479 static inline int mtd_max_bad_blocks(struct mtd_info *mtd,
482 struct mtd_info *master = mtd_get_master(mtd);
494 int mtd_wunit_to_pairing_info(struct mtd_info *mtd, int wunit,
496 int mtd_pairing_info_to_wunit(struct mtd_info *mtd,
498 int mtd_pairing_groups(struct mtd_info *mtd);
499 int mtd_erase(struct mtd_info *mtd, struct erase_info *instr);
500 int mtd_point(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen,
502 int mtd_unpoint(struct mtd_info *mtd, loff_t from, size_t len);
503 unsigned long mtd_get_unmapped_area(struct mtd_info *mtd, unsigned long len,
505 int mtd_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen,
507 int mtd_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen,
509 int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen,
512 int mtd_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops);
513 int mtd_write_oob(struct mtd_info *mtd, loff_t to, struct mtd_oob_ops *ops);
515 int mtd_get_fact_prot_info(struct mtd_info *mtd, size_t len, size_t *retlen,
517 int mtd_read_fact_prot_reg(struct mtd_info *mtd, loff_t from, size_t len,
519 int mtd_get_user_prot_info(struct mtd_info *mtd, size_t len, size_t *retlen,
521 int mtd_read_user_prot_reg(struct mtd_info *mtd, loff_t from, size_t len,
523 int mtd_write_user_prot_reg(struct mtd_info *mtd, loff_t to, size_t len,
525 int mtd_lock_user_prot_reg(struct mtd_info *mtd, loff_t from, size_t len);
526 int mtd_erase_user_prot_reg(struct mtd_info *mtd, loff_t from, size_t len);
528 int mtd_writev(struct mtd_info *mtd, const struct kvec *vecs,
531 static inline void mtd_sync(struct mtd_info *mtd)
533 struct mtd_info *master = mtd_get_master(mtd);
539 int mtd_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
540 int mtd_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
541 int mtd_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len);
542 int mtd_block_isreserved(struct mtd_info *mtd, loff_t ofs);
543 int mtd_block_isbad(struct mtd_info *mtd, loff_t ofs);
544 int mtd_block_markbad(struct mtd_info *mtd, loff_t ofs);
546 static inline int mtd_suspend(struct mtd_info *mtd)
548 struct mtd_info *master = mtd_get_master(mtd);
562 static inline void mtd_resume(struct mtd_info *mtd)
564 struct mtd_info *master = mtd_get_master(mtd);
575 static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd)
583 static inline uint32_t mtd_mod_by_eb(uint64_t sz, struct mtd_info *mtd)
599 static inline void mtd_align_erase_req(struct mtd_info *mtd,
618 static inline uint32_t mtd_div_by_ws(uint64_t sz, struct mtd_info *mtd)
626 static inline uint32_t mtd_mod_by_ws(uint64_t sz, struct mtd_info *mtd)
633 static inline int mtd_wunit_per_eb(struct mtd_info *mtd)
635 struct mtd_info *master = mtd_get_master(mtd);
640 static inline int mtd_offset_to_wunit(struct mtd_info *mtd, loff_t offs)
645 static inline loff_t mtd_wunit_to_offset(struct mtd_info *mtd, loff_t base,
652 static inline int mtd_has_oob(const struct mtd_info *mtd)
654 struct mtd_info *master = mtd_get_master((struct mtd_info *)mtd);
659 static inline int mtd_type_is_nand(const struct mtd_info *mtd)
664 static inline int mtd_can_have_bb(const struct mtd_info *mtd)
666 struct mtd_info *master = mtd_get_master((struct mtd_info *)mtd);
676 extern int mtd_device_parse_register(struct mtd_info *mtd,
683 extern int mtd_device_unregister(struct mtd_info *master);
684 extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num);
685 extern int __get_mtd_device(struct mtd_info *mtd);
686 extern void __put_mtd_device(struct mtd_info *mtd);
687 extern struct mtd_info *of_get_mtd_device_by_node(struct device_node *np);
688 extern struct mtd_info *get_mtd_device_nm(const char *name);
689 extern void put_mtd_device(struct mtd_info *mtd);
693 void (*add)(struct mtd_info *mtd);
694 void (*remove)(struct mtd_info *mtd);
701 void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size);
715 unsigned mtd_mmap_capabilities(struct mtd_info *mtd);