diff options
author | Yannick Fertré <yannick.fertre@st.com> | 2019-10-07 15:29:05 +0200 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2019-10-13 23:34:43 +0200 |
commit | 23f965a4c611e5c2d2576b5f8d2aa2ea6fffb24c (patch) | |
tree | e22352952c3220fbb074c95dfab9873e2c3fc9ac /drivers/video/dsi-host-uclass.c | |
parent | 66c37246567c04416780f2c2b87aa251470e0585 (diff) | |
download | u-boot-23f965a4c611e5c2d2576b5f8d2aa2ea6fffb24c.zip u-boot-23f965a4c611e5c2d2576b5f8d2aa2ea6fffb24c.tar.gz u-boot-23f965a4c611e5c2d2576b5f8d2aa2ea6fffb24c.tar.bz2 |
dm: Add a dsi host uclass
Display Serial Interface (DSI) host can usefully be modelled
as their own uclass.
DSI defines a serial bus and a communication protocol
between the host and the device (panel, bridge).
Signed-off-by: Yannick Fertré <yannick.fertre@st.com>
Diffstat (limited to 'drivers/video/dsi-host-uclass.c')
-rw-r--r-- | drivers/video/dsi-host-uclass.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/video/dsi-host-uclass.c b/drivers/video/dsi-host-uclass.c new file mode 100644 index 0000000..1db1f88 --- /dev/null +++ b/drivers/video/dsi-host-uclass.c @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 STMicroelectronics - All Rights Reserved + * Author(s): Yannick Fertre <yannick.fertre@st.com> for STMicroelectronics. + * + */ + +#include <common.h> +#include <dm.h> +#include <dsi_host.h> + +int 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) +{ + struct dsi_host_ops *ops = dsi_host_get_ops(dev); + + if (!ops->init) + return -ENOSYS; + + return ops->init(dev, device, timings, max_data_lanes, phy_ops); +} + +int dsi_host_enable(struct udevice *dev) +{ + struct dsi_host_ops *ops = dsi_host_get_ops(dev); + + if (!ops->enable) + return -ENOSYS; + + return ops->enable(dev); +} + +UCLASS_DRIVER(dsi_host) = { + .id = UCLASS_DSI_HOST, + .name = "dsi_host", +}; |