linux-stable/drivers/gpu/drm/arm/hdlcd_drv.h
Thomas Zimmermann 71eba7bd26 drm/arm/hdlcd: Convert to Linux IRQ interfaces
Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's
IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers
don't benefit from using it.

DRM IRQ callbacks are now being called directly or inlined.

Calls to platform_get_irq() can fail with a negative errno code.
Abort initialization in this case. The DRM IRQ midlayer does not
handle this case correctly.

v2:
	* name struct drm_device variables 'drm' (Sam)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210803090704.32152-3-tzimmermann@suse.de
2021-08-10 20:00:51 +02:00

39 lines
900 B
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* ARM HDLCD Controller register definition
*/
#ifndef __HDLCD_DRV_H__
#define __HDLCD_DRV_H__
struct hdlcd_drm_private {
void __iomem *mmio;
struct clk *clk;
struct drm_crtc crtc;
struct drm_plane *plane;
unsigned int irq;
#ifdef CONFIG_DEBUG_FS
atomic_t buffer_underrun_count;
atomic_t bus_error_count;
atomic_t vsync_count;
atomic_t dma_end_count;
#endif
};
#define crtc_to_hdlcd_priv(x) container_of(x, struct hdlcd_drm_private, crtc)
static inline void hdlcd_write(struct hdlcd_drm_private *hdlcd,
unsigned int reg, u32 value)
{
writel(value, hdlcd->mmio + reg);
}
static inline u32 hdlcd_read(struct hdlcd_drm_private *hdlcd, unsigned int reg)
{
return readl(hdlcd->mmio + reg);
}
int hdlcd_setup_crtc(struct drm_device *dev);
void hdlcd_set_scanout(struct hdlcd_drm_private *hdlcd);
#endif /* __HDLCD_DRV_H__ */