mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-27 11:58:32 -04:00
drm/omap: dsi: do bus locking in host driver
This moves the bus locking into the host driver and unexports the custom API in preparation for drm_panel support. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-27-tomi.valkeinen@ti.com
This commit is contained in:
committed by
Tomi Valkeinen
parent
e9c7a0d713
commit
0c93a61db4
@@ -477,17 +477,13 @@ static inline u32 dsi_read_reg(struct dsi_data *dsi, const struct dsi_reg idx)
|
||||
return __raw_readl(base + idx.idx);
|
||||
}
|
||||
|
||||
static void dsi_bus_lock(struct omap_dss_device *dssdev)
|
||||
static void dsi_bus_lock(struct dsi_data *dsi)
|
||||
{
|
||||
struct dsi_data *dsi = to_dsi_data(dssdev);
|
||||
|
||||
down(&dsi->bus_lock);
|
||||
}
|
||||
|
||||
static void dsi_bus_unlock(struct omap_dss_device *dssdev)
|
||||
static void dsi_bus_unlock(struct dsi_data *dsi)
|
||||
{
|
||||
struct dsi_data *dsi = to_dsi_data(dssdev);
|
||||
|
||||
up(&dsi->bus_lock);
|
||||
}
|
||||
|
||||
@@ -3800,6 +3796,8 @@ static void dsi_handle_framedone(struct dsi_data *dsi, int error)
|
||||
REG_FLD_MOD(dsi, DSI_TIMING2, 1, 15, 15); /* LP_RX_TO */
|
||||
}
|
||||
|
||||
dsi_bus_unlock(dsi);
|
||||
|
||||
dsi->framedone_callback(error, dsi->framedone_data);
|
||||
|
||||
if (!error)
|
||||
@@ -3854,6 +3852,8 @@ static int dsi_update(struct omap_dss_device *dssdev, int channel,
|
||||
{
|
||||
struct dsi_data *dsi = to_dsi_data(dssdev);
|
||||
|
||||
dsi_bus_lock(dsi);
|
||||
|
||||
dsi->update_channel = channel;
|
||||
dsi->framedone_callback = callback;
|
||||
dsi->framedone_data = data;
|
||||
@@ -4059,7 +4059,7 @@ static void dsi_display_enable(struct omap_dss_device *dssdev)
|
||||
|
||||
DSSDBG("dsi_display_enable\n");
|
||||
|
||||
WARN_ON(!dsi_bus_is_locked(dsi));
|
||||
dsi_bus_lock(dsi);
|
||||
|
||||
mutex_lock(&dsi->lock);
|
||||
|
||||
@@ -4075,6 +4075,8 @@ static void dsi_display_enable(struct omap_dss_device *dssdev)
|
||||
|
||||
mutex_unlock(&dsi->lock);
|
||||
|
||||
dsi_bus_unlock(dsi);
|
||||
|
||||
return;
|
||||
|
||||
err_init_dsi:
|
||||
@@ -4091,7 +4093,7 @@ static void dsi_display_disable(struct omap_dss_device *dssdev,
|
||||
|
||||
DSSDBG("dsi_display_disable\n");
|
||||
|
||||
WARN_ON(!dsi_bus_is_locked(dsi));
|
||||
dsi_bus_lock(dsi);
|
||||
|
||||
mutex_lock(&dsi->lock);
|
||||
|
||||
@@ -4105,6 +4107,8 @@ static void dsi_display_disable(struct omap_dss_device *dssdev,
|
||||
dsi_runtime_put(dsi);
|
||||
|
||||
mutex_unlock(&dsi->lock);
|
||||
|
||||
dsi_bus_unlock(dsi);
|
||||
}
|
||||
|
||||
static int dsi_enable_te(struct dsi_data *dsi, bool enable)
|
||||
@@ -4713,10 +4717,9 @@ static enum omap_channel dsi_get_channel(struct dsi_data *dsi)
|
||||
}
|
||||
}
|
||||
|
||||
static ssize_t omap_dsi_host_transfer(struct mipi_dsi_host *host,
|
||||
const struct mipi_dsi_msg *msg)
|
||||
static ssize_t _omap_dsi_host_transfer(struct dsi_data *dsi,
|
||||
const struct mipi_dsi_msg *msg)
|
||||
{
|
||||
struct dsi_data *dsi = host_to_omap(host);
|
||||
struct omap_dss_device *dssdev = &dsi->output;
|
||||
int r;
|
||||
|
||||
@@ -4765,6 +4768,19 @@ static ssize_t omap_dsi_host_transfer(struct mipi_dsi_host *host,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ssize_t omap_dsi_host_transfer(struct mipi_dsi_host *host,
|
||||
const struct mipi_dsi_msg *msg)
|
||||
{
|
||||
struct dsi_data *dsi = host_to_omap(host);
|
||||
int r;
|
||||
|
||||
dsi_bus_lock(dsi);
|
||||
r = _omap_dsi_host_transfer(dsi, msg);
|
||||
dsi_bus_unlock(dsi);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static int dsi_get_clocks(struct dsi_data *dsi)
|
||||
{
|
||||
struct clk *clk;
|
||||
@@ -4798,9 +4814,6 @@ static const struct omap_dss_device_ops dsi_ops = {
|
||||
.enable = dsi_display_enable,
|
||||
|
||||
.dsi = {
|
||||
.bus_lock = dsi_bus_lock,
|
||||
.bus_unlock = dsi_bus_unlock,
|
||||
|
||||
.disable = dsi_display_disable,
|
||||
|
||||
.set_config = dsi_set_config,
|
||||
|
||||
@@ -294,9 +294,6 @@ struct omapdss_dsi_ops {
|
||||
int (*update)(struct omap_dss_device *dssdev, int channel,
|
||||
void (*callback)(int, void *), void *data);
|
||||
|
||||
void (*bus_lock)(struct omap_dss_device *dssdev);
|
||||
void (*bus_unlock)(struct omap_dss_device *dssdev);
|
||||
|
||||
int (*enable_video_output)(struct omap_dss_device *dssdev, int channel);
|
||||
void (*disable_video_output)(struct omap_dss_device *dssdev,
|
||||
int channel);
|
||||
|
||||
Reference in New Issue
Block a user