[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200220172147.919996-6-enric.balletbo@collabora.com>
Date: Thu, 20 Feb 2020 18:21:46 +0100
From: Enric Balletbo i Serra <enric.balletbo@...labora.com>
To: robh+dt@...nel.org, mark.rutland@....com, ck.hu@...iatek.com,
p.zabel@...gutronix.de, airlied@...ux.ie, mturquette@...libre.com,
sboyd@...nel.org, ulrich.hecht+renesas@...il.com,
laurent.pinchart@...asonboard.com
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>, rdunlap@...radead.org,
dri-devel@...ts.freedesktop.org, Weiyi Lu <weiyi.lu@...iatek.com>,
Seiya Wang <seiya.wang@...iatek.com>,
linux-clk@...r.kernel.org,
Collabora Kernel ML <kernel@...labora.com>,
mtk01761 <wendell.lin@...iatek.com>,
Allison Randal <allison@...utok.net>,
Thomas Gleixner <tglx@...utronix.de>, wens@...e.org,
Kate Stewart <kstewart@...uxfoundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Houlong Wei <houlong.wei@...iatek.com>,
Matthias Brugger <matthias.bgg@...il.com>,
linux-media@...r.kernel.org, devicetree@...r.kernel.org,
sean.wang@...iatek.com, frank-w@...lic-files.de,
Minghsiu Tsai <minghsiu.tsai@...iatek.com>,
Andrew-CT Chen <andrew-ct.chen@...iatek.com>,
linux-mediatek@...ts.infradead.org, hsinyi@...omium.org,
Matthias Brugger <mbrugger@...e.com>,
linux-arm-kernel@...ts.infradead.org,
Richard Fontana <rfontana@...hat.com>,
linux-kernel@...r.kernel.org, matthias.bgg@...nel.org,
Daniel Vetter <daniel@...ll.ch>
Subject: [PATCH v8 5/6] drm/mediatek: Move MMSYS configuration to include/linux/platform_data
The MMSYS platform data and DDP enums will be needed to compile other
drivers, so move it to a global location.
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@...labora.com>
---
Changes in v8:
- New patch introduced in this series.
Changes in v7: None
drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h | 56 +---------------
drivers/gpu/drm/mediatek/mtk_drm_drv.h | 11 ----
include/linux/platform_data/mtk_mmsys.h | 73 +++++++++++++++++++++
3 files changed, 75 insertions(+), 65 deletions(-)
create mode 100644 include/linux/platform_data/mtk_mmsys.h
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
index debe36395fe7..dc45edbec3bd 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
+++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
@@ -6,6 +6,7 @@
#ifndef MTK_DRM_DDP_COMP_H
#define MTK_DRM_DDP_COMP_H
+#include <linux/platform_data/mtk_mmsys.h>
#include <linux/io.h>
struct device;
@@ -14,62 +15,9 @@ struct drm_crtc;
struct drm_device;
struct mtk_plane_state;
struct drm_crtc_state;
-
-enum mtk_ddp_comp_type {
- MTK_DISP_OVL,
- MTK_DISP_OVL_2L,
- MTK_DISP_RDMA,
- MTK_DISP_WDMA,
- MTK_DISP_COLOR,
- MTK_DISP_CCORR,
- MTK_DISP_DITHER,
- MTK_DISP_AAL,
- MTK_DISP_GAMMA,
- MTK_DISP_UFOE,
- MTK_DSI,
- MTK_DPI,
- MTK_DISP_PWM,
- MTK_DISP_MUTEX,
- MTK_DISP_OD,
- MTK_DISP_BLS,
- MTK_DDP_COMP_TYPE_MAX,
-};
-
-enum mtk_ddp_comp_id {
- DDP_COMPONENT_AAL0,
- DDP_COMPONENT_AAL1,
- DDP_COMPONENT_BLS,
- DDP_COMPONENT_CCORR,
- DDP_COMPONENT_COLOR0,
- DDP_COMPONENT_COLOR1,
- DDP_COMPONENT_DITHER,
- DDP_COMPONENT_DPI0,
- DDP_COMPONENT_DPI1,
- DDP_COMPONENT_DSI0,
- DDP_COMPONENT_DSI1,
- DDP_COMPONENT_DSI2,
- DDP_COMPONENT_DSI3,
- DDP_COMPONENT_GAMMA,
- DDP_COMPONENT_OD0,
- DDP_COMPONENT_OD1,
- DDP_COMPONENT_OVL0,
- DDP_COMPONENT_OVL_2L0,
- DDP_COMPONENT_OVL_2L1,
- DDP_COMPONENT_OVL1,
- DDP_COMPONENT_PWM0,
- DDP_COMPONENT_PWM1,
- DDP_COMPONENT_PWM2,
- DDP_COMPONENT_RDMA0,
- DDP_COMPONENT_RDMA1,
- DDP_COMPONENT_RDMA2,
- DDP_COMPONENT_UFOE,
- DDP_COMPONENT_WDMA0,
- DDP_COMPONENT_WDMA1,
- DDP_COMPONENT_ID_MAX,
-};
-
struct mtk_ddp_comp;
struct cmdq_pkt;
+
struct mtk_ddp_comp_funcs {
void (*config)(struct mtk_ddp_comp *comp, unsigned int w,
unsigned int h, unsigned int vrefresh,
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.h b/drivers/gpu/drm/mediatek/mtk_drm_drv.h
index 03201080688d..317a2a26ad1d 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.h
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.h
@@ -20,17 +20,6 @@ struct drm_fb_helper;
struct drm_property;
struct regmap;
-struct mtk_mmsys_driver_data {
- const enum mtk_ddp_comp_id *main_path;
- unsigned int main_len;
- const enum mtk_ddp_comp_id *ext_path;
- unsigned int ext_len;
- const enum mtk_ddp_comp_id *third_path;
- unsigned int third_len;
-
- bool shadow_register;
-};
-
struct mtk_drm_private {
struct drm_device *drm;
struct device *dma_dev;
diff --git a/include/linux/platform_data/mtk_mmsys.h b/include/linux/platform_data/mtk_mmsys.h
new file mode 100644
index 000000000000..292f8e72d94f
--- /dev/null
+++ b/include/linux/platform_data/mtk_mmsys.h
@@ -0,0 +1,73 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2015 MediaTek Inc.
+ */
+
+#ifndef __LINUX_MTK_MMSYS_H
+#define __LINUX_MTK_MMSYS_H
+
+enum mtk_ddp_comp_type {
+ MTK_DISP_OVL,
+ MTK_DISP_OVL_2L,
+ MTK_DISP_RDMA,
+ MTK_DISP_WDMA,
+ MTK_DISP_COLOR,
+ MTK_DISP_CCORR,
+ MTK_DISP_DITHER,
+ MTK_DISP_AAL,
+ MTK_DISP_GAMMA,
+ MTK_DISP_UFOE,
+ MTK_DSI,
+ MTK_DPI,
+ MTK_DISP_PWM,
+ MTK_DISP_MUTEX,
+ MTK_DISP_OD,
+ MTK_DISP_BLS,
+ MTK_DDP_COMP_TYPE_MAX,
+};
+
+enum mtk_ddp_comp_id {
+ DDP_COMPONENT_AAL0,
+ DDP_COMPONENT_AAL1,
+ DDP_COMPONENT_BLS,
+ DDP_COMPONENT_CCORR,
+ DDP_COMPONENT_COLOR0,
+ DDP_COMPONENT_COLOR1,
+ DDP_COMPONENT_DITHER,
+ DDP_COMPONENT_DPI0,
+ DDP_COMPONENT_DPI1,
+ DDP_COMPONENT_DSI0,
+ DDP_COMPONENT_DSI1,
+ DDP_COMPONENT_DSI2,
+ DDP_COMPONENT_DSI3,
+ DDP_COMPONENT_GAMMA,
+ DDP_COMPONENT_OD0,
+ DDP_COMPONENT_OD1,
+ DDP_COMPONENT_OVL0,
+ DDP_COMPONENT_OVL_2L0,
+ DDP_COMPONENT_OVL_2L1,
+ DDP_COMPONENT_OVL1,
+ DDP_COMPONENT_PWM0,
+ DDP_COMPONENT_PWM1,
+ DDP_COMPONENT_PWM2,
+ DDP_COMPONENT_RDMA0,
+ DDP_COMPONENT_RDMA1,
+ DDP_COMPONENT_RDMA2,
+ DDP_COMPONENT_UFOE,
+ DDP_COMPONENT_WDMA0,
+ DDP_COMPONENT_WDMA1,
+ DDP_COMPONENT_ID_MAX,
+};
+
+struct mtk_mmsys_driver_data {
+ const enum mtk_ddp_comp_id *main_path;
+ unsigned int main_len;
+ const enum mtk_ddp_comp_id *ext_path;
+ unsigned int ext_len;
+ const enum mtk_ddp_comp_id *third_path;
+ unsigned int third_len;
+
+ bool shadow_register;
+};
+
+#endif /* __LINUX_MTK_MMSYS_H */
--
2.25.0
Powered by blists - more mailing lists