pl111_drm.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. *
  3. * (C) COPYRIGHT 2012-2013 ARM Limited. All rights reserved.
  4. *
  5. *
  6. * Parts of this file were based on sources as follows:
  7. *
  8. * Copyright (c) 2006-2008 Intel Corporation
  9. * Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
  10. * Copyright (C) 2011 Texas Instruments
  11. *
  12. * This program is free software and is provided to you under the terms of the
  13. * GNU General Public License version 2 as published by the Free Software
  14. * Foundation, and any use by you of this program is subject to the terms of
  15. * such GNU licence.
  16. *
  17. */
  18. #ifndef _PL111_DRM_H_
  19. #define _PL111_DRM_H_
  20. #include <drm/drm_gem.h>
  21. #include <drm/drm_simple_kms_helper.h>
  22. #include <drm/drm_connector.h>
  23. #include <drm/drm_encoder.h>
  24. #include <drm/drm_panel.h>
  25. #include <drm/drm_bridge.h>
  26. #include <linux/clk-provider.h>
  27. #include <linux/interrupt.h>
  28. #define CLCD_IRQ_NEXTBASE_UPDATE BIT(2)
  29. struct drm_minor;
  30. /**
  31. * struct pl111_variant_data - encodes IP differences
  32. * @name: the name of this variant
  33. * @is_pl110: this is the early PL110 variant
  34. * @formats: array of supported pixel formats on this variant
  35. * @nformats: the length of the array of supported pixel formats
  36. */
  37. struct pl111_variant_data {
  38. const char *name;
  39. bool is_pl110;
  40. const u32 *formats;
  41. unsigned int nformats;
  42. };
  43. struct pl111_drm_dev_private {
  44. struct drm_device *drm;
  45. struct drm_connector *connector;
  46. struct drm_panel *panel;
  47. struct drm_bridge *bridge;
  48. struct drm_simple_display_pipe pipe;
  49. void *regs;
  50. u32 ienb;
  51. u32 ctrl;
  52. /* The pixel clock (a reference to our clock divider off of CLCDCLK). */
  53. struct clk *clk;
  54. /* pl111's internal clock divider. */
  55. struct clk_hw clk_div;
  56. /* Lock to sync access to CLCD_TIM2 between the common clock
  57. * subsystem and pl111_display_enable().
  58. */
  59. spinlock_t tim2_lock;
  60. const struct pl111_variant_data *variant;
  61. void (*variant_display_enable) (struct drm_device *drm, u32 format);
  62. void (*variant_display_disable) (struct drm_device *drm);
  63. };
  64. int pl111_display_init(struct drm_device *dev);
  65. int pl111_enable_vblank(struct drm_device *drm, unsigned int crtc);
  66. void pl111_disable_vblank(struct drm_device *drm, unsigned int crtc);
  67. irqreturn_t pl111_irq(int irq, void *data);
  68. int pl111_debugfs_init(struct drm_minor *minor);
  69. #endif /* _PL111_DRM_H_ */