1 // 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 #define LOG_CATEGORY UCLASS_DSI_HOST
9 
10 #include <dm.h>
11 #include <dsi_host.h>
12 
dsi_host_init(struct udevice * dev,struct mipi_dsi_device * device,struct display_timing * timings,unsigned int max_data_lanes,const struct mipi_dsi_phy_ops * phy_ops)13 int dsi_host_init(struct udevice *dev,
14 		  struct mipi_dsi_device *device,
15 		  struct display_timing *timings,
16 		  unsigned int max_data_lanes,
17 		  const struct mipi_dsi_phy_ops *phy_ops)
18 {
19 	struct dsi_host_ops *ops = dsi_host_get_ops(dev);
20 
21 	if (!ops->init)
22 		return -ENOSYS;
23 
24 	return ops->init(dev, device, timings, max_data_lanes, phy_ops);
25 }
26 
dsi_host_enable(struct udevice * dev)27 int dsi_host_enable(struct udevice *dev)
28 {
29 	struct dsi_host_ops *ops = dsi_host_get_ops(dev);
30 
31 	if (!ops->enable)
32 		return -ENOSYS;
33 
34 	return ops->enable(dev);
35 }
36 
37 UCLASS_DRIVER(dsi_host) = {
38 	.id		= UCLASS_DSI_HOST,
39 	.name		= "dsi_host",
40 };
41