xref: /linux/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.h (revision a23e1966932464e1c5226cb9ac4ce1d5fc10ba22)
159104f23SKuninori Morimoto /* SPDX-License-Identifier: GPL-2.0+ */
251c13278SLaurent Pinchart /*
351c13278SLaurent Pinchart  * shmob_drm.h  --  SH Mobile DRM driver
451c13278SLaurent Pinchart  *
59588b826SLaurent Pinchart  * Copyright (C) 2012 Renesas Electronics Corporation
651c13278SLaurent Pinchart  *
751c13278SLaurent Pinchart  * Laurent Pinchart (laurent.pinchart@ideasonboard.com)
851c13278SLaurent Pinchart  */
951c13278SLaurent Pinchart 
1051c13278SLaurent Pinchart #ifndef __SHMOB_DRM_DRV_H__
1151c13278SLaurent Pinchart #define __SHMOB_DRM_DRV_H__
1251c13278SLaurent Pinchart 
1351c13278SLaurent Pinchart #include <linux/kernel.h>
1451c13278SLaurent Pinchart #include <linux/platform_data/shmob_drm.h>
1551c13278SLaurent Pinchart #include <linux/spinlock.h>
1651c13278SLaurent Pinchart 
1751c13278SLaurent Pinchart #include "shmob_drm_crtc.h"
1851c13278SLaurent Pinchart 
1951c13278SLaurent Pinchart struct clk;
2051c13278SLaurent Pinchart struct device;
2151c13278SLaurent Pinchart struct drm_device;
2251c13278SLaurent Pinchart 
23*1399ebacSGeert Uytterhoeven struct shmob_drm_config {
24*1399ebacSGeert Uytterhoeven 	enum shmob_drm_clk_source clk_source;
25*1399ebacSGeert Uytterhoeven 	unsigned int clk_div;
26*1399ebacSGeert Uytterhoeven };
27*1399ebacSGeert Uytterhoeven 
2851c13278SLaurent Pinchart struct shmob_drm_device {
2951c13278SLaurent Pinchart 	struct device *dev;
3051c13278SLaurent Pinchart 	const struct shmob_drm_platform_data *pdata;
31*1399ebacSGeert Uytterhoeven 	struct shmob_drm_config config;
3251c13278SLaurent Pinchart 
3351c13278SLaurent Pinchart 	void __iomem *mmio;
3451c13278SLaurent Pinchart 	struct clk *clock;
3551c13278SLaurent Pinchart 	u32 lddckr;
3651c13278SLaurent Pinchart 
371522756cSThomas Zimmermann 	unsigned int irq;
3851c13278SLaurent Pinchart 	spinlock_t irq_lock;		/* Protects hardware LDINTR register */
3951c13278SLaurent Pinchart 
405417750dSGeert Uytterhoeven 	struct drm_device ddev;
4151c13278SLaurent Pinchart 
4251c13278SLaurent Pinchart 	struct shmob_drm_crtc crtc;
430da28d5fSLaurent Pinchart 	struct drm_encoder encoder;
44adceac2cSGeert Uytterhoeven 	struct drm_connector *connector;
4551c13278SLaurent Pinchart };
4651c13278SLaurent Pinchart 
to_shmob_device(struct drm_device * dev)47c2e938eeSGeert Uytterhoeven static inline struct shmob_drm_device *to_shmob_device(struct drm_device *dev)
48c2e938eeSGeert Uytterhoeven {
49c2e938eeSGeert Uytterhoeven 	return container_of(dev, struct shmob_drm_device, ddev);
50c2e938eeSGeert Uytterhoeven }
51c2e938eeSGeert Uytterhoeven 
5251c13278SLaurent Pinchart #endif /* __SHMOB_DRM_DRV_H__ */
53