of_mtd.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
  3. *
  4. * OF helpers for mtd.
  5. *
  6. * This file is released under the GPLv2
  7. */
  8. #ifndef __LINUX_OF_MTD_H
  9. #define __LINUX_OF_MTD_H
  10. #ifdef CONFIG_OF_MTD
  11. #include <linux/of.h>
  12. int of_get_nand_ecc_mode(struct device_node *np);
  13. int of_get_nand_ecc_algo(struct device_node *np);
  14. int of_get_nand_ecc_step_size(struct device_node *np);
  15. int of_get_nand_ecc_strength(struct device_node *np);
  16. int of_get_nand_bus_width(struct device_node *np);
  17. bool of_get_nand_on_flash_bbt(struct device_node *np);
  18. #else /* CONFIG_OF_MTD */
  19. static inline int of_get_nand_ecc_mode(struct device_node *np)
  20. {
  21. return -ENOSYS;
  22. }
  23. static inline int of_get_nand_ecc_algo(struct device_node *np)
  24. {
  25. return -ENOSYS;
  26. }
  27. static inline int of_get_nand_ecc_step_size(struct device_node *np)
  28. {
  29. return -ENOSYS;
  30. }
  31. static inline int of_get_nand_ecc_strength(struct device_node *np)
  32. {
  33. return -ENOSYS;
  34. }
  35. static inline int of_get_nand_bus_width(struct device_node *np)
  36. {
  37. return -ENOSYS;
  38. }
  39. static inline bool of_get_nand_on_flash_bbt(struct device_node *np)
  40. {
  41. return false;
  42. }
  43. #endif /* CONFIG_OF_MTD */
  44. #endif /* __LINUX_OF_MTD_H */