Skip to content

Commit d6dbefb

Browse files
Kaustabh Chakrabortydaeinki
authored andcommitted
drm/bridge: samsung-dsim: allow configuring the VIDEO_MODE bit
The VIDEO_MODE bit of DSIM_CONFIG is hardcoded to BIT(25), but Exynos7870's DSIM has it in BIT(18) as per downstream kernel sources. In order to support both, move this bit value to the driver data struct and define it for every driver compatible. Reference the value from there instead, in functions wherever required. Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
1 parent 4d24412 commit d6dbefb

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

drivers/gpu/drm/bridge/samsung-dsim.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
*/
8888
#define DSIM_HSE_DISABLE_MODE BIT(23)
8989
#define DSIM_AUTO_MODE BIT(24)
90-
#define DSIM_VIDEO_MODE BIT(25)
9190
#define DSIM_BURST_MODE BIT(26)
9291
#define DSIM_SYNC_INFORM BIT(27)
9392
#define DSIM_EOT_DISABLE BIT(28)
@@ -417,6 +416,7 @@ static const struct samsung_dsim_driver_data exynos3_dsi_driver_data = {
417416
.wait_for_hdr_fifo = 1,
418417
.wait_for_reset = 1,
419418
.num_bits_resol = 11,
419+
.video_mode_bit = 25,
420420
.esc_clken_bit = 28,
421421
.byte_clken_bit = 24,
422422
.tx_req_hsclk_bit = 31,
@@ -444,6 +444,7 @@ static const struct samsung_dsim_driver_data exynos4_dsi_driver_data = {
444444
.wait_for_hdr_fifo = 1,
445445
.wait_for_reset = 1,
446446
.num_bits_resol = 11,
447+
.video_mode_bit = 25,
447448
.esc_clken_bit = 28,
448449
.byte_clken_bit = 24,
449450
.tx_req_hsclk_bit = 31,
@@ -469,6 +470,7 @@ static const struct samsung_dsim_driver_data exynos5_dsi_driver_data = {
469470
.wait_for_hdr_fifo = 1,
470471
.wait_for_reset = 1,
471472
.num_bits_resol = 11,
473+
.video_mode_bit = 25,
472474
.esc_clken_bit = 28,
473475
.byte_clken_bit = 24,
474476
.tx_req_hsclk_bit = 31,
@@ -494,6 +496,7 @@ static const struct samsung_dsim_driver_data exynos5433_dsi_driver_data = {
494496
.wait_for_hdr_fifo = 1,
495497
.wait_for_reset = 0,
496498
.num_bits_resol = 12,
499+
.video_mode_bit = 25,
497500
.esc_clken_bit = 28,
498501
.byte_clken_bit = 24,
499502
.tx_req_hsclk_bit = 31,
@@ -519,6 +522,7 @@ static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = {
519522
.wait_for_hdr_fifo = 1,
520523
.wait_for_reset = 1,
521524
.num_bits_resol = 12,
525+
.video_mode_bit = 25,
522526
.esc_clken_bit = 28,
523527
.byte_clken_bit = 24,
524528
.tx_req_hsclk_bit = 31,
@@ -544,6 +548,7 @@ static const struct samsung_dsim_driver_data imx8mm_dsi_driver_data = {
544548
.wait_for_hdr_fifo = 1,
545549
.wait_for_reset = 0,
546550
.num_bits_resol = 12,
551+
.video_mode_bit = 25,
547552
.esc_clken_bit = 28,
548553
.byte_clken_bit = 24,
549554
.tx_req_hsclk_bit = 31,
@@ -952,7 +957,7 @@ static int samsung_dsim_init_link(struct samsung_dsim *dsi)
952957
* mode, otherwise it will support command mode.
953958
*/
954959
if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO) {
955-
reg |= DSIM_VIDEO_MODE;
960+
reg |= BIT(driver_data->video_mode_bit);
956961

957962
/*
958963
* The user manual describes that following bits are ignored in

include/drm/bridge/samsung-dsim.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ struct samsung_dsim_driver_data {
6464
unsigned int wait_for_hdr_fifo;
6565
unsigned int wait_for_reset;
6666
unsigned int num_bits_resol;
67+
unsigned int video_mode_bit;
6768
unsigned int esc_clken_bit;
6869
unsigned int byte_clken_bit;
6970
unsigned int tx_req_hsclk_bit;

0 commit comments

Comments
 (0)