lsxl.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (c) 2012 Michael Walle
  4. * Michael Walle <michael@walle.cc>
  5. */
  6. #ifndef __LSXL_H
  7. #define __LSXL_H
  8. #define GPIO_HDD_POWER 10
  9. #define GPIO_USB_VBUS 11
  10. #define GPIO_FAN_HIGH 18
  11. #define GPIO_FAN_LOW 19
  12. #define GPIO_FUNC_LED 36
  13. #define GPIO_ALARM_LED 37
  14. #define GPIO_INFO_LED 38
  15. #define GPIO_POWER_LED 39
  16. #define GPIO_FAN_LOCK 40
  17. #define GPIO_FUNC_BUTTON 41
  18. #define GPIO_POWER_SWITCH 42
  19. #define GPIO_POWER_AUTO_SWITCH 43
  20. #define GPIO_FUNC_RED_LED 48
  21. #define _BIT(x) (1<<(x))
  22. #define LSXL_OE_LOW (~(_BIT(GPIO_HDD_POWER) \
  23. | _BIT(GPIO_USB_VBUS) \
  24. | _BIT(GPIO_FAN_HIGH) \
  25. | _BIT(GPIO_FAN_LOW)))
  26. #define LSXL_OE_HIGH (~(_BIT(GPIO_FUNC_LED - 32) \
  27. | _BIT(GPIO_ALARM_LED - 32) \
  28. | _BIT(GPIO_INFO_LED - 32) \
  29. | _BIT(GPIO_POWER_LED - 32) \
  30. | _BIT(GPIO_FUNC_RED_LED - 32)))
  31. #define LSXL_OE_VAL_LOW (_BIT(GPIO_HDD_POWER) \
  32. | _BIT(GPIO_USB_VBUS))
  33. #define LSXL_OE_VAL_HIGH (_BIT(GPIO_FUNC_LED - 32) \
  34. | _BIT(GPIO_ALARM_LED - 32) \
  35. | _BIT(GPIO_INFO_LED - 32) \
  36. | _BIT(GPIO_POWER_LED - 32) \
  37. | _BIT(GPIO_FUNC_RED_LED - 32))
  38. #define LSXL_POL_VAL_LOW (_BIT(GPIO_FAN_HIGH) \
  39. | _BIT(GPIO_FAN_LOW))
  40. #define LSXL_POL_VAL_HIGH (_BIT(GPIO_FUNC_LED - 32) \
  41. | _BIT(GPIO_ALARM_LED - 32) \
  42. | _BIT(GPIO_INFO_LED - 32) \
  43. | _BIT(GPIO_POWER_LED - 32) \
  44. | _BIT(GPIO_FUNC_BUTTON - 32) \
  45. | _BIT(GPIO_POWER_SWITCH - 32) \
  46. | _BIT(GPIO_POWER_AUTO_SWITCH - 32) \
  47. | _BIT(GPIO_FUNC_RED_LED - 32))
  48. #endif /* __LSXL_H */