File: cdns-dsi-j721e.c

package info (click to toggle)
linux 6.16.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,724,576 kB
  • sloc: ansic: 26,558,545; asm: 271,315; sh: 143,998; python: 72,469; makefile: 57,126; perl: 36,821; xml: 19,553; cpp: 5,820; yacc: 4,915; lex: 2,955; awk: 1,667; sed: 28; ruby: 25
file content (51 lines) | stat: -rw-r--r-- 1,326 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// SPDX-License-Identifier: GPL-2.0
/*
 * TI j721e Cadence DSI wrapper
 *
 * Copyright (C) 2022 Texas Instruments Incorporated - http://www.ti.com/
 * Author: Rahul T R <r-ravikumar@ti.com>
 */

#include <linux/io.h>
#include <linux/platform_device.h>

#include "cdns-dsi-j721e.h"

#define DSI_WRAP_REVISION		0x0
#define DSI_WRAP_DPI_CONTROL		0x4
#define DSI_WRAP_DSC_CONTROL		0x8
#define DSI_WRAP_DPI_SECURE		0xc
#define DSI_WRAP_DSI_0_ASF_STATUS	0x10

#define DSI_WRAP_DPI_0_EN		BIT(0)
#define DSI_WRAP_DSI2_MUX_SEL		BIT(4)

static int cdns_dsi_j721e_init(struct cdns_dsi *dsi)
{
	struct platform_device *pdev = to_platform_device(dsi->base.dev);

	dsi->j721e_regs = devm_platform_ioremap_resource(pdev, 1);
	return PTR_ERR_OR_ZERO(dsi->j721e_regs);
}

static void cdns_dsi_j721e_enable(struct cdns_dsi *dsi)
{
	/*
	 * Enable DPI0 as its input. DSS0 DPI2 is connected
	 * to DSI DPI0. This is the only supported configuration on
	 * J721E.
	 */
	writel(DSI_WRAP_DPI_0_EN, dsi->j721e_regs + DSI_WRAP_DPI_CONTROL);
}

static void cdns_dsi_j721e_disable(struct cdns_dsi *dsi)
{
	/* Put everything to defaults  */
	writel(0, dsi->j721e_regs + DSI_WRAP_DPI_CONTROL);
}

const struct cdns_dsi_platform_ops dsi_ti_j721e_ops = {
	.init = cdns_dsi_j721e_init,
	.enable = cdns_dsi_j721e_enable,
	.disable = cdns_dsi_j721e_disable,
};