1 // SPDX-License-Identifier: GPL-2.0
3 * TI j721e Cadence DSI wrapper
5 * Copyright (C) 2022 Texas Instruments Incorporated - http://www.ti.com/
10 #include <linux/platform_device.h>
12 #include "cdns-dsi-j721e.h"
14 #define DSI_WRAP_REVISION 0x0
15 #define DSI_WRAP_DPI_CONTROL 0x4
16 #define DSI_WRAP_DSC_CONTROL 0x8
17 #define DSI_WRAP_DPI_SECURE 0xc
18 #define DSI_WRAP_DSI_0_ASF_STATUS 0x10
20 #define DSI_WRAP_DPI_0_EN BIT(0)
21 #define DSI_WRAP_DSI2_MUX_SEL BIT(4)
23 static int cdns_dsi_j721e_init(struct cdns_dsi *dsi)
25 struct platform_device *pdev = to_platform_device(dsi->base.dev);
27 dsi->j721e_regs = devm_platform_ioremap_resource(pdev, 1);
28 return PTR_ERR_OR_ZERO(dsi->j721e_regs);
31 static void cdns_dsi_j721e_enable(struct cdns_dsi *dsi)
34 * Enable DPI0 as its input. DSS0 DPI2 is connected
35 * to DSI DPI0. This is the only supported configuration on
38 writel(DSI_WRAP_DPI_0_EN, dsi->j721e_regs + DSI_WRAP_DPI_CONTROL);
41 static void cdns_dsi_j721e_disable(struct cdns_dsi *dsi)
43 /* Put everything to defaults */
44 writel(0, dsi->j721e_regs + DSI_WRAP_DPI_CONTROL);
47 const struct cdns_dsi_platform_ops dsi_ti_j721e_ops = {
48 .init = cdns_dsi_j721e_init,
49 .enable = cdns_dsi_j721e_enable,
50 .disable = cdns_dsi_j721e_disable,