pwm-lpss.h 903 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Intel Low Power Subsystem PWM controller driver
  4. *
  5. * Copyright (C) 2014, Intel Corporation
  6. *
  7. * Derived from the original pwm-lpss.c
  8. */
  9. #ifndef __PWM_LPSS_H
  10. #define __PWM_LPSS_H
  11. #include <linux/device.h>
  12. #include <linux/pwm.h>
  13. #define MAX_PWMS 4
  14. struct pwm_lpss_chip {
  15. struct pwm_chip chip;
  16. void __iomem *regs;
  17. const struct pwm_lpss_boardinfo *info;
  18. };
  19. struct pwm_lpss_boardinfo {
  20. unsigned long clk_rate;
  21. unsigned int npwm;
  22. unsigned long base_unit_bits;
  23. bool bypass;
  24. /*
  25. * On some devices the _PS0/_PS3 AML code of the GPU (GFX0) device
  26. * messes with the PWM0 controllers state,
  27. */
  28. bool other_devices_aml_touches_pwm_regs;
  29. };
  30. struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, struct resource *r,
  31. const struct pwm_lpss_boardinfo *info);
  32. int pwm_lpss_remove(struct pwm_lpss_chip *lpwm);
  33. #endif /* __PWM_LPSS_H */