linux/drivers/gpu/drm/arm/display/komeda/komeda_dev.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * (C) COPYRIGHT 2018 ARM Limited. All rights reserved.
 * Author: James.Qian.Wang <[email protected]>
 *
 */
#ifndef _KOMEDA_DEV_H_
#define _KOMEDA_DEV_H_

#include <linux/device.h>
#include <linux/clk.h>
#include "komeda_pipeline.h"
#include "malidp_product.h"
#include "komeda_format_caps.h"

#define KOMEDA_EVENT_VSYNC
#define KOMEDA_EVENT_FLIP
#define KOMEDA_EVENT_URUN
#define KOMEDA_EVENT_IBSY
#define KOMEDA_EVENT_OVR
#define KOMEDA_EVENT_EOW
#define KOMEDA_EVENT_MODE
#define KOMEDA_EVENT_FULL
#define KOMEDA_EVENT_EMPTY

#define KOMEDA_ERR_TETO
#define KOMEDA_ERR_TEMR
#define KOMEDA_ERR_TITR
#define KOMEDA_ERR_CPE
#define KOMEDA_ERR_CFGE
#define KOMEDA_ERR_AXIE
#define KOMEDA_ERR_ACE0
#define KOMEDA_ERR_ACE1
#define KOMEDA_ERR_ACE2
#define KOMEDA_ERR_ACE3
#define KOMEDA_ERR_DRIFTTO
#define KOMEDA_ERR_FRAMETO
#define KOMEDA_ERR_CSCE
#define KOMEDA_ERR_ZME
#define KOMEDA_ERR_MERR
#define KOMEDA_ERR_TCF
#define KOMEDA_ERR_TTNG
#define KOMEDA_ERR_TTF

#define KOMEDA_ERR_EVENTS

#define KOMEDA_WARN_EVENTS

#define KOMEDA_INFO_EVENTS

/* pipeline DT ports */
enum {};

struct komeda_chip_info {};

struct komeda_dev;

struct komeda_events {};

/**
 * struct komeda_dev_funcs
 *
 * Supplied by chip level and returned by the chip entry function xxx_identify,
 */
struct komeda_dev_funcs {};

/*
 * DISPLAY_MODE describes how many display been enabled, and which will be
 * passed to CHIP by &komeda_dev_funcs->change_opmode(), then CHIP can do the
 * pipeline resources assignment according to this usage hint.
 * -   KOMEDA_MODE_DISP0: Only one display enabled, pipeline-0 work as master.
 * -   KOMEDA_MODE_DISP1: Only one display enabled, pipeline-0 work as master.
 * -   KOMEDA_MODE_DUAL_DISP: Dual display mode, both display has been enabled.
 * And D71 supports assign two pipelines to one single display on mode
 * KOMEDA_MODE_DISP0/DISP1
 */
enum {};

/**
 * struct komeda_dev
 *
 * Pipeline and component are used to describe how to handle the pixel data.
 * komeda_device is for describing the whole view of the device, and the
 * control-abilites of device.
 */
struct komeda_dev {};

static inline bool
komeda_product_match(struct komeda_dev *mdev, u32 target)
{}

komeda_identify_func;

const struct komeda_dev_funcs *
d71_identify(u32 __iomem *reg, struct komeda_chip_info *chip);

struct komeda_dev *komeda_dev_create(struct device *dev);
void komeda_dev_destroy(struct komeda_dev *mdev);

struct komeda_dev *dev_to_mdev(struct device *dev);

void komeda_print_events(struct komeda_events *evts, struct drm_device *dev);

int komeda_dev_resume(struct komeda_dev *mdev);
int komeda_dev_suspend(struct komeda_dev *mdev);

#endif /*_KOMEDA_DEV_H_*/