Yannick Fertré | 9712c82 | 2019-10-07 15:29:05 +0200 | [diff] [blame] | 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 | |
Patrick Delaunay | 8131335 | 2021-04-27 11:02:19 +0200 | [diff] [blame] | 8 | #define LOG_CATEGORY UCLASS_DSI_HOST |
| 9 | |
Yannick Fertré | 9712c82 | 2019-10-07 15:29:05 +0200 | [diff] [blame] | 10 | #include <dm.h> |
| 11 | #include <dsi_host.h> |
| 12 | |
| 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 | |
| 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 | }; |