]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - drivers/gpu/drm/pl111/pl111_drm.h
4162c6aa5dbb100e7fe3d5a666758af845d1ea70
[karo-tx-linux.git] / drivers / gpu / drm / pl111 / pl111_drm.h
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
19 #ifndef _PL111_DRM_H_
20 #define _PL111_DRM_H_
21
22 #include <drm/drm_gem.h>
23 #include <drm/drm_simple_kms_helper.h>
24 #include <linux/clk-provider.h>
25
26 #define CLCD_IRQ_NEXTBASE_UPDATE BIT(2)
27
28 struct pl111_drm_connector {
29         struct drm_connector connector;
30         struct drm_panel *panel;
31 };
32
33 struct pl111_drm_dev_private {
34         struct drm_device *drm;
35
36         struct pl111_drm_connector connector;
37         struct drm_simple_display_pipe pipe;
38         struct drm_fbdev_cma *fbdev;
39
40         void *regs;
41         /* The pixel clock (a reference to our clock divider off of CLCDCLK). */
42         struct clk *clk;
43         /* pl111's internal clock divider. */
44         struct clk_hw clk_div;
45         /* Lock to sync access to CLCD_TIM2 between the common clock
46          * subsystem and pl111_display_enable().
47          */
48         spinlock_t tim2_lock;
49 };
50
51 #define to_pl111_connector(x) \
52         container_of(x, struct pl111_drm_connector, connector)
53
54 int pl111_display_init(struct drm_device *dev);
55 int pl111_enable_vblank(struct drm_device *drm, unsigned int crtc);
56 void pl111_disable_vblank(struct drm_device *drm, unsigned int crtc);
57 irqreturn_t pl111_irq(int irq, void *data);
58 int pl111_connector_init(struct drm_device *dev);
59 int pl111_encoder_init(struct drm_device *dev);
60 int pl111_dumb_create(struct drm_file *file_priv,
61                       struct drm_device *dev,
62                       struct drm_mode_create_dumb *args);
63
64 #endif /* _PL111_DRM_H_ */