pl111_drm.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 <linux/clk-provider.h>
  23. #define CLCD_IRQ_NEXTBASE_UPDATE BIT(2)
  24. struct drm_minor;
  25. struct pl111_drm_connector {
  26. struct drm_connector connector;
  27. struct drm_panel *panel;
  28. };
  29. struct pl111_drm_dev_private {
  30. struct drm_device *drm;
  31. struct pl111_drm_connector connector;
  32. struct drm_simple_display_pipe pipe;
  33. struct drm_fbdev_cma *fbdev;
  34. void *regs;
  35. /* The pixel clock (a reference to our clock divider off of CLCDCLK). */
  36. struct clk *clk;
  37. /* pl111's internal clock divider. */
  38. struct clk_hw clk_div;
  39. /* Lock to sync access to CLCD_TIM2 between the common clock
  40. * subsystem and pl111_display_enable().
  41. */
  42. spinlock_t tim2_lock;
  43. };
  44. #define to_pl111_connector(x) \
  45. container_of(x, struct pl111_drm_connector, connector)
  46. int pl111_display_init(struct drm_device *dev);
  47. int pl111_enable_vblank(struct drm_device *drm, unsigned int crtc);
  48. void pl111_disable_vblank(struct drm_device *drm, unsigned int crtc);
  49. irqreturn_t pl111_irq(int irq, void *data);
  50. int pl111_connector_init(struct drm_device *dev);
  51. int pl111_encoder_init(struct drm_device *dev);
  52. int pl111_dumb_create(struct drm_file *file_priv,
  53. struct drm_device *dev,
  54. struct drm_mode_create_dumb *args);
  55. int pl111_debugfs_init(struct drm_minor *minor);
  56. #endif /* _PL111_DRM_H_ */