brintos

brintos / linux-shallow public Read only

0
0
Text · 1.3 KiB · b654d4b Raw
52 lines · c
1// SPDX-License-Identifier: GPL-2.02/*3 * TI j721e Cadence DSI wrapper4 *5 * Copyright (C) 2022 Texas Instruments Incorporated - http://www.ti.com/6 * Author: Rahul T R <r-ravikumar@ti.com>7 */8 9#include <linux/io.h>10#include <linux/platform_device.h>11 12#include "cdns-dsi-j721e.h"13 14#define DSI_WRAP_REVISION		0x015#define DSI_WRAP_DPI_CONTROL		0x416#define DSI_WRAP_DSC_CONTROL		0x817#define DSI_WRAP_DPI_SECURE		0xc18#define DSI_WRAP_DSI_0_ASF_STATUS	0x1019 20#define DSI_WRAP_DPI_0_EN		BIT(0)21#define DSI_WRAP_DSI2_MUX_SEL		BIT(4)22 23static int cdns_dsi_j721e_init(struct cdns_dsi *dsi)24{25	struct platform_device *pdev = to_platform_device(dsi->base.dev);26 27	dsi->j721e_regs = devm_platform_ioremap_resource(pdev, 1);28	return PTR_ERR_OR_ZERO(dsi->j721e_regs);29}30 31static void cdns_dsi_j721e_enable(struct cdns_dsi *dsi)32{33	/*34	 * Enable DPI0 as its input. DSS0 DPI2 is connected35	 * to DSI DPI0. This is the only supported configuration on36	 * J721E.37	 */38	writel(DSI_WRAP_DPI_0_EN, dsi->j721e_regs + DSI_WRAP_DPI_CONTROL);39}40 41static void cdns_dsi_j721e_disable(struct cdns_dsi *dsi)42{43	/* Put everything to defaults  */44	writel(0, dsi->j721e_regs + DSI_WRAP_DPI_CONTROL);45}46 47const 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,51};52