linux/drivers/gpu/drm/tve200/tve200_drm.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (C) 2017 Linus Walleij <[email protected]>
 * Parts of this file were based on sources as follows:
 *
 * Copyright (C) 2006-2008 Intel Corporation
 * Copyright (C) 2007 Amos Lee <[email protected]>
 * Copyright (C) 2007 Dave Airlie <[email protected]>
 * Copyright (C) 2011 Texas Instruments
 * Copyright (C) 2017 Eric Anholt
 */

#ifndef _TVE200_DRM_H_
#define _TVE200_DRM_H_

#include <linux/irqreturn.h>

#include <drm/drm_simple_kms_helper.h>

struct clk;
struct drm_bridge;
struct drm_connector;
struct drm_device;
struct drm_file;
struct drm_mode_create_dumb;
struct drm_panel;

/* Bits 2-31 are valid physical base addresses */
#define TVE200_Y_FRAME_BASE_ADDR
#define TVE200_U_FRAME_BASE_ADDR
#define TVE200_V_FRAME_BASE_ADDR

#define TVE200_INT_EN
#define TVE200_INT_CLR
#define TVE200_INT_STAT
#define TVE200_INT_BUS_ERR
#define TVE200_INT_V_STATUS
#define TVE200_INT_V_NEXT_FRAME
#define TVE200_INT_U_NEXT_FRAME
#define TVE200_INT_Y_NEXT_FRAME
#define TVE200_INT_V_FIFO_UNDERRUN
#define TVE200_INT_U_FIFO_UNDERRUN
#define TVE200_INT_Y_FIFO_UNDERRUN
#define TVE200_FIFO_UNDERRUNS

#define TVE200_CTRL
#define TVE200_CTRL_YUV420
#define TVE200_CTRL_CSMODE
#define TVE200_CTRL_NONINTERLACE
#define TVE200_CTRL_TVCLKP
/* Bits 24..26 define the burst size after arbitration on the bus */
#define TVE200_CTRL_BURST_4_WORDS
#define TVE200_CTRL_BURST_8_WORDS
#define TVE200_CTRL_BURST_16_WORDS
#define TVE200_CTRL_BURST_32_WORDS
#define TVE200_CTRL_BURST_64_WORDS
#define TVE200_CTRL_BURST_128_WORDS
#define TVE200_CTRL_BURST_256_WORDS
#define TVE200_CTRL_BURST_0_WORDS
/*
 * Bits 16..23 is the retry count*16 before issueing a new AHB transfer
 * on the AHB bus.
 */
#define TVE200_CTRL_RETRYCNT_MASK
#define TVE200_CTRL_RETRYCNT_16
#define TVE200_CTRL_BBBP
/* Bits 12..14 define the YCbCr ordering */
#define TVE200_CTRL_YCBCRODR_CB0Y0CR0Y1
#define TVE200_CTRL_YCBCRODR_Y0CB0Y1CR0
#define TVE200_CTRL_YCBCRODR_CR0Y0CB0Y1
#define TVE200_CTRL_YCBCRODR_Y1CB0Y0CR0
#define TVE200_CTRL_YCBCRODR_CR0Y1CB0Y0
#define TVE200_CTRL_YCBCRODR_Y1CR0Y0CB0
#define TVE200_CTRL_YCBCRODR_CB0Y1CR0Y0
#define TVE200_CTRL_YCBCRODR_Y0CR0Y1CB0
/* Bits 10..11 define the input resolution (framebuffer size) */
#define TVE200_CTRL_IPRESOL_CIF
#define TVE200_CTRL_IPRESOL_VGA
#define TVE200_CTRL_IPRESOL_D1
#define TVE200_CTRL_NTSC
#define TVE200_CTRL_INTERLACE
#define TVE200_IPDMOD_RGB555
#define TVE200_IPDMOD_RGB565
#define TVE200_IPDMOD_RGB888
#define TVE200_IPDMOD_YUV420
#define TVE200_IPDMOD_YUV422
/* Bits 4 & 5 define when to fire the vblank IRQ */
#define TVE200_VSTSTYPE_VSYNC
#define TVE200_VSTSTYPE_VBP
#define TVE200_VSTSTYPE_VAI
#define TVE200_VSTSTYPE_VFP
#define TVE200_VSTSTYPE_BITS
#define TVE200_BGR
#define TVE200_TVEEN

#define TVE200_CTRL_2
#define TVE200_CTRL_3

#define TVE200_CTRL_4
#define TVE200_CTRL_4_RESET

struct tve200_drm_dev_private {};

#define to_tve200_connector(x)

int tve200_display_init(struct drm_device *dev);
irqreturn_t tve200_irq(int irq, void *data);
int tve200_connector_init(struct drm_device *dev);
int tve200_encoder_init(struct drm_device *dev);
int tve200_dumb_create(struct drm_file *file_priv,
		      struct drm_device *dev,
		      struct drm_mode_create_dumb *args);

#endif /* _TVE200_DRM_H_ */