Yannick Fertré | 23f965a | 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 | b953ec2 | 2021-04-27 11:02:19 +0200 | [diff] [blame] | 8 | #define LOG_CATEGORY UCLASS_DSI_HOST |
| 9 | |
Tom Rini | d678a59 | 2024-05-18 20:20:43 -0600 | [diff] [blame] | 10 | #include <common.h> |
Yannick Fertré | 23f965a | 2019-10-07 15:29:05 +0200 | [diff] [blame] | 11 | #include <dm.h> |
| 12 | #include <dsi_host.h> |
| 13 | |
| 14 | int dsi_host_init(struct udevice *dev, |
| 15 | struct mipi_dsi_device *device, |
| 16 | struct display_timing *timings, |
| 17 | unsigned int max_data_lanes, |
| 18 | const struct mipi_dsi_phy_ops *phy_ops) |
| 19 | { |
| 20 | struct dsi_host_ops *ops = dsi_host_get_ops(dev); |
| 21 | |
| 22 | if (!ops->init) |
| 23 | return -ENOSYS; |
| 24 | |
| 25 | return ops->init(dev, device, timings, max_data_lanes, phy_ops); |
| 26 | } |
| 27 | |
| 28 | int dsi_host_enable(struct udevice *dev) |
| 29 | { |
| 30 | struct dsi_host_ops *ops = dsi_host_get_ops(dev); |
| 31 | |
| 32 | if (!ops->enable) |
| 33 | return -ENOSYS; |
| 34 | |
| 35 | return ops->enable(dev); |
| 36 | } |
| 37 | |
| 38 | UCLASS_DRIVER(dsi_host) = { |
| 39 | .id = UCLASS_DSI_HOST, |
| 40 | .name = "dsi_host", |
| 41 | }; |