drm/sun4i: Allwinner MIPI-DSI Burst mode support
v8 cover drm/sun4i: Allwinner MIPI-DSI Burst mode support
This is next version changes for Allwinner MIPI-DSI Burst mode support.
All these changes are grabbed from previous versions[1][2] and grouped it in a proper order so-that it can help to review and merge easy.
Changes for v8:
- rebase on master
- rework on commit messages
- include drq changes from previous version
Changes for v7:
- rebase on master
- collect Merlijn Wajer Tested-by credits.
Changes for v6:
- fixed all burst mode patches as per previous version comments
- rebase on master
- update proper commit message
- dropped unneeded comments
- order the patches that make review easy
Changes for v5, v4, v3, v2:
- use proper return value for tcon0 probe
- add logic to get tcon0 divider values
- simplify timings code to support burst mode
- fix drq computation return values
- update proper commit messages
- rebase on master
[1] https://patchwork.kernel.org/cover/10792981/
[2] https://patchwork.kernel.org/cover/10686655/
Any inputs?
Jagan.
Jagan Teki (10):
drm/sun4i: sun6i_mipi_dsi: Compute burst mode loop N1 instruction
delay
drm/sun4i: sun6i_mipi_dsi: Support instruction loop selection drm/sun4i: sun6i_mipi_dsi: Setup burst mode timings drm/sun4i: sun6i_mipi_dsi: Fix TCON DRQ set bits drm/sun4i: sun6i_mipi_dsi: Simplify drq to support all modes drm/sun4i: tcon: Export get tcon0 routine
drm/sun4i: sun6i_mipi_dsi: Probe tcon0 during dsi_bind drm/sun4i: sun6i_mipi_dsi: Setup burst mode
drm/sun4i: sun6i_mipi_dsi: Enable trail_inv and trail_fill controls drm/sun4i: sun6i_mipi_dsi: Enable HBP, HSA_HSE for burst mode
drivers/gpu/drm/sun4i/sun4i_tcon.c | 3 +- drivers/gpu/drm/sun4i/sun4i_tcon.h | 1 + drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 149 ++++++++++++++++++++++--- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 1 + 4 files changed, 138 insertions(+), 16 deletions(-)
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH v8 1/10 drm/sun4i: sun6i_mipi_dsi: Compute burst mode loop N1 instruction delay
Loop N1 instruction delay varies between burst and non-burst video modes.
1) for burst mode panels it is computed based on the panel pixel clock along with horizontal sync and porch timings.
2) for non-burst mode panels, it is same as existing (50 - 1)
Reference code is available in BSP (from linux-sunxi drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c)
dsi_dev[sel]->dsi_inst_loop_num.bits.loop_n1= (panel->lcd_ht-panel->lcd_x)*(150)/(panel->lcd_dclk_freq*8) - 50; => (((mode->htotal - mode->hdisplay) * 150) /
((mode->clock / 1000) * 8)) - 50;
This patch add loop N1 computation for burst mode by simplifying existing code to support all possible modes.
--- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +19 -1
@@ -355,6 +355,24 @@ static void sun6i_dsi_inst_init(struct sun6i_dsi *dsi, SUN6I_DSI_INST_JUMP_CFG_NUM(1)); }; +static u16 sun6i_dsi_setup_inst_delay (struct sun6i_dsi *dsi, +struct drm_display_mode *mode) +{ +struct mipi_dsi_device *device = dsi->device; +u32 hsync_porch, dclk; +u16 delay; + + hsync_porch = (mode->htotal - mode->hdisplay); + dclk = (mode->clock /1000 ); + +if (device->mode_flags &MIPI_DSI_MODE_VIDEO_BURST ) + delay = ((hsync_porch *150 ) / (dclk *8 )) -50 ; +else + delay =50 -1 ; + +return delay; +} +static u16 sun6i_dsi_get_video_start_delay (struct sun6i_dsi *dsi,struct drm_display_mode *mode) {
@@ -401,7 +419,7 @@ static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi,static void sun6i_dsi_setup_inst_loop (struct sun6i_dsi *dsi,struct drm_display_mode *mode) { -u16 delay =50 -1 ; +u16 delay =sun6i_dsi_setup_inst_delay (dsi, mode); regmap_write(dsi->regs, SUN6I_DSI_INST_LOOP_NUM_REG(0), SUN6I_DSI_INST_LOOP_NUM_N0(50 - 1) |
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH v8 2/10 drm/sun4i: sun6i_mipi_dsi: Support instruction loop selection
In reply to Jagan TekiInstruction loop selection would require before writing loop number registers, so enable idle, LP11 bits on loop selection register.
Reference code available in BSP (from linux-sunxi/ drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c)
(dsi_dev[sel]->dsi_inst_loop_sel.dwval = 2<<(4*DSI_INST_ID_LP11) |
3<<(4*DSI_INST_ID_DLY);
--- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +3 -0
@@ -421,6 +421,9 @@ static void sun6i_dsi_setup_inst_loop(struct sun6i_dsi *dsi, {u16 delay =sun6i_dsi_setup_inst_delay (dsi, mode); +regmap_write (dsi->regs,SUN6I_DSI_INST_LOOP_SEL_REG , +DSI_INST_ID_HSC << (4 *DSI_INST_ID_LP11 ) | +DSI_INST_ID_HSD << (4 *DSI_INST_ID_DLY ));regmap_write (dsi->regs,SUN6I_DSI_INST_LOOP_NUM_REG (0 ),SUN6I_DSI_INST_LOOP_NUM_N0 (50 -1 ) |SUN6I_DSI_INST_LOOP_NUM_N1 (delay));
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH v8 3/10 drm/sun4i: sun6i_mipi_dsi: Setup burst mode timings
In reply to Jagan TekiBurst mode display timings are different from conventional video mode.
For burst mode most of the timings hsa, hbp, hfp, vblk are 0 and hblk is computed as (mode->hdisplay * Bpp)
This patch simply add burst mode timings without touching existing mode timings.
Reference code taken from BSP (from linux-sunxi/ drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c)
dsi_hsa = 0;dsi_hbp = 0;dsi_hact = x*dsi_pixel_bits[format]/8;dsi_hblk = dsi_hact;dsi_hfp = 0;dsi_vblk = 0;
--- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +7 -0
@@ -516,6 +516,12 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,/* Do all timing calculations up front to allocate buffer space */ +if (device->mode_flags &MIPI_DSI_MODE_VIDEO_BURST ) { + hbp = hfp = hsa = vblk =0 ; + hblk = (mode->hdisplay * Bpp); + goto alloc_buf; + } +/* * A sync period is composed of a blanking packet (4 bytes + * payload + 2 bytes) and a sync event packet (4 bytes). Its
@@ -554,6 +560,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, vblk =sun6i_dsi_get_timings_vblk (dsi, mode, hblk); +alloc_buf:/* How many bytes do we need to send all payloads? */ bytes =max_t (size_t,max (max (hfp, hblk),max (hsa, hbp)), vblk); buffer =kmalloc (bytes,GFP_KERNEL );
Signature · 6 lines
2.18.0.321.gffc6fa0e3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v8 4/10 drm/sun4i: sun6i_mipi_dsi: Fix TCON DRQ set bits
In reply to Jagan TekiTCON DRQ for non-burst DSI mode can computed based on horizontal front porch value, but the current driver trying to include sync timings along with front porch resulting wrong drq.
This patch is trying to update the drq by subtracting hsync_start with hdisplay, which is horizontal front porch.
Current code:
------------mode->hsync_end - mode->hdisplay => horizontal front porch + sync
With this patch:
----------------mode->hsync_start - mode->hdisplay => horizontal front porch
BSP code form BPI-M64-bsp is computing TCON DRQ set bits for non-burts as (from linux-sunxi/ drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c)
=> panel->lcd_ht - panel->lcd_x - panel->lcd_hbp
=> (timmings->hor_front_porch + panel->lcd_hbp + panel->lcd_x)
- panel->lcd_x - panel->hbp
=> timmings->hor_front_porch
=> mode->hsync_start - mode->hdisplay
So, update the DRQ set bits accordingly.
--- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +2 -2
@@ -402,9 +402,9 @@ static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi,struct mipi_dsi_device *device = dsi->device;u32 val =0 ; -if ((mode->hsync_end - mode->hdisplay) >20 ) { +if ((mode->hsync_start - mode->hdisplay) >20 ) {/* Maaaaaagic */ -u16 drq = (mode->hsync_end - mode->hdisplay) -20 ; +u16 drq = (mode->hsync_start - mode->hdisplay) -20 ; drq *=mipi_dsi_pixel_format_to_bpp (device->format); drq /=32 ;
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH v8 5/10 drm/sun4i: sun6i_mipi_dsi: Simplify drq to support all modes
In reply to Jagan TekiAllwinner MIPI DSI drq has enable mode bit and set bits.
1) drq for non-burst, with front porch less than 20 would need to set both enable mode bit and set bits.
2) drq for non-burst, with front porch greater or equal to 20 would not require to do any drq bit setup.
3) drq for burst mode, would only need to set enable mode bit.
This patch simplifies existing drq code by grouping into sun6i_dsi_get_drq and support all video modes.
--- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 39 ++++++++++++++++---------- 1 file changed, 24 insertions(+), 15 deletions(-)
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +24 -15
@@ -355,6 +355,28 @@ static void sun6i_dsi_inst_init(struct sun6i_dsi *dsi, SUN6I_DSI_INST_JUMP_CFG_NUM(1)); }; +static int sun6i_dsi_get_drq (struct sun6i_dsi *dsi, +struct drm_display_mode *mode) +{ +struct mipi_dsi_device *device = dsi->device; + +if (device->mode_flags &MIPI_DSI_MODE_VIDEO_BURST ) +return SUN6I_DSI_TCON_DRQ_ENABLE_MODE ; + +if ((mode->hsync_start - mode->hdisplay) >20 ) { +/* Maaaaaagic */ +u16 drq = (mode->hsync_start - mode->hdisplay) -20 ; + + drq *=mipi_dsi_pixel_format_to_bpp (device->format); + drq /=32 ; + +return (SUN6I_DSI_TCON_DRQ_ENABLE_MODE | +SUN6I_DSI_TCON_DRQ_SET (drq)); + } + +return 0 ; +} +static u16 sun6i_dsi_setup_inst_delay (struct sun6i_dsi *dsi,struct drm_display_mode *mode) {
@@ -399,21 +421,8 @@ static u16 sun6i_dsi_get_video_start_delay(struct sun6i_dsi *dsi,static void sun6i_dsi_setup_burst (struct sun6i_dsi *dsi,struct drm_display_mode *mode) { -struct mipi_dsi_device *device = dsi->device; -u32 val =0 ; - -if ((mode->hsync_start - mode->hdisplay) >20 ) { -/* Maaaaaagic */ -u16 drq = (mode->hsync_start - mode->hdisplay) -20 ; - - drq *=mipi_dsi_pixel_format_to_bpp (device->format); - drq /=32 ; - - val = (SUN6I_DSI_TCON_DRQ_ENABLE_MODE | -SUN6I_DSI_TCON_DRQ_SET (drq)); - } - -regmap_write (dsi->regs,SUN6I_DSI_TCON_DRQ_REG , val); +regmap_write (dsi->regs,SUN6I_DSI_TCON_DRQ_REG , +sun6i_dsi_get_drq (dsi, mode)); } static void sun6i_dsi_setup_inst_loop(struct sun6i_dsi *dsi,
Signature · 6 lines
2.18.0.321.gffc6fa0e3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v8 6/10 drm/sun4i: tcon: Export get tcon0 routine
In reply to Jagan TekiSometimes tcon attributes like tcon divider, clock rate etc are needed in interface drivers like DSI. So for such cases interface driver must probe the respective tcon and get the attributes.
Since tcon0 probe is already available, via sun4i_get_tcon0 function, export the same instead of probing tcon explicitly.
--- drivers/gpu/drm/sun4i/sun4i_tcon.c | 3 ++- drivers/gpu/drm/sun4i/sun4i_tcon.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/sun4i/sun4i_tcon.c +2 -1
@@ -221,7 +221,7 @@ EXPORT_SYMBOL(sun4i_tcon_enable_vblank);* are located in TCON0. This helper returns a pointer to TCON0's * sun4i_tcon structure, or NULL if not found. */ -static struct sun4i_tcon *sun4i_get_tcon0 (struct drm_device *drm) +struct sun4i_tcon *sun4i_get_tcon0 (struct drm_device *drm) {struct sun4i_drv *drv = drm->dev_private;struct sun4i_tcon *tcon;
@@ -235,6 +235,7 @@ static struct sun4i_tcon *sun4i_get_tcon0(struct drm_device *drm)return NULL ; } +EXPORT_SYMBOL (sun4i_get_tcon0);void sun4i_tcon_set_mux (struct sun4i_tcon *tcon,int channel,const struct drm_encoder *encoder)
drivers/gpu/drm/sun4i/sun4i_tcon.h +1 -0
@@ -274,6 +274,7 @@ struct sun4i_tcon {struct drm_bridge *sun4i_tcon_find_bridge (struct device_node *node);struct drm_panel *sun4i_tcon_find_panel (struct device_node *node); +struct sun4i_tcon *sun4i_get_tcon0 (struct drm_device *drm);void sun4i_tcon_enable_vblank (struct sun4i_tcon *tcon,bool enable); void sun4i_tcon_mode_set(struct sun4i_tcon *tcon, const struct drm_encoder *encoder,
Signature · 6 lines
2.18.0.321.gffc6fa0e3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v8 7/10 drm/sun4i: sun6i_mipi_dsi: Probe tcon0 during dsi_bind
In reply to Jagan TekiProbe tcon0 during dsi_bind, so-that the tcon attributes like divider value, clock rate can get whenever it need.
--- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 7 +++++++ drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 1 + 2 files changed, 8 insertions(+)
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +7 -0
@@ -25,6 +25,7 @@#include <drm/drm_probe_helper.h> #include "sun4i_drv.h" +#include "sun4i_tcon.h" #include "sun6i_mipi_dsi.h" #include <video/mipi_display.h>
@@ -996,6 +997,7 @@ static int sun6i_dsi_bind(struct device *dev, struct device *master,struct drm_device *drm = data;struct sun4i_drv *drv = drm->dev_private;struct sun6i_dsi *dsi =dev_get_drvdata (dev); +struct sun4i_tcon *tcon0 =sun4i_get_tcon0 (drm);int ret;if (!dsi->panel)
@@ -1003,6 +1005,11 @@ static int sun6i_dsi_bind(struct device *dev, struct device *master, dsi->drv = drv; +if (!tcon0) +return -EINVAL ; + + dsi->tcon = tcon0; +drm_encoder_helper_add (&dsi->encoder, &sun6i_dsi_enc_helper_funcs); ret = drm_encoder_init(drm,
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +1 -0
@@ -26,6 +26,7 @@ struct sun6i_dsi {struct device *dev;struct sun4i_drv *drv; +struct sun4i_tcon *tcon;struct mipi_dsi_device *device;struct drm_panel *panel; };
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH v8 8/10 drm/sun4i: sun6i_mipi_dsi: Setup burst mode
In reply to Jagan TekiBurst mode in DSI would require separate setup initialization with respect to conventional video mode.
Allwinner DSI controller would need below sequence to setup the burst mode.
1) configure the burst drq.
2) configure the burst line.
3) finally enable mode.
- To configure burst drq, controller would require to compute the edge0, edge1 and fill into burst mode register.
- To configure burst line, controller would require to compute the line, sync values and fill into burst line register.
- Enable burst mode, would require to enable burst mode bit in DSI control register.
Since there is no direct documentation for these computations the edge and line formulas are taken from BSP code (from linux-sunxi/ drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c)
line_num = panel->lcd_ht*dsi_pixel_bits[panel->lcd_dsi_format]/
(8*panel->lcd_dsi_lane); edge1 = sync_point+(panel->lcd_x+panel->lcd_hbp+20)* dsi_pixel_bits[panel->lcd_dsi_format] /(8*panel->lcd_dsi_lane);
edge1 = (edge1>line_num)?line_num:edge1;
edge0 = edge1+(panel->lcd_x+40)*tcon_div/8;
edge0 = (edge0>line_num)?(edge0-line_num):1;
Note: edge0 computation would require tcon0 divider and it's value is always 4 in Allwinner BSP. This patch find out the divider value at runtime by reading tcon clocks.
--- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 70 ++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 3 deletions(-)
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +67 -3
@@ -356,6 +356,41 @@ static void sun6i_dsi_inst_init(struct sun6i_dsi *dsi, SUN6I_DSI_INST_JUMP_CFG_NUM(1)); }; +static u32 sun6i_dsi_get_edge1 (struct sun6i_dsi *dsi, +struct drm_display_mode *mode,u32 sync_point) +{ +struct mipi_dsi_device *device = dsi->device; +unsigned int bpp =mipi_dsi_pixel_format_to_bpp (device->format); +u32 hact_sync_bp; + +/* Horizontal timings duration excluding front porch */ + hact_sync_bp = (mode->hdisplay + mode->htotal - mode->hsync_start); + +return (sync_point + ((hact_sync_bp +20 ) * bpp / (8 * device->lanes))); +} + +static u32 sun6i_dsi_get_edge0 (struct sun6i_dsi *dsi, +struct drm_display_mode *mode,u32 edge1) +{ +struct sun4i_tcon *tcon = dsi->tcon; +unsigned long dclk_rate, dclk_parent_rate, tcon0_div; + + dclk_rate =clk_get_rate (tcon->dclk); + dclk_parent_rate =clk_get_rate (clk_get_parent (tcon->dclk)); + tcon0_div = dclk_parent_rate / dclk_rate; + +return (edge1 + (mode->hdisplay +40 ) * tcon0_div /8 ); +} + +static u32 sun6i_dsi_get_line_num (struct sun6i_dsi *dsi, +struct drm_display_mode *mode) +{ +struct mipi_dsi_device *device = dsi->device; +unsigned int bpp =mipi_dsi_pixel_format_to_bpp (device->format); + +return (mode->htotal * bpp / (8 * device->lanes)); +} +static int sun6i_dsi_get_drq (struct sun6i_dsi *dsi,struct drm_display_mode *mode) {
@@ -422,8 +457,32 @@ static u16 sun6i_dsi_get_video_start_delay(struct sun6i_dsi *dsi,static void sun6i_dsi_setup_burst (struct sun6i_dsi *dsi,struct drm_display_mode *mode) { -regmap_write (dsi->regs,SUN6I_DSI_TCON_DRQ_REG , -sun6i_dsi_get_drq (dsi, mode)); +struct mipi_dsi_device *device = dsi->device; +u32 sync_point =40 ; +u32 line_num =sun6i_dsi_get_line_num (dsi, mode); +u32 edge1 =sun6i_dsi_get_edge1 (dsi, mode, sync_point); +u32 edge0 =sun6i_dsi_get_edge0 (dsi, mode, edge1); +u32 val; + +if (edge1 > line_num) + edge1 = line_num; + +if (edge0 > line_num) + edge0 -= line_num; +else + edge0 =1 ; + +regmap_write (dsi->regs,SUN6I_DSI_BURST_DRQ_REG , +SUN6I_DSI_BURST_DRQ_EDGE1 (edge1) | +SUN6I_DSI_BURST_DRQ_EDGE0 (edge0)); +regmap_write (dsi->regs,SUN6I_DSI_BURST_LINE_REG , +SUN6I_DSI_BURST_LINE_NUM (line_num) | +SUN6I_DSI_BURST_LINE_SYNC_POINT (sync_point)); + +/* enable burst mode */ +regmap_read (dsi->regs,SUN6I_DSI_BASIC_CTL_REG , &val); + val |=SUN6I_DSI_BASIC_CTL_VIDEO_BURST ; +regmap_write (dsi->regs,SUN6I_DSI_BASIC_CTL_REG , val); } static void sun6i_dsi_setup_inst_loop(struct sun6i_dsi *dsi,
@@ -708,7 +767,12 @@ static void sun6i_dsi_encoder_enable(struct drm_encoder *encoder)SUN6I_DSI_BASIC_CTL1_VIDEO_PRECISION | SUN6I_DSI_BASIC_CTL1_VIDEO_MODE); -sun6i_dsi_setup_burst (dsi, mode); +regmap_write (dsi->regs,SUN6I_DSI_TCON_DRQ_REG , +sun6i_dsi_get_drq (dsi, mode)); + +if (device->mode_flags &MIPI_DSI_MODE_VIDEO_BURST ) +sun6i_dsi_setup_burst (dsi, mode); +sun6i_dsi_setup_inst_loop (dsi, mode);sun6i_dsi_setup_format (dsi, mode);sun6i_dsi_setup_timings (dsi, mode);
Signature · 6 lines
2.18.0.321.gffc6fa0e3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v8 9/10 drm/sun4i: sun6i_mipi_dsi: Enable trail_inv and trail_fill controls
In reply to Jagan TekiThe burst mode panels with 4-lane would require to enable trail bits in DSI basic control register.
So, enable 2byte trail and trail_env for 4-lane burst mode devices.
Allwinner A64 BSP should also relie on same setup for enabling trail bit in DSI controller.
Reference code avialable in BSP (from linux-sunxi/ drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c)
if (panel->lcd_dsi_lane == 4)
{
dsi_dev[sel]->dsi_basic_ctl.bits.trail_inv = 0xc;
dsi_dev[sel]->dsi_basic_ctl.bits.trail_fill = 1;
}
--- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +6 -0
@@ -34,6 +34,8 @@#define SUN6I_DSI_CTL_EN BIT(0)#define SUN6I_DSI_BASIC_CTL_REG 0x00c +#define SUN6I_DSI_BASIC_CTL_TRAIL_INV (n) (((n) & 0xf) << 4) +#define SUN6I_DSI_BASIC_CTL_TRAIL_FILL BIT(3)#define SUN6I_DSI_BASIC_CTL_HBP_DIS BIT(2)#define SUN6I_DSI_BASIC_CTL_HSA_HSE_DIS BIT(1)#define SUN6I_DSI_BASIC_CTL_VIDEO_BURST BIT(0)
@@ -482,6 +484,10 @@ static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi,/* enable burst mode */ regmap_read (dsi->regs,SUN6I_DSI_BASIC_CTL_REG , &val); val |=SUN6I_DSI_BASIC_CTL_VIDEO_BURST ; +if (device->lanes ==4 ) { + val |=SUN6I_DSI_BASIC_CTL_TRAIL_INV (0xc ); + val |=SUN6I_DSI_BASIC_CTL_TRAIL_FILL ; + }regmap_write (dsi->regs,SUN6I_DSI_BASIC_CTL_REG , val); }
Signature · 1 line
2.18.0.321.gffc6fa0e3