pwm-lpss.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. /*
  24. * Some versions of the IP may stuck in the state machine if enable
  25. * bit is not set, and hence update bit will show busy status till
  26. * the reset. For the rest it may be otherwise.
  27. */
  28. bool bypass;
  29. /*
  30. * On some devices the _PS0/_PS3 AML code of the GPU (GFX0) device
  31. * messes with the PWM0 controllers state,
  32. */
  33. bool other_devices_aml_touches_pwm_regs;
  34. };
  35. extern const struct pwm_lpss_boardinfo pwm_lpss_byt_info;
  36. extern const struct pwm_lpss_boardinfo pwm_lpss_bsw_info;
  37. extern const struct pwm_lpss_boardinfo pwm_lpss_bxt_info;
  38. extern const struct pwm_lpss_boardinfo pwm_lpss_tng_info;
  39. struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, void __iomem *base,
  40. const struct pwm_lpss_boardinfo *info);
  41. #endif /* __PWM_LPSS_H */