From: Rahul T R <r-ravikumar@ti.com>
To: <dri-devel@lists.freedesktop.org>, <robh+dt@kernel.org>,
<krzysztof.kozlowski+dt@linaro.org>
Cc: <andrzej.hajda@intel.com>, <narmstrong@baylibre.com>,
<robert.foss@linaro.org>, <jonas@kwiboo.se>,
<jernej.skrabec@gmail.com>, <airlied@linux.ie>, <daniel@ffwll.ch>,
<p.zabel@pengutronix.de>, <tomi.valkeinen@ideasonboard.com>,
<laurent.pinchart@ideasonboard.com>,
<linux-kernel@vger.kernel.org>, <jpawar@cadence.com>,
<sjakhade@cadence.com>, <mparab@cadence.com>, <a-bhatia1@ti.com>,
<devicetree@vger.kernel.org>, <vigneshr@ti.com>,
<lee.jones@linaro.org>, Rahul T R <r-ravikumar@ti.com>
Subject: [PATCH v11 4/5] drm/bridge: cdns-dsi: Create a header file
Date: Tue, 3 Jan 2023 15:49:50 +0530 [thread overview]
Message-ID: <20230103101951.10963-5-r-ravikumar@ti.com> (raw)
In-Reply-To: <20230103101951.10963-1-r-ravikumar@ti.com>
Create a header file for cdns dsi and move structure definations to
prepare for adding j721e wrapper support
Signed-off-by: Rahul T R <r-ravikumar@ti.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
.../gpu/drm/bridge/cadence/cdns-dsi-core.c | 48 +-------------
.../gpu/drm/bridge/cadence/cdns-dsi-core.h | 64 +++++++++++++++++++
2 files changed, 66 insertions(+), 46 deletions(-)
create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-dsi-core.h
diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c
index 20bece84ff8c..058349bfeb67 100644
--- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c
+++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c
@@ -6,10 +6,7 @@
*/
#include <drm/drm_atomic_helper.h>
-#include <drm/drm_bridge.h>
#include <drm/drm_drv.h>
-#include <drm/drm_mipi_dsi.h>
-#include <drm/drm_panel.h>
#include <drm/drm_probe_helper.h>
#include <video/mipi_display.h>
@@ -23,9 +20,10 @@
#include <linux/pm_runtime.h>
#include <linux/reset.h>
-#include <linux/phy/phy.h>
#include <linux/phy/phy-mipi-dphy.h>
+#include "cdns-dsi-core.h"
+
#define IP_CONF 0x0
#define SP_HS_FIFO_DEPTH(x) (((x) & GENMASK(30, 26)) >> 26)
#define SP_LP_FIFO_DEPTH(x) (((x) & GENMASK(25, 21)) >> 21)
@@ -424,48 +422,6 @@
#define DSI_NULL_FRAME_OVERHEAD 6
#define DSI_EOT_PKT_SIZE 4
-struct cdns_dsi_output {
- struct mipi_dsi_device *dev;
- struct drm_panel *panel;
- struct drm_bridge *bridge;
- union phy_configure_opts phy_opts;
-};
-
-enum cdns_dsi_input_id {
- CDNS_SDI_INPUT,
- CDNS_DPI_INPUT,
- CDNS_DSC_INPUT,
-};
-
-struct cdns_dsi_cfg {
- unsigned int hfp;
- unsigned int hsa;
- unsigned int hbp;
- unsigned int hact;
- unsigned int htotal;
-};
-
-struct cdns_dsi_input {
- enum cdns_dsi_input_id id;
- struct drm_bridge bridge;
-};
-
-struct cdns_dsi {
- struct mipi_dsi_host base;
- void __iomem *regs;
- struct cdns_dsi_input input;
- struct cdns_dsi_output output;
- unsigned int direct_cmd_fifo_depth;
- unsigned int rx_fifo_depth;
- struct completion direct_cmd_comp;
- struct clk *dsi_p_clk;
- struct reset_control *dsi_p_rst;
- struct clk *dsi_sys_clk;
- bool link_initialized;
- bool phy_initialized;
- struct phy *dphy;
-};
-
static inline struct cdns_dsi *input_to_dsi(struct cdns_dsi_input *input)
{
return container_of(input, struct cdns_dsi, input);
diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.h b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.h
new file mode 100644
index 000000000000..d5bb5caf77b1
--- /dev/null
+++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.h
@@ -0,0 +1,64 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright: 2017 Cadence Design Systems, Inc.
+ *
+ * Author: Boris Brezillon <boris.brezillon@bootlin.com>
+ */
+
+#ifndef __CDNS_DSI_H__
+#define __CDNS_DSI_H__
+
+#include <drm/drm_bridge.h>
+#include <drm/drm_mipi_dsi.h>
+#include <drm/drm_panel.h>
+
+#include <linux/bits.h>
+#include <linux/completion.h>
+#include <linux/phy/phy.h>
+
+struct clk;
+struct reset_control;
+
+struct cdns_dsi_output {
+ struct mipi_dsi_device *dev;
+ struct drm_panel *panel;
+ struct drm_bridge *bridge;
+ union phy_configure_opts phy_opts;
+};
+
+enum cdns_dsi_input_id {
+ CDNS_SDI_INPUT,
+ CDNS_DPI_INPUT,
+ CDNS_DSC_INPUT,
+};
+
+struct cdns_dsi_cfg {
+ unsigned int hfp;
+ unsigned int hsa;
+ unsigned int hbp;
+ unsigned int hact;
+ unsigned int htotal;
+};
+
+struct cdns_dsi_input {
+ enum cdns_dsi_input_id id;
+ struct drm_bridge bridge;
+};
+
+struct cdns_dsi {
+ struct mipi_dsi_host base;
+ void __iomem *regs;
+ struct cdns_dsi_input input;
+ struct cdns_dsi_output output;
+ unsigned int direct_cmd_fifo_depth;
+ unsigned int rx_fifo_depth;
+ struct completion direct_cmd_comp;
+ struct clk *dsi_p_clk;
+ struct reset_control *dsi_p_rst;
+ struct clk *dsi_sys_clk;
+ bool link_initialized;
+ bool phy_initialized;
+ struct phy *dphy;
+};
+
+#endif /* !__CDNS_DSI_H__ */
--
2.39.0
next prev parent reply other threads:[~2023-01-03 10:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-03 10:19 [PATCH v11 0/5] Add support for CDNS DSI J721E wrapper Rahul T R
2023-01-03 10:19 ` [PATCH v11 1/5] dt-bindings: display: bridge: Convert cdns,dsi.txt to yaml Rahul T R
2023-01-17 11:30 ` Andrzej Hajda
2023-01-03 10:19 ` [PATCH v11 2/5] dt-bindings: display: bridge: cdns,dsi: Add compatible for dsi on j721e Rahul T R
2023-01-17 11:31 ` Andrzej Hajda
2023-01-03 10:19 ` [PATCH v11 3/5] drm/bridge: cdns-dsi: Move to drm/bridge/cadence Rahul T R
2023-01-17 11:31 ` Andrzej Hajda
2023-01-03 10:19 ` Rahul T R [this message]
2023-01-17 11:34 ` [PATCH v11 4/5] drm/bridge: cdns-dsi: Create a header file Andrzej Hajda
2023-01-03 10:19 ` [PATCH v11 5/5] drm/bridge: cdns-dsi: Add support for J721E wrapper Rahul T R
2023-01-17 10:47 ` Laurent Pinchart
2023-01-17 11:35 ` Andrzej Hajda
2023-01-17 12:15 ` [PATCH v11 0/5] Add support for CDNS DSI " Tomi Valkeinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230103101951.10963-5-r-ravikumar@ti.com \
--to=r-ravikumar@ti.com \
--cc=a-bhatia1@ti.com \
--cc=airlied@linux.ie \
--cc=andrzej.hajda@intel.com \
--cc=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=jpawar@cadence.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mparab@cadence.com \
--cc=narmstrong@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=robert.foss@linaro.org \
--cc=robh+dt@kernel.org \
--cc=sjakhade@cadence.com \
--cc=tomi.valkeinen@ideasonboard.com \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox