of_mtd.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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_step_size(struct device_node *np);
  14. int of_get_nand_ecc_strength(struct device_node *np);
  15. int of_get_nand_bus_width(struct device_node *np);
  16. bool of_get_nand_on_flash_bbt(struct device_node *np);
  17. #else /* CONFIG_OF_MTD */
  18. static inline int of_get_nand_ecc_mode(struct device_node *np)
  19. {
  20. return -ENOSYS;
  21. }
  22. static inline int of_get_nand_ecc_step_size(struct device_node *np)
  23. {
  24. return -ENOSYS;
  25. }
  26. static inline int of_get_nand_ecc_strength(struct device_node *np)
  27. {
  28. return -ENOSYS;
  29. }
  30. static inline int of_get_nand_bus_width(struct device_node *np)
  31. {
  32. return -ENOSYS;
  33. }
  34. static inline bool of_get_nand_on_flash_bbt(struct device_node *np)
  35. {
  36. return false;
  37. }
  38. #endif /* CONFIG_OF_MTD */
  39. #endif /* __LINUX_OF_MTD_H */