blob: 83f8839db68dbf88f5cb2b8d3e524ef12223d2a6 [file] [log] [blame]
Yannick Fertré9712c822019-10-07 15:29:05 +02001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (C) 2019 STMicroelectronics - All Rights Reserved
4 * Author(s): Yannick Fertre <yannick.fertre@st.com> for STMicroelectronics.
5 *
6 */
7
8#ifndef _DSI_HOST_H
9#define _DSI_HOST_H
10
11#include <mipi_dsi.h>
12
13struct dsi_host_ops {
14 /**
15 * init() - initialized the dsi_host
16 *
17 * @dev: dsi host device
18 * @device: DSI peripheral device
19 * @timing: Display timings
20 * @max_data_lanes: maximum number of data lines
21 * @phy_ops: set of function pointers for performing physical operations
22 * @return 0 if OK, -ve on error
23 */
24 int (*init)(struct udevice *dev,
25 struct mipi_dsi_device *device,
26 struct display_timing *timings,
27 unsigned int max_data_lanes,
28 const struct mipi_dsi_phy_ops *phy_ops);
29
30 /**
31 * enable() - Enable the dsi_host
32 *
33 * @dev: dsi host device
34 * @return 0 if OK, -ve on error
35 */
36 int (*enable)(struct udevice *dev);
37
38 /**
39 * disable() - Disable the dsi_host
40 *
41 * @dev: dsi host device
42 * @return 0 if OK, -ve on error
43 */
44 int (*disable)(struct udevice *dev);
45};
46
47#define dsi_host_get_ops(dev) ((struct dsi_host_ops *)(dev)->driver->ops)
48
49/**
50 * dsi_host_init
51 *
52 * @dev: dsi host device
53 * @device: DSI peripheral device
54 * @timing: Display timings
55 * @max_data_lanes: maximum number of data lines
56 * @phy_ops: set of function pointers for performing physical operations
Heinrich Schuchardt47b4c022022-01-19 18:05:50 +010057 * Return: 0 if OK, -ve on error
Yannick Fertré9712c822019-10-07 15:29:05 +020058 */
59int dsi_host_init(struct udevice *dev,
60 struct mipi_dsi_device *device,
61 struct display_timing *timings,
62 unsigned int max_data_lanes,
63 const struct mipi_dsi_phy_ops *phy_ops);
64
65/**
66 * dsi_host_enable
67 *
68 * @dev: dsi host device
Heinrich Schuchardt47b4c022022-01-19 18:05:50 +010069 * Return: 0 if OK, -ve on error
Yannick Fertré9712c822019-10-07 15:29:05 +020070 */
71int dsi_host_enable(struct udevice *dev);
72
73#endif