503-MIPS-ath79-add-flash-acquire-release.patch 996 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --- a/arch/mips/ath79/common.c
  2. +++ b/arch/mips/ath79/common.c
  3. @@ -22,6 +22,7 @@
  4. #include "common.h"
  5. static DEFINE_SPINLOCK(ath79_device_reset_lock);
  6. +static DEFINE_MUTEX(ath79_flash_mutex);
  7. u32 ath79_cpu_freq;
  8. EXPORT_SYMBOL_GPL(ath79_cpu_freq);
  9. @@ -111,3 +112,16 @@ void ath79_device_reset_clear(u32 mask)
  10. spin_unlock_irqrestore(&ath79_device_reset_lock, flags);
  11. }
  12. EXPORT_SYMBOL_GPL(ath79_device_reset_clear);
  13. +
  14. +void ath79_flash_acquire(void)
  15. +{
  16. + mutex_lock(&ath79_flash_mutex);
  17. +}
  18. +EXPORT_SYMBOL_GPL(ath79_flash_acquire);
  19. +
  20. +void ath79_flash_release(void)
  21. +{
  22. + mutex_unlock(&ath79_flash_mutex);
  23. +}
  24. +EXPORT_SYMBOL_GPL(ath79_flash_release);
  25. +
  26. --- a/arch/mips/include/asm/mach-ath79/ath79.h
  27. +++ b/arch/mips/include/asm/mach-ath79/ath79.h
  28. @@ -144,4 +144,7 @@ static inline u32 ath79_reset_rr(unsigne
  29. void ath79_device_reset_set(u32 mask);
  30. void ath79_device_reset_clear(u32 mask);
  31. +void ath79_flash_acquire(void);
  32. +void ath79_flash_release(void);
  33. +
  34. #endif /* __ASM_MACH_ATH79_H */