atmel-hlcdc.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright (C) 2014 Free Electrons
  3. * Copyright (C) 2014 Atmel
  4. *
  5. * Author: Boris BREZILLON <boris.brezillon@free-electrons.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License version 2 as published by
  9. * the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful, but WITHOUT
  12. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  14. * more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along with
  17. * this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef __LINUX_MFD_HLCDC_H
  20. #define __LINUX_MFD_HLCDC_H
  21. #include <linux/clk.h>
  22. #include <linux/regmap.h>
  23. #define ATMEL_HLCDC_CFG(i) ((i) * 0x4)
  24. #define ATMEL_HLCDC_SIG_CFG LCDCFG(5)
  25. #define ATMEL_HLCDC_HSPOL BIT(0)
  26. #define ATMEL_HLCDC_VSPOL BIT(1)
  27. #define ATMEL_HLCDC_VSPDLYS BIT(2)
  28. #define ATMEL_HLCDC_VSPDLYE BIT(3)
  29. #define ATMEL_HLCDC_DISPPOL BIT(4)
  30. #define ATMEL_HLCDC_DITHER BIT(6)
  31. #define ATMEL_HLCDC_DISPDLY BIT(7)
  32. #define ATMEL_HLCDC_MODE_MASK GENMASK(9, 8)
  33. #define ATMEL_HLCDC_PP BIT(10)
  34. #define ATMEL_HLCDC_VSPSU BIT(12)
  35. #define ATMEL_HLCDC_VSPHO BIT(13)
  36. #define ATMEL_HLCDC_GUARDTIME_MASK GENMASK(20, 16)
  37. #define ATMEL_HLCDC_EN 0x20
  38. #define ATMEL_HLCDC_DIS 0x24
  39. #define ATMEL_HLCDC_SR 0x28
  40. #define ATMEL_HLCDC_IER 0x2c
  41. #define ATMEL_HLCDC_IDR 0x30
  42. #define ATMEL_HLCDC_IMR 0x34
  43. #define ATMEL_HLCDC_ISR 0x38
  44. #define ATMEL_HLCDC_CLKPOL BIT(0)
  45. #define ATMEL_HLCDC_CLKSEL BIT(2)
  46. #define ATMEL_HLCDC_CLKPWMSEL BIT(3)
  47. #define ATMEL_HLCDC_CGDIS(i) BIT(8 + (i))
  48. #define ATMEL_HLCDC_CLKDIV_SHFT 16
  49. #define ATMEL_HLCDC_CLKDIV_MASK GENMASK(23, 16)
  50. #define ATMEL_HLCDC_CLKDIV(div) ((div - 2) << ATMEL_HLCDC_CLKDIV_SHFT)
  51. #define ATMEL_HLCDC_PIXEL_CLK BIT(0)
  52. #define ATMEL_HLCDC_SYNC BIT(1)
  53. #define ATMEL_HLCDC_DISP BIT(2)
  54. #define ATMEL_HLCDC_PWM BIT(3)
  55. #define ATMEL_HLCDC_SIP BIT(4)
  56. #define ATMEL_HLCDC_SOF BIT(0)
  57. #define ATMEL_HLCDC_SYNCDIS BIT(1)
  58. #define ATMEL_HLCDC_FIFOERR BIT(4)
  59. #define ATMEL_HLCDC_LAYER_STATUS(x) BIT((x) + 8)
  60. /**
  61. * Structure shared by the MFD device and its subdevices.
  62. *
  63. * @regmap: register map used to access HLCDC IP registers
  64. * @periph_clk: the hlcdc peripheral clock
  65. * @sys_clk: the hlcdc system clock
  66. * @slow_clk: the system slow clk
  67. * @irq: the hlcdc irq
  68. */
  69. struct atmel_hlcdc {
  70. struct regmap *regmap;
  71. struct clk *periph_clk;
  72. struct clk *sys_clk;
  73. struct clk *slow_clk;
  74. int irq;
  75. };
  76. #endif /* __LINUX_MFD_HLCDC_H */