pm-rmobile.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (C) 2012 Renesas Solutions Corp.
  3. *
  4. * Kuninori Morimoto <morimoto.kuninori@renesas.com>
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. #ifndef PM_RMOBILE_H
  11. #define PM_RMOBILE_H
  12. #include <linux/pm_domain.h>
  13. #define DEFAULT_DEV_LATENCY_NS 250000
  14. struct platform_device;
  15. struct rmobile_pm_domain {
  16. struct generic_pm_domain genpd;
  17. struct dev_power_governor *gov;
  18. int (*suspend)(void);
  19. void (*resume)(void);
  20. void __iomem *base;
  21. unsigned int bit_shift;
  22. bool no_debug;
  23. };
  24. static inline
  25. struct rmobile_pm_domain *to_rmobile_pd(struct generic_pm_domain *d)
  26. {
  27. return container_of(d, struct rmobile_pm_domain, genpd);
  28. }
  29. struct pm_domain_device {
  30. const char *domain_name;
  31. struct platform_device *pdev;
  32. };
  33. #if defined(CONFIG_PM_RMOBILE) && defined(CONFIG_ARCH_SHMOBILE_LEGACY)
  34. extern void rmobile_init_domains(struct rmobile_pm_domain domains[], int num);
  35. extern void rmobile_add_device_to_domain_td(const char *domain_name,
  36. struct platform_device *pdev,
  37. struct gpd_timing_data *td);
  38. static inline void rmobile_add_device_to_domain(const char *domain_name,
  39. struct platform_device *pdev)
  40. {
  41. rmobile_add_device_to_domain_td(domain_name, pdev, NULL);
  42. }
  43. extern void rmobile_add_devices_to_domains(struct pm_domain_device data[],
  44. int size);
  45. #else
  46. #define rmobile_init_domains(domains, num) do { } while (0)
  47. #define rmobile_add_device_to_domain_td(name, pdev, td) do { } while (0)
  48. #define rmobile_add_device_to_domain(name, pdev) do { } while (0)
  49. static inline void rmobile_add_devices_to_domains(struct pm_domain_device d[],
  50. int size) {}
  51. #endif /* CONFIG_PM_RMOBILE */
  52. #endif /* PM_RMOBILE_H */