pwm-lpss.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Intel Low Power Subsystem PWM controller driver
  3. *
  4. * Copyright (C) 2014, Intel Corporation
  5. *
  6. * Derived from the original pwm-lpss.c
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #ifndef __PWM_LPSS_H
  13. #define __PWM_LPSS_H
  14. #include <linux/device.h>
  15. #include <linux/pwm.h>
  16. #define MAX_PWMS 4
  17. struct pwm_lpss_chip {
  18. struct pwm_chip chip;
  19. void __iomem *regs;
  20. const struct pwm_lpss_boardinfo *info;
  21. u32 saved_ctrl[MAX_PWMS];
  22. };
  23. struct pwm_lpss_boardinfo {
  24. unsigned long clk_rate;
  25. unsigned int npwm;
  26. unsigned long base_unit_bits;
  27. bool bypass;
  28. /*
  29. * On some devices the _PS0/_PS3 AML code of the GPU (GFX0) device
  30. * messes with the PWM0 controllers state,
  31. */
  32. bool other_devices_aml_touches_pwm_regs;
  33. };
  34. struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, struct resource *r,
  35. const struct pwm_lpss_boardinfo *info);
  36. int pwm_lpss_remove(struct pwm_lpss_chip *lpwm);
  37. int pwm_lpss_suspend(struct device *dev);
  38. int pwm_lpss_resume(struct device *dev);
  39. #endif /* __PWM_LPSS_H */