aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/drm_mipi_dsi.c14
-rw-r--r--drivers/gpu/drm/panel/panel-s6e8aa0.c4
-rw-r--r--include/drm/drm_mipi_dsi.h8
3 files changed, 12 insertions, 14 deletions
diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
index 6d2fd2077dae..6aa6a9e95570 100644
--- a/drivers/gpu/drm/drm_mipi_dsi.c
+++ b/drivers/gpu/drm/drm_mipi_dsi.c
@@ -201,16 +201,15 @@ EXPORT_SYMBOL(mipi_dsi_detach);
201/** 201/**
202 * mipi_dsi_dcs_write - send DCS write command 202 * mipi_dsi_dcs_write - send DCS write command
203 * @dsi: DSI device 203 * @dsi: DSI device
204 * @channel: virtual channel
205 * @data: pointer to the command followed by parameters 204 * @data: pointer to the command followed by parameters
206 * @len: length of @data 205 * @len: length of @data
207 */ 206 */
208ssize_t mipi_dsi_dcs_write(struct mipi_dsi_device *dsi, unsigned int channel, 207ssize_t mipi_dsi_dcs_write(struct mipi_dsi_device *dsi, const void *data,
209 const void *data, size_t len) 208 size_t len)
210{ 209{
211 const struct mipi_dsi_host_ops *ops = dsi->host->ops; 210 const struct mipi_dsi_host_ops *ops = dsi->host->ops;
212 struct mipi_dsi_msg msg = { 211 struct mipi_dsi_msg msg = {
213 .channel = channel, 212 .channel = dsi->channel,
214 .tx_buf = data, 213 .tx_buf = data,
215 .tx_len = len 214 .tx_len = len
216 }; 215 };
@@ -239,19 +238,18 @@ EXPORT_SYMBOL(mipi_dsi_dcs_write);
239/** 238/**
240 * mipi_dsi_dcs_read - send DCS read request command 239 * mipi_dsi_dcs_read - send DCS read request command
241 * @dsi: DSI device 240 * @dsi: DSI device
242 * @channel: virtual channel
243 * @cmd: DCS read command 241 * @cmd: DCS read command
244 * @data: pointer to read buffer 242 * @data: pointer to read buffer
245 * @len: length of @data 243 * @len: length of @data
246 * 244 *
247 * Function returns number of read bytes or error code. 245 * Function returns number of read bytes or error code.
248 */ 246 */
249ssize_t mipi_dsi_dcs_read(struct mipi_dsi_device *dsi, unsigned int channel, 247ssize_t mipi_dsi_dcs_read(struct mipi_dsi_device *dsi, u8 cmd, void *data,
250 u8 cmd, void *data, size_t len) 248 size_t len)
251{ 249{
252 const struct mipi_dsi_host_ops *ops = dsi->host->ops; 250 const struct mipi_dsi_host_ops *ops = dsi->host->ops;
253 struct mipi_dsi_msg msg = { 251 struct mipi_dsi_msg msg = {
254 .channel = channel, 252 .channel = dsi->channel,
255 .type = MIPI_DSI_DCS_READ, 253 .type = MIPI_DSI_DCS_READ,
256 .tx_buf = &cmd, 254 .tx_buf = &cmd,
257 .tx_len = 1, 255 .tx_len = 1,
diff --git a/drivers/gpu/drm/panel/panel-s6e8aa0.c b/drivers/gpu/drm/panel/panel-s6e8aa0.c
index beb43492b649..5502ef6bc074 100644
--- a/drivers/gpu/drm/panel/panel-s6e8aa0.c
+++ b/drivers/gpu/drm/panel/panel-s6e8aa0.c
@@ -138,7 +138,7 @@ static void s6e8aa0_dcs_write(struct s6e8aa0 *ctx, const void *data, size_t len)
138 if (ctx->error < 0) 138 if (ctx->error < 0)
139 return; 139 return;
140 140
141 ret = mipi_dsi_dcs_write(dsi, dsi->channel, data, len); 141 ret = mipi_dsi_dcs_write(dsi, data, len);
142 if (ret < 0) { 142 if (ret < 0) {
143 dev_err(ctx->dev, "error %zd writing dcs seq: %*ph\n", ret, len, 143 dev_err(ctx->dev, "error %zd writing dcs seq: %*ph\n", ret, len,
144 data); 144 data);
@@ -154,7 +154,7 @@ static int s6e8aa0_dcs_read(struct s6e8aa0 *ctx, u8 cmd, void *data, size_t len)
154 if (ctx->error < 0) 154 if (ctx->error < 0)
155 return ctx->error; 155 return ctx->error;
156 156
157 ret = mipi_dsi_dcs_read(dsi, dsi->channel, cmd, data, len); 157 ret = mipi_dsi_dcs_read(dsi, cmd, data, len);
158 if (ret < 0) { 158 if (ret < 0) {
159 dev_err(ctx->dev, "error %d reading dcs seq(%#x)\n", ret, cmd); 159 dev_err(ctx->dev, "error %d reading dcs seq(%#x)\n", ret, cmd);
160 ctx->error = ret; 160 ctx->error = ret;
diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
index 4b0112781910..7b5e1a9244e1 100644
--- a/include/drm/drm_mipi_dsi.h
+++ b/include/drm/drm_mipi_dsi.h
@@ -127,10 +127,10 @@ struct mipi_dsi_device {
127 127
128int mipi_dsi_attach(struct mipi_dsi_device *dsi); 128int mipi_dsi_attach(struct mipi_dsi_device *dsi);
129int mipi_dsi_detach(struct mipi_dsi_device *dsi); 129int mipi_dsi_detach(struct mipi_dsi_device *dsi);
130ssize_t mipi_dsi_dcs_write(struct mipi_dsi_device *dsi, unsigned int channel, 130ssize_t mipi_dsi_dcs_write(struct mipi_dsi_device *dsi, const void *data,
131 const void *data, size_t len); 131 size_t len);
132ssize_t mipi_dsi_dcs_read(struct mipi_dsi_device *dsi, unsigned int channel, 132ssize_t mipi_dsi_dcs_read(struct mipi_dsi_device *dsi, u8 cmd, void *data,
133 u8 cmd, void *data, size_t len); 133 size_t len);
134 134
135/** 135/**
136 * struct mipi_dsi_driver - DSI driver 136 * struct mipi_dsi_driver - DSI driver