lsxl.h 1.6 KB

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