aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/exynos/exynos_hdmi.c167
-rw-r--r--drivers/gpu/drm/exynos/regs-hdmi.h182
2 files changed, 349 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 3583a7bdac24..575a8cbd3533 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -1319,6 +1319,169 @@ static struct exynos_hdmi_display_ops display_ops = {
1319 .power_on = hdmi_display_power_on, 1319 .power_on = hdmi_display_power_on,
1320}; 1320};
1321 1321
1322static void hdmi_set_acr(u32 freq, u8 *acr)
1323{
1324 u32 n, cts;
1325
1326 switch (freq) {
1327 case 32000:
1328 n = 4096;
1329 cts = 27000;
1330 break;
1331 case 44100:
1332 n = 6272;
1333 cts = 30000;
1334 break;
1335 case 88200:
1336 n = 12544;
1337 cts = 30000;
1338 break;
1339 case 176400:
1340 n = 25088;
1341 cts = 30000;
1342 break;
1343 case 48000:
1344 n = 6144;
1345 cts = 27000;
1346 break;
1347 case 96000:
1348 n = 12288;
1349 cts = 27000;
1350 break;
1351 case 192000:
1352 n = 24576;
1353 cts = 27000;
1354 break;
1355 default:
1356 n = 0;
1357 cts = 0;
1358 break;
1359 }
1360
1361 acr[1] = cts >> 16;
1362 acr[2] = cts >> 8 & 0xff;
1363 acr[3] = cts & 0xff;
1364
1365 acr[4] = n >> 16;
1366 acr[5] = n >> 8 & 0xff;
1367 acr[6] = n & 0xff;
1368}
1369
1370static void hdmi_reg_acr(struct hdmi_context *hdata, u8 *acr)
1371{
1372 hdmi_reg_writeb(hdata, HDMI_ACR_N0, acr[6]);
1373 hdmi_reg_writeb(hdata, HDMI_ACR_N1, acr[5]);
1374 hdmi_reg_writeb(hdata, HDMI_ACR_N2, acr[4]);
1375 hdmi_reg_writeb(hdata, HDMI_ACR_MCTS0, acr[3]);
1376 hdmi_reg_writeb(hdata, HDMI_ACR_MCTS1, acr[2]);
1377 hdmi_reg_writeb(hdata, HDMI_ACR_MCTS2, acr[1]);
1378 hdmi_reg_writeb(hdata, HDMI_ACR_CTS0, acr[3]);
1379 hdmi_reg_writeb(hdata, HDMI_ACR_CTS1, acr[2]);
1380 hdmi_reg_writeb(hdata, HDMI_ACR_CTS2, acr[1]);
1381
1382 if (hdata->is_v13)
1383 hdmi_reg_writeb(hdata, HDMI_V13_ACR_CON, 4);
1384 else
1385 hdmi_reg_writeb(hdata, HDMI_ACR_CON, 4);
1386}
1387
1388static void hdmi_audio_init(struct hdmi_context *hdata)
1389{
1390 u32 sample_rate, bits_per_sample, frame_size_code;
1391 u32 data_num, bit_ch, sample_frq;
1392 u32 val;
1393 u8 acr[7];
1394
1395 sample_rate = 44100;
1396 bits_per_sample = 16;
1397 frame_size_code = 0;
1398
1399 switch (bits_per_sample) {
1400 case 20:
1401 data_num = 2;
1402 bit_ch = 1;
1403 break;
1404 case 24:
1405 data_num = 3;
1406 bit_ch = 1;
1407 break;
1408 default:
1409 data_num = 1;
1410 bit_ch = 0;
1411 break;
1412 }
1413
1414 hdmi_set_acr(sample_rate, acr);
1415 hdmi_reg_acr(hdata, acr);
1416
1417 hdmi_reg_writeb(hdata, HDMI_I2S_MUX_CON, HDMI_I2S_IN_DISABLE
1418 | HDMI_I2S_AUD_I2S | HDMI_I2S_CUV_I2S_ENABLE
1419 | HDMI_I2S_MUX_ENABLE);
1420
1421 hdmi_reg_writeb(hdata, HDMI_I2S_MUX_CH, HDMI_I2S_CH0_EN
1422 | HDMI_I2S_CH1_EN | HDMI_I2S_CH2_EN);
1423
1424 hdmi_reg_writeb(hdata, HDMI_I2S_MUX_CUV, HDMI_I2S_CUV_RL_EN);
1425
1426 sample_frq = (sample_rate == 44100) ? 0 :
1427 (sample_rate == 48000) ? 2 :
1428 (sample_rate == 32000) ? 3 :
1429 (sample_rate == 96000) ? 0xa : 0x0;
1430
1431 hdmi_reg_writeb(hdata, HDMI_I2S_CLK_CON, HDMI_I2S_CLK_DIS);
1432 hdmi_reg_writeb(hdata, HDMI_I2S_CLK_CON, HDMI_I2S_CLK_EN);
1433
1434 val = hdmi_reg_read(hdata, HDMI_I2S_DSD_CON) | 0x01;
1435 hdmi_reg_writeb(hdata, HDMI_I2S_DSD_CON, val);
1436
1437 /* Configuration I2S input ports. Configure I2S_PIN_SEL_0~4 */
1438 hdmi_reg_writeb(hdata, HDMI_I2S_PIN_SEL_0, HDMI_I2S_SEL_SCLK(5)
1439 | HDMI_I2S_SEL_LRCK(6));
1440 hdmi_reg_writeb(hdata, HDMI_I2S_PIN_SEL_1, HDMI_I2S_SEL_SDATA1(1)
1441 | HDMI_I2S_SEL_SDATA2(4));
1442 hdmi_reg_writeb(hdata, HDMI_I2S_PIN_SEL_2, HDMI_I2S_SEL_SDATA3(1)
1443 | HDMI_I2S_SEL_SDATA2(2));
1444 hdmi_reg_writeb(hdata, HDMI_I2S_PIN_SEL_3, HDMI_I2S_SEL_DSD(0));
1445
1446 /* I2S_CON_1 & 2 */
1447 hdmi_reg_writeb(hdata, HDMI_I2S_CON_1, HDMI_I2S_SCLK_FALLING_EDGE
1448 | HDMI_I2S_L_CH_LOW_POL);
1449 hdmi_reg_writeb(hdata, HDMI_I2S_CON_2, HDMI_I2S_MSB_FIRST_MODE
1450 | HDMI_I2S_SET_BIT_CH(bit_ch)
1451 | HDMI_I2S_SET_SDATA_BIT(data_num)
1452 | HDMI_I2S_BASIC_FORMAT);
1453
1454 /* Configure register related to CUV information */
1455 hdmi_reg_writeb(hdata, HDMI_I2S_CH_ST_0, HDMI_I2S_CH_STATUS_MODE_0
1456 | HDMI_I2S_2AUD_CH_WITHOUT_PREEMPH
1457 | HDMI_I2S_COPYRIGHT
1458 | HDMI_I2S_LINEAR_PCM
1459 | HDMI_I2S_CONSUMER_FORMAT);
1460 hdmi_reg_writeb(hdata, HDMI_I2S_CH_ST_1, HDMI_I2S_CD_PLAYER);
1461 hdmi_reg_writeb(hdata, HDMI_I2S_CH_ST_2, HDMI_I2S_SET_SOURCE_NUM(0));
1462 hdmi_reg_writeb(hdata, HDMI_I2S_CH_ST_3, HDMI_I2S_CLK_ACCUR_LEVEL_2
1463 | HDMI_I2S_SET_SMP_FREQ(sample_frq));
1464 hdmi_reg_writeb(hdata, HDMI_I2S_CH_ST_4,
1465 HDMI_I2S_ORG_SMP_FREQ_44_1
1466 | HDMI_I2S_WORD_LEN_MAX24_24BITS
1467 | HDMI_I2S_WORD_LEN_MAX_24BITS);
1468
1469 hdmi_reg_writeb(hdata, HDMI_I2S_CH_ST_CON, HDMI_I2S_CH_STATUS_RELOAD);
1470}
1471
1472static void hdmi_audio_control(struct hdmi_context *hdata, bool onoff)
1473{
1474 u32 mod;
1475
1476 mod = hdmi_reg_read(hdata, HDMI_MODE_SEL);
1477 if (mod & HDMI_DVI_MODE_EN)
1478 return;
1479
1480 hdmi_reg_writeb(hdata, HDMI_AUI_CON, onoff ? 2 : 0);
1481 hdmi_reg_writemask(hdata, HDMI_CON_0, onoff ?
1482 HDMI_ASP_EN : HDMI_ASP_DIS, HDMI_ASP_MASK);
1483}
1484
1322static void hdmi_conf_reset(struct hdmi_context *hdata) 1485static void hdmi_conf_reset(struct hdmi_context *hdata)
1323{ 1486{
1324 u32 reg; 1487 u32 reg;
@@ -1737,9 +1900,11 @@ static void hdmi_conf_apply(struct hdmi_context *hdata)
1737 1900
1738 hdmi_conf_reset(hdata); 1901 hdmi_conf_reset(hdata);
1739 hdmi_conf_init(hdata); 1902 hdmi_conf_init(hdata);
1903 hdmi_audio_init(hdata);
1740 1904
1741 /* setting core registers */ 1905 /* setting core registers */
1742 hdmi_timing_apply(hdata); 1906 hdmi_timing_apply(hdata);
1907 hdmi_audio_control(hdata, true);
1743 1908
1744 hdmi_regs_dump(hdata, "start"); 1909 hdmi_regs_dump(hdata, "start");
1745} 1910}
@@ -1825,6 +1990,7 @@ static void hdmi_disable(void *ctx)
1825 DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); 1990 DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
1826 1991
1827 if (hdata->enabled) { 1992 if (hdata->enabled) {
1993 hdmi_audio_control(hdata, false);
1828 hdmiphy_conf_reset(hdata); 1994 hdmiphy_conf_reset(hdata);
1829 hdmi_conf_reset(hdata); 1995 hdmi_conf_reset(hdata);
1830 } 1996 }
@@ -1983,6 +2149,7 @@ static void hdmi_resource_poweron(struct hdmi_context *hdata)
1983 hdmiphy_conf_reset(hdata); 2149 hdmiphy_conf_reset(hdata);
1984 hdmi_conf_reset(hdata); 2150 hdmi_conf_reset(hdata);
1985 hdmi_conf_init(hdata); 2151 hdmi_conf_init(hdata);
2152 hdmi_audio_init(hdata);
1986} 2153}
1987 2154
1988static void hdmi_resource_poweroff(struct hdmi_context *hdata) 2155static void hdmi_resource_poweroff(struct hdmi_context *hdata)
diff --git a/drivers/gpu/drm/exynos/regs-hdmi.h b/drivers/gpu/drm/exynos/regs-hdmi.h
index 6b287158f76e..3c04bea842ce 100644
--- a/drivers/gpu/drm/exynos/regs-hdmi.h
+++ b/drivers/gpu/drm/exynos/regs-hdmi.h
@@ -22,6 +22,7 @@
22/* HDMI Version 1.3 & Common */ 22/* HDMI Version 1.3 & Common */
23#define HDMI_CTRL_BASE(x) ((x) + 0x00000000) 23#define HDMI_CTRL_BASE(x) ((x) + 0x00000000)
24#define HDMI_CORE_BASE(x) ((x) + 0x00010000) 24#define HDMI_CORE_BASE(x) ((x) + 0x00010000)
25#define HDMI_I2S_BASE(x) ((x) + 0x00040000)
25#define HDMI_TG_BASE(x) ((x) + 0x00050000) 26#define HDMI_TG_BASE(x) ((x) + 0x00050000)
26 27
27/* Control registers */ 28/* Control registers */
@@ -132,6 +133,9 @@
132 133
133/* HDMI_CON_0 */ 134/* HDMI_CON_0 */
134#define HDMI_BLUE_SCR_EN (1 << 5) 135#define HDMI_BLUE_SCR_EN (1 << 5)
136#define HDMI_ASP_EN (1 << 2)
137#define HDMI_ASP_DIS (0 << 2)
138#define HDMI_ASP_MASK (1 << 2)
135#define HDMI_EN (1 << 0) 139#define HDMI_EN (1 << 0)
136 140
137/* HDMI_PHY_STATUS */ 141/* HDMI_PHY_STATUS */
@@ -140,6 +144,8 @@
140/* HDMI_MODE_SEL */ 144/* HDMI_MODE_SEL */
141#define HDMI_MODE_HDMI_EN (1 << 1) 145#define HDMI_MODE_HDMI_EN (1 << 1)
142#define HDMI_MODE_DVI_EN (1 << 0) 146#define HDMI_MODE_DVI_EN (1 << 0)
147#define HDMI_DVI_MODE_EN (1)
148#define HDMI_DVI_MODE_DIS (0)
143#define HDMI_MODE_MASK (3 << 0) 149#define HDMI_MODE_MASK (3 << 0)
144 150
145/* HDMI_TG_CMD */ 151/* HDMI_TG_CMD */
@@ -268,6 +274,9 @@
268#define HDMI_ACR_MCTS0 HDMI_CORE_BASE(0x0410) 274#define HDMI_ACR_MCTS0 HDMI_CORE_BASE(0x0410)
269#define HDMI_ACR_MCTS1 HDMI_CORE_BASE(0x0414) 275#define HDMI_ACR_MCTS1 HDMI_CORE_BASE(0x0414)
270#define HDMI_ACR_MCTS2 HDMI_CORE_BASE(0x0418) 276#define HDMI_ACR_MCTS2 HDMI_CORE_BASE(0x0418)
277#define HDMI_ACR_CTS0 HDMI_CORE_BASE(0x0420)
278#define HDMI_ACR_CTS1 HDMI_CORE_BASE(0x0424)
279#define HDMI_ACR_CTS2 HDMI_CORE_BASE(0x0428)
271#define HDMI_ACR_N0 HDMI_CORE_BASE(0x0430) 280#define HDMI_ACR_N0 HDMI_CORE_BASE(0x0430)
272#define HDMI_ACR_N1 HDMI_CORE_BASE(0x0434) 281#define HDMI_ACR_N1 HDMI_CORE_BASE(0x0434)
273#define HDMI_ACR_N2 HDMI_CORE_BASE(0x0438) 282#define HDMI_ACR_N2 HDMI_CORE_BASE(0x0438)
@@ -368,6 +377,179 @@
368#define HDMI_BLUE_SCREEN_R_0 HDMI_CORE_BASE(0xD530) 377#define HDMI_BLUE_SCREEN_R_0 HDMI_CORE_BASE(0xD530)
369#define HDMI_BLUE_SCREEN_R_1 HDMI_CORE_BASE(0xD534) 378#define HDMI_BLUE_SCREEN_R_1 HDMI_CORE_BASE(0xD534)
370 379
380/* HDMI I2S register */
381#define HDMI_I2S_CLK_CON HDMI_I2S_BASE(0x000)
382#define HDMI_I2S_CON_1 HDMI_I2S_BASE(0x004)
383#define HDMI_I2S_CON_2 HDMI_I2S_BASE(0x008)
384#define HDMI_I2S_PIN_SEL_0 HDMI_I2S_BASE(0x00c)
385#define HDMI_I2S_PIN_SEL_1 HDMI_I2S_BASE(0x010)
386#define HDMI_I2S_PIN_SEL_2 HDMI_I2S_BASE(0x014)
387#define HDMI_I2S_PIN_SEL_3 HDMI_I2S_BASE(0x018)
388#define HDMI_I2S_DSD_CON HDMI_I2S_BASE(0x01c)
389#define HDMI_I2S_MUX_CON HDMI_I2S_BASE(0x020)
390#define HDMI_I2S_CH_ST_CON HDMI_I2S_BASE(0x024)
391#define HDMI_I2S_CH_ST_0 HDMI_I2S_BASE(0x028)
392#define HDMI_I2S_CH_ST_1 HDMI_I2S_BASE(0x02c)
393#define HDMI_I2S_CH_ST_2 HDMI_I2S_BASE(0x030)
394#define HDMI_I2S_CH_ST_3 HDMI_I2S_BASE(0x034)
395#define HDMI_I2S_CH_ST_4 HDMI_I2S_BASE(0x038)
396#define HDMI_I2S_CH_ST_SH_0 HDMI_I2S_BASE(0x03c)
397#define HDMI_I2S_CH_ST_SH_1 HDMI_I2S_BASE(0x040)
398#define HDMI_I2S_CH_ST_SH_2 HDMI_I2S_BASE(0x044)
399#define HDMI_I2S_CH_ST_SH_3 HDMI_I2S_BASE(0x048)
400#define HDMI_I2S_CH_ST_SH_4 HDMI_I2S_BASE(0x04c)
401#define HDMI_I2S_MUX_CH HDMI_I2S_BASE(0x054)
402#define HDMI_I2S_MUX_CUV HDMI_I2S_BASE(0x058)
403
404/* I2S bit definition */
405
406/* I2S_CLK_CON */
407#define HDMI_I2S_CLK_DIS (0)
408#define HDMI_I2S_CLK_EN (1)
409
410/* I2S_CON_1 */
411#define HDMI_I2S_SCLK_FALLING_EDGE (0 << 1)
412#define HDMI_I2S_SCLK_RISING_EDGE (1 << 1)
413#define HDMI_I2S_L_CH_LOW_POL (0)
414#define HDMI_I2S_L_CH_HIGH_POL (1)
415
416/* I2S_CON_2 */
417#define HDMI_I2S_MSB_FIRST_MODE (0 << 6)
418#define HDMI_I2S_LSB_FIRST_MODE (1 << 6)
419#define HDMI_I2S_BIT_CH_32FS (0 << 4)
420#define HDMI_I2S_BIT_CH_48FS (1 << 4)
421#define HDMI_I2S_BIT_CH_RESERVED (2 << 4)
422#define HDMI_I2S_SDATA_16BIT (1 << 2)
423#define HDMI_I2S_SDATA_20BIT (2 << 2)
424#define HDMI_I2S_SDATA_24BIT (3 << 2)
425#define HDMI_I2S_BASIC_FORMAT (0)
426#define HDMI_I2S_L_JUST_FORMAT (2)
427#define HDMI_I2S_R_JUST_FORMAT (3)
428#define HDMI_I2S_CON_2_CLR (~(0xFF))
429#define HDMI_I2S_SET_BIT_CH(x) (((x) & 0x7) << 4)
430#define HDMI_I2S_SET_SDATA_BIT(x) (((x) & 0x7) << 2)
431
432/* I2S_PIN_SEL_0 */
433#define HDMI_I2S_SEL_SCLK(x) (((x) & 0x7) << 4)
434#define HDMI_I2S_SEL_LRCK(x) ((x) & 0x7)
435
436/* I2S_PIN_SEL_1 */
437#define HDMI_I2S_SEL_SDATA1(x) (((x) & 0x7) << 4)
438#define HDMI_I2S_SEL_SDATA2(x) ((x) & 0x7)
439
440/* I2S_PIN_SEL_2 */
441#define HDMI_I2S_SEL_SDATA3(x) (((x) & 0x7) << 4)
442#define HDMI_I2S_SEL_SDATA2(x) ((x) & 0x7)
443
444/* I2S_PIN_SEL_3 */
445#define HDMI_I2S_SEL_DSD(x) ((x) & 0x7)
446
447/* I2S_DSD_CON */
448#define HDMI_I2S_DSD_CLK_RI_EDGE (1 << 1)
449#define HDMI_I2S_DSD_CLK_FA_EDGE (0 << 1)
450#define HDMI_I2S_DSD_ENABLE (1)
451#define HDMI_I2S_DSD_DISABLE (0)
452
453/* I2S_MUX_CON */
454#define HDMI_I2S_NOISE_FILTER_ZERO (0 << 5)
455#define HDMI_I2S_NOISE_FILTER_2_STAGE (1 << 5)
456#define HDMI_I2S_NOISE_FILTER_3_STAGE (2 << 5)
457#define HDMI_I2S_NOISE_FILTER_4_STAGE (3 << 5)
458#define HDMI_I2S_NOISE_FILTER_5_STAGE (4 << 5)
459#define HDMI_I2S_IN_DISABLE (1 << 4)
460#define HDMI_I2S_IN_ENABLE (0 << 4)
461#define HDMI_I2S_AUD_SPDIF (0 << 2)
462#define HDMI_I2S_AUD_I2S (1 << 2)
463#define HDMI_I2S_AUD_DSD (2 << 2)
464#define HDMI_I2S_CUV_SPDIF_ENABLE (0 << 1)
465#define HDMI_I2S_CUV_I2S_ENABLE (1 << 1)
466#define HDMI_I2S_MUX_DISABLE (0)
467#define HDMI_I2S_MUX_ENABLE (1)
468#define HDMI_I2S_MUX_CON_CLR (~(0xFF))
469
470/* I2S_CH_ST_CON */
471#define HDMI_I2S_CH_STATUS_RELOAD (1)
472#define HDMI_I2S_CH_ST_CON_CLR (~(1))
473
474/* I2S_CH_ST_0 / I2S_CH_ST_SH_0 */
475#define HDMI_I2S_CH_STATUS_MODE_0 (0 << 6)
476#define HDMI_I2S_2AUD_CH_WITHOUT_PREEMPH (0 << 3)
477#define HDMI_I2S_2AUD_CH_WITH_PREEMPH (1 << 3)
478#define HDMI_I2S_DEFAULT_EMPHASIS (0 << 3)
479#define HDMI_I2S_COPYRIGHT (0 << 2)
480#define HDMI_I2S_NO_COPYRIGHT (1 << 2)
481#define HDMI_I2S_LINEAR_PCM (0 << 1)
482#define HDMI_I2S_NO_LINEAR_PCM (1 << 1)
483#define HDMI_I2S_CONSUMER_FORMAT (0)
484#define HDMI_I2S_PROF_FORMAT (1)
485#define HDMI_I2S_CH_ST_0_CLR (~(0xFF))
486
487/* I2S_CH_ST_1 / I2S_CH_ST_SH_1 */
488#define HDMI_I2S_CD_PLAYER (0x00)
489#define HDMI_I2S_DAT_PLAYER (0x03)
490#define HDMI_I2S_DCC_PLAYER (0x43)
491#define HDMI_I2S_MINI_DISC_PLAYER (0x49)
492
493/* I2S_CH_ST_2 / I2S_CH_ST_SH_2 */
494#define HDMI_I2S_CHANNEL_NUM_MASK (0xF << 4)
495#define HDMI_I2S_SOURCE_NUM_MASK (0xF)
496#define HDMI_I2S_SET_CHANNEL_NUM(x) (((x) & (0xF)) << 4)
497#define HDMI_I2S_SET_SOURCE_NUM(x) ((x) & (0xF))
498
499/* I2S_CH_ST_3 / I2S_CH_ST_SH_3 */
500#define HDMI_I2S_CLK_ACCUR_LEVEL_1 (1 << 4)
501#define HDMI_I2S_CLK_ACCUR_LEVEL_2 (0 << 4)
502#define HDMI_I2S_CLK_ACCUR_LEVEL_3 (2 << 4)
503#define HDMI_I2S_SMP_FREQ_44_1 (0x0)
504#define HDMI_I2S_SMP_FREQ_48 (0x2)
505#define HDMI_I2S_SMP_FREQ_32 (0x3)
506#define HDMI_I2S_SMP_FREQ_96 (0xA)
507#define HDMI_I2S_SET_SMP_FREQ(x) ((x) & (0xF))
508
509/* I2S_CH_ST_4 / I2S_CH_ST_SH_4 */
510#define HDMI_I2S_ORG_SMP_FREQ_44_1 (0xF << 4)
511#define HDMI_I2S_ORG_SMP_FREQ_88_2 (0x7 << 4)
512#define HDMI_I2S_ORG_SMP_FREQ_22_05 (0xB << 4)
513#define HDMI_I2S_ORG_SMP_FREQ_176_4 (0x3 << 4)
514#define HDMI_I2S_WORD_LEN_NOT_DEFINE (0x0 << 1)
515#define HDMI_I2S_WORD_LEN_MAX24_20BITS (0x1 << 1)
516#define HDMI_I2S_WORD_LEN_MAX24_22BITS (0x2 << 1)
517#define HDMI_I2S_WORD_LEN_MAX24_23BITS (0x4 << 1)
518#define HDMI_I2S_WORD_LEN_MAX24_24BITS (0x5 << 1)
519#define HDMI_I2S_WORD_LEN_MAX24_21BITS (0x6 << 1)
520#define HDMI_I2S_WORD_LEN_MAX20_16BITS (0x1 << 1)
521#define HDMI_I2S_WORD_LEN_MAX20_18BITS (0x2 << 1)
522#define HDMI_I2S_WORD_LEN_MAX20_19BITS (0x4 << 1)
523#define HDMI_I2S_WORD_LEN_MAX20_20BITS (0x5 << 1)
524#define HDMI_I2S_WORD_LEN_MAX20_17BITS (0x6 << 1)
525#define HDMI_I2S_WORD_LEN_MAX_24BITS (1)
526#define HDMI_I2S_WORD_LEN_MAX_20BITS (0)
527
528/* I2S_MUX_CH */
529#define HDMI_I2S_CH3_R_EN (1 << 7)
530#define HDMI_I2S_CH3_L_EN (1 << 6)
531#define HDMI_I2S_CH3_EN (3 << 6)
532#define HDMI_I2S_CH2_R_EN (1 << 5)
533#define HDMI_I2S_CH2_L_EN (1 << 4)
534#define HDMI_I2S_CH2_EN (3 << 4)
535#define HDMI_I2S_CH1_R_EN (1 << 3)
536#define HDMI_I2S_CH1_L_EN (1 << 2)
537#define HDMI_I2S_CH1_EN (3 << 2)
538#define HDMI_I2S_CH0_R_EN (1 << 1)
539#define HDMI_I2S_CH0_L_EN (1)
540#define HDMI_I2S_CH0_EN (3)
541#define HDMI_I2S_CH_ALL_EN (0xFF)
542#define HDMI_I2S_MUX_CH_CLR (~HDMI_I2S_CH_ALL_EN)
543
544/* I2S_MUX_CUV */
545#define HDMI_I2S_CUV_R_EN (1 << 1)
546#define HDMI_I2S_CUV_L_EN (1)
547#define HDMI_I2S_CUV_RL_EN (0x03)
548
549/* I2S_CUV_L_R */
550#define HDMI_I2S_CUV_R_DATA_MASK (0x7 << 4)
551#define HDMI_I2S_CUV_L_DATA_MASK (0x7)
552
371/* Timing generator registers */ 553/* Timing generator registers */
372/* TG configure/status registers */ 554/* TG configure/status registers */
373#define HDMI_TG_VACT_ST3_L HDMI_TG_BASE(0x0068) 555#define HDMI_TG_VACT_ST3_L HDMI_TG_BASE(0x0068)