aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/panel/panel-s6e8aa0.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/panel/panel-s6e8aa0.c')
-rw-r--r--drivers/gpu/drm/panel/panel-s6e8aa0.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/drivers/gpu/drm/panel/panel-s6e8aa0.c b/drivers/gpu/drm/panel/panel-s6e8aa0.c
index b5217fe37f02..144b2733e3d7 100644
--- a/drivers/gpu/drm/panel/panel-s6e8aa0.c
+++ b/drivers/gpu/drm/panel/panel-s6e8aa0.c
@@ -141,10 +141,10 @@ static void s6e8aa0_dcs_write(struct s6e8aa0 *ctx, const void *data, size_t len)
141 if (ctx->error < 0) 141 if (ctx->error < 0)
142 return; 142 return;
143 143
144 ret = mipi_dsi_dcs_write(dsi, data, len); 144 ret = mipi_dsi_dcs_write_buffer(dsi, data, len);
145 if (ret < 0) { 145 if (ret < 0) {
146 dev_err(ctx->dev, "error %zd writing dcs seq: %*ph\n", ret, len, 146 dev_err(ctx->dev, "error %zd writing dcs seq: %*ph\n", ret,
147 data); 147 (int)len, data);
148 ctx->error = ret; 148 ctx->error = ret;
149 } 149 }
150} 150}
@@ -800,27 +800,15 @@ static void s6e8aa0_panel_init(struct s6e8aa0 *ctx)
800} 800}
801 801
802static void s6e8aa0_set_maximum_return_packet_size(struct s6e8aa0 *ctx, 802static void s6e8aa0_set_maximum_return_packet_size(struct s6e8aa0 *ctx,
803 int size) 803 u16 size)
804{ 804{
805 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); 805 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
806 const struct mipi_dsi_host_ops *ops = dsi->host->ops;
807 u8 buf[] = {size, 0};
808 struct mipi_dsi_msg msg = {
809 .channel = dsi->channel,
810 .type = MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE,
811 .tx_len = sizeof(buf),
812 .tx_buf = buf
813 };
814 int ret; 806 int ret;
815 807
816 if (ctx->error < 0) 808 if (ctx->error < 0)
817 return; 809 return;
818 810
819 if (!ops || !ops->transfer) 811 ret = mipi_dsi_set_maximum_return_packet_size(dsi, size);
820 ret = -EIO;
821 else
822 ret = ops->transfer(dsi->host, &msg);
823
824 if (ret < 0) { 812 if (ret < 0) {
825 dev_err(ctx->dev, 813 dev_err(ctx->dev,
826 "error %d setting maximum return packet size to %d\n", 814 "error %d setting maximum return packet size to %d\n",
@@ -1019,17 +1007,12 @@ static int s6e8aa0_probe(struct mipi_dsi_device *dsi)
1019 return ret; 1007 return ret;
1020 } 1008 }
1021 1009
1022 ctx->reset_gpio = devm_gpiod_get(dev, "reset"); 1010 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
1023 if (IS_ERR(ctx->reset_gpio)) { 1011 if (IS_ERR(ctx->reset_gpio)) {
1024 dev_err(dev, "cannot get reset-gpios %ld\n", 1012 dev_err(dev, "cannot get reset-gpios %ld\n",
1025 PTR_ERR(ctx->reset_gpio)); 1013 PTR_ERR(ctx->reset_gpio));
1026 return PTR_ERR(ctx->reset_gpio); 1014 return PTR_ERR(ctx->reset_gpio);
1027 } 1015 }
1028 ret = gpiod_direction_output(ctx->reset_gpio, 1);
1029 if (ret < 0) {
1030 dev_err(dev, "cannot configure reset-gpios %d\n", ret);
1031 return ret;
1032 }
1033 1016
1034 ctx->brightness = GAMMA_LEVEL_NUM - 1; 1017 ctx->brightness = GAMMA_LEVEL_NUM - 1;
1035 1018
@@ -1069,7 +1052,6 @@ static struct mipi_dsi_driver s6e8aa0_driver = {
1069 .remove = s6e8aa0_remove, 1052 .remove = s6e8aa0_remove,
1070 .driver = { 1053 .driver = {
1071 .name = "panel_s6e8aa0", 1054 .name = "panel_s6e8aa0",
1072 .owner = THIS_MODULE,
1073 .of_match_table = s6e8aa0_of_match, 1055 .of_match_table = s6e8aa0_of_match,
1074 }, 1056 },
1075}; 1057};