atmel-hlcdc.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2014 Free Electrons
  4. * Copyright (C) 2014 Atmel
  5. *
  6. * Author: Boris BREZILLON <[email protected]>
  7. */
  8. #ifndef __LINUX_MFD_HLCDC_H
  9. #define __LINUX_MFD_HLCDC_H
  10. #include <linux/clk.h>
  11. #include <linux/regmap.h>
  12. #define ATMEL_HLCDC_CFG(i) ((i) * 0x4)
  13. #define ATMEL_HLCDC_SIG_CFG LCDCFG(5)
  14. #define ATMEL_HLCDC_HSPOL BIT(0)
  15. #define ATMEL_HLCDC_VSPOL BIT(1)
  16. #define ATMEL_HLCDC_VSPDLYS BIT(2)
  17. #define ATMEL_HLCDC_VSPDLYE BIT(3)
  18. #define ATMEL_HLCDC_DISPPOL BIT(4)
  19. #define ATMEL_HLCDC_DITHER BIT(6)
  20. #define ATMEL_HLCDC_DISPDLY BIT(7)
  21. #define ATMEL_HLCDC_MODE_MASK GENMASK(9, 8)
  22. #define ATMEL_HLCDC_PP BIT(10)
  23. #define ATMEL_HLCDC_VSPSU BIT(12)
  24. #define ATMEL_HLCDC_VSPHO BIT(13)
  25. #define ATMEL_HLCDC_GUARDTIME_MASK GENMASK(20, 16)
  26. #define ATMEL_HLCDC_EN 0x20
  27. #define ATMEL_HLCDC_DIS 0x24
  28. #define ATMEL_HLCDC_SR 0x28
  29. #define ATMEL_HLCDC_IER 0x2c
  30. #define ATMEL_HLCDC_IDR 0x30
  31. #define ATMEL_HLCDC_IMR 0x34
  32. #define ATMEL_HLCDC_ISR 0x38
  33. #define ATMEL_HLCDC_CLKPOL BIT(0)
  34. #define ATMEL_HLCDC_CLKSEL BIT(2)
  35. #define ATMEL_HLCDC_CLKPWMSEL BIT(3)
  36. #define ATMEL_HLCDC_CGDIS(i) BIT(8 + (i))
  37. #define ATMEL_HLCDC_CLKDIV_SHFT 16
  38. #define ATMEL_HLCDC_CLKDIV_MASK GENMASK(23, 16)
  39. #define ATMEL_HLCDC_CLKDIV(div) ((div - 2) << ATMEL_HLCDC_CLKDIV_SHFT)
  40. #define ATMEL_HLCDC_PIXEL_CLK BIT(0)
  41. #define ATMEL_HLCDC_SYNC BIT(1)
  42. #define ATMEL_HLCDC_DISP BIT(2)
  43. #define ATMEL_HLCDC_PWM BIT(3)
  44. #define ATMEL_HLCDC_SIP BIT(4)
  45. #define ATMEL_HLCDC_SOF BIT(0)
  46. #define ATMEL_HLCDC_SYNCDIS BIT(1)
  47. #define ATMEL_HLCDC_FIFOERR BIT(4)
  48. #define ATMEL_HLCDC_LAYER_STATUS(x) BIT((x) + 8)
  49. /**
  50. * Structure shared by the MFD device and its subdevices.
  51. *
  52. * @regmap: register map used to access HLCDC IP registers
  53. * @periph_clk: the hlcdc peripheral clock
  54. * @sys_clk: the hlcdc system clock
  55. * @slow_clk: the system slow clk
  56. * @irq: the hlcdc irq
  57. */
  58. struct atmel_hlcdc {
  59. struct regmap *regmap;
  60. struct clk *periph_clk;
  61. struct clk *sys_clk;
  62. struct clk *slow_clk;
  63. int irq;
  64. };
  65. #endif /* __LINUX_MFD_HLCDC_H */