summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/dss/dsi.c
diff options
context:
space:
mode:
authorSebastian Reichel <sebastian.reichel@collabora.com>2020-12-15 12:45:47 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2020-12-15 16:08:21 +0200
commita5f2dcdebd83f27d8c3e7771b8fc1be0058bd3df (patch)
treea7fcb3c8e99492f3020dac6a2a9bfa1738a99b57 /drivers/gpu/drm/omapdrm/dss/dsi.c
parentd4cf1537286820e4cf381cab33a22f8f5dc4c8e1 (diff)
downloadlinux-a5f2dcdebd83f27d8c3e7771b8fc1be0058bd3df.tar.bz2
drm/omap: dsi: request VC via mipi_dsi_attach
Drop custom request_vc/release_vc callbacks by using the generic mipi_dsi_attach/mipi_dsi_detach functions. To use mipi_dsi_attach() we need to fill in the mipi_dsi_device fields, and some of these fields overlap with the fields in omap_dss_dsi_config. In later patches the latter will get dropped. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-15-tomi.valkeinen@ti.com
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss/dsi.c')
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dsi.c61
1 files changed, 26 insertions, 35 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 6a8579c69157..d960335574f3 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -349,7 +349,7 @@ struct dsi_data {
struct {
enum dsi_vc_source source;
- struct omap_dss_device *dssdev;
+ struct mipi_dsi_device *dest;
enum fifo_size tx_fifo_size;
enum fifo_size rx_fifo_size;
} vc[4];
@@ -4689,32 +4689,6 @@ static enum omap_channel dsi_get_channel(struct dsi_data *dsi)
}
}
-static int dsi_request_vc(struct omap_dss_device *dssdev, int channel)
-{
- struct dsi_data *dsi = to_dsi_data(dssdev);
-
- if (channel < 0 || channel > 3)
- return -EINVAL;
-
- if (dsi->vc[channel].dssdev) {
- DSSERR("cannot get VC for display %s", dssdev->name);
- return -EBUSY;
- }
-
- dsi->vc[channel].dssdev = dssdev;
- return 0;
-}
-
-static void dsi_release_vc(struct omap_dss_device *dssdev, int channel)
-{
- struct dsi_data *dsi = to_dsi_data(dssdev);
-
- if ((channel >= 0 && channel <= 3) &&
- dsi->vc[channel].dssdev == dssdev) {
- dsi->vc[channel].dssdev = NULL;
- }
-}
-
static ssize_t omap_dsi_host_transfer(struct mipi_dsi_host *host,
const struct mipi_dsi_msg *msg)
{
@@ -4791,23 +4765,40 @@ static const struct omap_dss_device_ops dsi_ops = {
.update = dsi_update,
.enable_te = dsi_enable_te,
-
- .request_vc = dsi_request_vc,
- .release_vc = dsi_release_vc,
},
};
static int omap_dsi_host_attach(struct mipi_dsi_host *host,
- struct mipi_dsi_device *dsi)
+ struct mipi_dsi_device *client)
{
- /* TODO: convert driver from custom binding method to this one */
+ struct dsi_data *dsi = host_to_omap(host);
+ unsigned int channel = client->channel;
+
+ if (channel > 3)
+ return -EINVAL;
+
+ if (dsi->vc[channel].dest) {
+ DSSERR("cannot get VC for display %s", dev_name(&client->dev));
+ return -EBUSY;
+ }
+
+ dsi->vc[channel].dest = client;
return 0;
}
static int omap_dsi_host_detach(struct mipi_dsi_host *host,
- struct mipi_dsi_device *dsi)
+ struct mipi_dsi_device *client)
{
- /* TODO: convert driver from custom binding method to this one */
+ struct dsi_data *dsi = host_to_omap(host);
+ unsigned int channel = client->channel;
+
+ if (channel > 3)
+ return -EINVAL;
+
+ if (dsi->vc[channel].dest != client)
+ return -EINVAL;
+
+ dsi->vc[channel].dest = NULL;
return 0;
}
@@ -5265,7 +5256,7 @@ static int dsi_probe(struct platform_device *pdev)
/* DSI VCs initialization */
for (i = 0; i < ARRAY_SIZE(dsi->vc); i++) {
dsi->vc[i].source = DSI_VC_SOURCE_L4;
- dsi->vc[i].dssdev = NULL;
+ dsi->vc[i].dest = NULL;
}
r = dsi_get_clocks(dsi);