gpio.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * include/linux/mfd/wm831x/gpio.h -- GPIO for WM831x
  3. *
  4. * Copyright 2009 Wolfson Microelectronics PLC.
  5. *
  6. * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version.
  12. *
  13. */
  14. #ifndef __MFD_WM831X_GPIO_H__
  15. #define __MFD_WM831X_GPIO_H__
  16. /*
  17. * R16440-16455 (0x4038-0x4047) - GPIOx Control
  18. */
  19. #define WM831X_GPN_DIR 0x8000 /* GPN_DIR */
  20. #define WM831X_GPN_DIR_MASK 0x8000 /* GPN_DIR */
  21. #define WM831X_GPN_DIR_SHIFT 15 /* GPN_DIR */
  22. #define WM831X_GPN_DIR_WIDTH 1 /* GPN_DIR */
  23. #define WM831X_GPN_PULL_MASK 0x6000 /* GPN_PULL - [14:13] */
  24. #define WM831X_GPN_PULL_SHIFT 13 /* GPN_PULL - [14:13] */
  25. #define WM831X_GPN_PULL_WIDTH 2 /* GPN_PULL - [14:13] */
  26. #define WM831X_GPN_INT_MODE 0x1000 /* GPN_INT_MODE */
  27. #define WM831X_GPN_INT_MODE_MASK 0x1000 /* GPN_INT_MODE */
  28. #define WM831X_GPN_INT_MODE_SHIFT 12 /* GPN_INT_MODE */
  29. #define WM831X_GPN_INT_MODE_WIDTH 1 /* GPN_INT_MODE */
  30. #define WM831X_GPN_PWR_DOM 0x0800 /* GPN_PWR_DOM */
  31. #define WM831X_GPN_PWR_DOM_MASK 0x0800 /* GPN_PWR_DOM */
  32. #define WM831X_GPN_PWR_DOM_SHIFT 11 /* GPN_PWR_DOM */
  33. #define WM831X_GPN_PWR_DOM_WIDTH 1 /* GPN_PWR_DOM */
  34. #define WM831X_GPN_POL 0x0400 /* GPN_POL */
  35. #define WM831X_GPN_POL_MASK 0x0400 /* GPN_POL */
  36. #define WM831X_GPN_POL_SHIFT 10 /* GPN_POL */
  37. #define WM831X_GPN_POL_WIDTH 1 /* GPN_POL */
  38. #define WM831X_GPN_OD 0x0200 /* GPN_OD */
  39. #define WM831X_GPN_OD_MASK 0x0200 /* GPN_OD */
  40. #define WM831X_GPN_OD_SHIFT 9 /* GPN_OD */
  41. #define WM831X_GPN_OD_WIDTH 1 /* GPN_OD */
  42. #define WM831X_GPN_ENA 0x0080 /* GPN_ENA */
  43. #define WM831X_GPN_ENA_MASK 0x0080 /* GPN_ENA */
  44. #define WM831X_GPN_ENA_SHIFT 7 /* GPN_ENA */
  45. #define WM831X_GPN_ENA_WIDTH 1 /* GPN_ENA */
  46. #define WM831X_GPN_TRI 0x0080 /* GPN_TRI */
  47. #define WM831X_GPN_TRI_MASK 0x0080 /* GPN_TRI */
  48. #define WM831X_GPN_TRI_SHIFT 7 /* GPN_TRI */
  49. #define WM831X_GPN_TRI_WIDTH 1 /* GPN_TRI */
  50. #define WM831X_GPN_FN_MASK 0x000F /* GPN_FN - [3:0] */
  51. #define WM831X_GPN_FN_SHIFT 0 /* GPN_FN - [3:0] */
  52. #define WM831X_GPN_FN_WIDTH 4 /* GPN_FN - [3:0] */
  53. #define WM831X_GPIO_PULL_NONE (0 << WM831X_GPN_PULL_SHIFT)
  54. #define WM831X_GPIO_PULL_DOWN (1 << WM831X_GPN_PULL_SHIFT)
  55. #define WM831X_GPIO_PULL_UP (2 << WM831X_GPN_PULL_SHIFT)
  56. #endif