intel_hdmi_lpe_audio.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  1. /*
  2. * intel_hdmi_lpe_audio.h - Intel HDMI LPE audio driver
  3. *
  4. * Copyright (C) 2016 Intel Corp
  5. * Authors: Sailaja Bandarupalli <sailaja.bandarupalli@intel.com>
  6. * Ramesh Babu K V <ramesh.babu@intel.com>
  7. * Vaibhav Agarwal <vaibhav.agarwal@intel.com>
  8. * Jerome Anand <jerome.anand@intel.com>
  9. * Aravind Siddappaji <aravindx.siddappaji@intel.com>
  10. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation; version 2 of the License.
  15. *
  16. * This program is distributed in the hope that it will be useful, but
  17. * WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. * General Public License for more details.
  20. *
  21. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  22. */
  23. #ifndef __INTEL_HDMI_LPE_AUDIO_H
  24. #define __INTEL_HDMI_LPE_AUDIO_H
  25. #include <linux/types.h>
  26. #include <sound/initval.h>
  27. #include <linux/version.h>
  28. #include <linux/pm_runtime.h>
  29. #include <sound/asoundef.h>
  30. #include <sound/control.h>
  31. #include <sound/pcm.h>
  32. #define AUD_CONFIG_VALID_BIT (1<<9)
  33. #define AUD_CONFIG_DP_MODE (1<<15)
  34. #define AUD_CONFIG_BLOCK_BIT (1<<7)
  35. #define HMDI_LPE_AUDIO_DRIVER_NAME "intel-hdmi-lpe-audio"
  36. #define HAD_MAX_DEVICES 1
  37. #define HAD_MIN_CHANNEL 2
  38. #define HAD_MAX_CHANNEL 8
  39. #define HAD_NUM_OF_RING_BUFS 4
  40. /* Assume 192KHz, 8channel, 25msec period */
  41. #define HAD_MAX_BUFFER (600*1024)
  42. #define HAD_MIN_BUFFER (32*1024)
  43. #define HAD_MAX_PERIODS 4
  44. #define HAD_MIN_PERIODS 4
  45. #define HAD_MAX_PERIOD_BYTES (HAD_MAX_BUFFER/HAD_MIN_PERIODS)
  46. #define HAD_MIN_PERIOD_BYTES 256
  47. #define HAD_FIFO_SIZE 0 /* fifo not being used */
  48. #define MAX_SPEAKERS 8
  49. #define AUD_SAMPLE_RATE_32 32000
  50. #define AUD_SAMPLE_RATE_44_1 44100
  51. #define AUD_SAMPLE_RATE_48 48000
  52. #define AUD_SAMPLE_RATE_88_2 88200
  53. #define AUD_SAMPLE_RATE_96 96000
  54. #define AUD_SAMPLE_RATE_176_4 176400
  55. #define AUD_SAMPLE_RATE_192 192000
  56. #define HAD_MIN_RATE AUD_SAMPLE_RATE_32
  57. #define HAD_MAX_RATE AUD_SAMPLE_RATE_192
  58. #define DIS_SAMPLE_RATE_25_2 25200
  59. #define DIS_SAMPLE_RATE_27 27000
  60. #define DIS_SAMPLE_RATE_54 54000
  61. #define DIS_SAMPLE_RATE_74_25 74250
  62. #define DIS_SAMPLE_RATE_148_5 148500
  63. #define HAD_REG_WIDTH 0x08
  64. #define HAD_MAX_HW_BUFS 0x04
  65. #define HAD_MAX_DIP_WORDS 16
  66. #define INTEL_HAD "IntelHdmiLpeAudio"
  67. /* DP Link Rates */
  68. #define DP_2_7_GHZ 270000
  69. #define DP_1_62_GHZ 162000
  70. /* Maud Values */
  71. #define AUD_SAMPLE_RATE_32_DP_2_7_MAUD_VAL 1988
  72. #define AUD_SAMPLE_RATE_44_1_DP_2_7_MAUD_VAL 2740
  73. #define AUD_SAMPLE_RATE_48_DP_2_7_MAUD_VAL 2982
  74. #define AUD_SAMPLE_RATE_88_2_DP_2_7_MAUD_VAL 5480
  75. #define AUD_SAMPLE_RATE_96_DP_2_7_MAUD_VAL 5965
  76. #define AUD_SAMPLE_RATE_176_4_DP_2_7_MAUD_VAL 10961
  77. #define HAD_MAX_RATE_DP_2_7_MAUD_VAL 11930
  78. #define AUD_SAMPLE_RATE_32_DP_1_62_MAUD_VAL 3314
  79. #define AUD_SAMPLE_RATE_44_1_DP_1_62_MAUD_VAL 4567
  80. #define AUD_SAMPLE_RATE_48_DP_1_62_MAUD_VAL 4971
  81. #define AUD_SAMPLE_RATE_88_2_DP_1_62_MAUD_VAL 9134
  82. #define AUD_SAMPLE_RATE_96_DP_1_62_MAUD_VAL 9942
  83. #define AUD_SAMPLE_RATE_176_4_DP_1_62_MAUD_VAL 18268
  84. #define HAD_MAX_RATE_DP_1_62_MAUD_VAL 19884
  85. /* Naud Value */
  86. #define DP_NAUD_VAL 32768
  87. /* _AUD_CONFIG register MASK */
  88. #define AUD_CONFIG_MASK_UNDERRUN 0xC0000000
  89. #define AUD_CONFIG_MASK_SRDBG 0x00000002
  90. #define AUD_CONFIG_MASK_FUNCRST 0x00000001
  91. #define MAX_CNT 0xFF
  92. #define HAD_SUSPEND_DELAY 1000
  93. #define OTM_HDMI_ELD_SIZE 128
  94. union otm_hdmi_eld_t {
  95. unsigned char eld_data[OTM_HDMI_ELD_SIZE];
  96. struct {
  97. /* Byte[0] = ELD Version Number */
  98. union {
  99. unsigned char byte0;
  100. struct {
  101. unsigned char reserved:3; /* Reserf */
  102. unsigned char eld_ver:5; /* ELD Version Number */
  103. /* 00000b - reserved
  104. * 00001b - first rev, obsoleted
  105. * 00010b - version 2, supporting CEA version
  106. * 861D or below
  107. * 00011b:11111b - reserved
  108. * for future
  109. */
  110. };
  111. };
  112. /* Byte[1] = Vendor Version Field */
  113. union {
  114. unsigned char vendor_version;
  115. struct {
  116. unsigned char reserved1:3;
  117. unsigned char veld_ver:5; /* Version number of the ELD
  118. * extension. This value is
  119. * provisioned and unique to
  120. * each vendor.
  121. */
  122. };
  123. };
  124. /* Byte[2] = Baseline Length field */
  125. unsigned char baseline_eld_length; /* Length of the Baseline structure
  126. * divided by Four.
  127. */
  128. /* Byte [3] = Reserved for future use */
  129. unsigned char byte3;
  130. /* Starting of the BaseLine EELD structure
  131. * Byte[4] = Monitor Name Length
  132. */
  133. union {
  134. unsigned char byte4;
  135. struct {
  136. unsigned char mnl:5;
  137. unsigned char cea_edid_rev_id:3;
  138. };
  139. };
  140. /* Byte[5] = Capabilities */
  141. union {
  142. unsigned char capabilities;
  143. struct {
  144. unsigned char hdcp:1; /* HDCP support */
  145. unsigned char ai_support:1; /* AI support */
  146. unsigned char connection_type:2; /* Connection type
  147. * 00 - HDMI
  148. * 01 - DP
  149. * 10 -11 Reserved
  150. * for future
  151. * connection types
  152. */
  153. unsigned char sadc:4; /* Indicates number of 3 bytes
  154. * Short Audio Descriptors.
  155. */
  156. };
  157. };
  158. /* Byte[6] = Audio Synch Delay */
  159. unsigned char audio_synch_delay; /* Amount of time reported by the
  160. * sink that the video trails audio
  161. * in milliseconds.
  162. */
  163. /* Byte[7] = Speaker Allocation Block */
  164. union {
  165. unsigned char speaker_allocation_block;
  166. struct {
  167. unsigned char flr:1; /*Front Left and Right channels*/
  168. unsigned char lfe:1; /*Low Frequency Effect channel*/
  169. unsigned char fc:1; /*Center transmission channel*/
  170. unsigned char rlr:1; /*Rear Left and Right channels*/
  171. unsigned char rc:1; /*Rear Center channel*/
  172. unsigned char flrc:1; /*Front left and Right of Center
  173. *transmission channels
  174. */
  175. unsigned char rlrc:1; /*Rear left and Right of Center
  176. *transmission channels
  177. */
  178. unsigned char reserved3:1; /* Reserved */
  179. };
  180. };
  181. /* Byte[8 - 15] - 8 Byte port identification value */
  182. unsigned char port_id_value[8];
  183. /* Byte[16 - 17] - 2 Byte Manufacturer ID */
  184. unsigned char manufacturer_id[2];
  185. /* Byte[18 - 19] - 2 Byte Product ID */
  186. unsigned char product_id[2];
  187. /* Byte [20-83] - 64 Bytes of BaseLine Data */
  188. unsigned char mn_sand_sads[64]; /* This will include
  189. * - ASCII string of Monitor name
  190. * - List of 3 byte SADs
  191. * - Zero padding
  192. */
  193. /* Vendor ELD Block should continue here!
  194. * No Vendor ELD block defined as of now.
  195. */
  196. } __packed;
  197. };
  198. /**
  199. * enum had_status - Audio stream states
  200. *
  201. * @STREAM_INIT: Stream initialized
  202. * @STREAM_RUNNING: Stream running
  203. * @STREAM_PAUSED: Stream paused
  204. * @STREAM_DROPPED: Stream dropped
  205. */
  206. enum had_stream_status {
  207. STREAM_INIT = 0,
  208. STREAM_RUNNING = 1,
  209. STREAM_PAUSED = 2,
  210. STREAM_DROPPED = 3
  211. };
  212. /**
  213. * enum had_status_stream - HAD stream states
  214. */
  215. enum had_status_stream {
  216. HAD_INIT = 0,
  217. HAD_RUNNING_STREAM,
  218. };
  219. enum had_drv_status {
  220. HAD_DRV_CONNECTED,
  221. HAD_DRV_RUNNING,
  222. HAD_DRV_DISCONNECTED,
  223. HAD_DRV_SUSPENDED,
  224. HAD_DRV_ERR,
  225. };
  226. /* enum intel_had_aud_buf_type - HDMI controller ring buffer types */
  227. enum intel_had_aud_buf_type {
  228. HAD_BUF_TYPE_A = 0,
  229. HAD_BUF_TYPE_B = 1,
  230. HAD_BUF_TYPE_C = 2,
  231. HAD_BUF_TYPE_D = 3,
  232. };
  233. enum num_aud_ch {
  234. CH_STEREO = 0,
  235. CH_THREE_FOUR = 1,
  236. CH_FIVE_SIX = 2,
  237. CH_SEVEN_EIGHT = 3
  238. };
  239. /* HDMI Controller register offsets - audio domain common */
  240. /* Base address for below regs = 0x65000 */
  241. enum hdmi_ctrl_reg_offset_common {
  242. AUDIO_HDMI_CONFIG_A = 0x000,
  243. AUDIO_HDMI_CONFIG_B = 0x800,
  244. AUDIO_HDMI_CONFIG_C = 0x900,
  245. };
  246. /* HDMI controller register offsets */
  247. enum hdmi_ctrl_reg_offset_v1 {
  248. AUD_CONFIG = 0x0,
  249. AUD_CH_STATUS_0 = 0x08,
  250. AUD_CH_STATUS_1 = 0x0C,
  251. AUD_HDMI_CTS = 0x10,
  252. AUD_N_ENABLE = 0x14,
  253. AUD_SAMPLE_RATE = 0x18,
  254. AUD_BUF_CONFIG = 0x20,
  255. AUD_BUF_CH_SWAP = 0x24,
  256. AUD_BUF_A_ADDR = 0x40,
  257. AUD_BUF_A_LENGTH = 0x44,
  258. AUD_BUF_B_ADDR = 0x48,
  259. AUD_BUF_B_LENGTH = 0x4c,
  260. AUD_BUF_C_ADDR = 0x50,
  261. AUD_BUF_C_LENGTH = 0x54,
  262. AUD_BUF_D_ADDR = 0x58,
  263. AUD_BUF_D_LENGTH = 0x5c,
  264. AUD_CNTL_ST = 0x60,
  265. AUD_HDMI_STATUS = 0x68,
  266. AUD_HDMIW_INFOFR = 0x114,
  267. };
  268. /*
  269. * Delta changes in HDMI controller register offsets
  270. * compare to v1 version
  271. */
  272. enum hdmi_ctrl_reg_offset_v2 {
  273. AUD_HDMI_STATUS_v2 = 0x64,
  274. AUD_HDMIW_INFOFR_v2 = 0x68,
  275. };
  276. /*
  277. * CEA speaker placement:
  278. *
  279. * FL FLC FC FRC FR
  280. *
  281. * LFE
  282. *
  283. * RL RLC RC RRC RR
  284. *
  285. * The Left/Right Surround channel _notions_ LS/RS in SMPTE 320M
  286. * corresponds to CEA RL/RR; The SMPTE channel _assignment_ C/LFE is
  287. * swapped to CEA LFE/FC.
  288. */
  289. enum cea_speaker_placement {
  290. FL = (1 << 0), /* Front Left */
  291. FC = (1 << 1), /* Front Center */
  292. FR = (1 << 2), /* Front Right */
  293. FLC = (1 << 3), /* Front Left Center */
  294. FRC = (1 << 4), /* Front Right Center */
  295. RL = (1 << 5), /* Rear Left */
  296. RC = (1 << 6), /* Rear Center */
  297. RR = (1 << 7), /* Rear Right */
  298. RLC = (1 << 8), /* Rear Left Center */
  299. RRC = (1 << 9), /* Rear Right Center */
  300. LFE = (1 << 10), /* Low Frequency Effect */
  301. };
  302. struct cea_channel_speaker_allocation {
  303. int ca_index;
  304. int speakers[8];
  305. /* derived values, just for convenience */
  306. int channels;
  307. int spk_mask;
  308. };
  309. struct channel_map_table {
  310. unsigned char map; /* ALSA API channel map position */
  311. unsigned char cea_slot; /* CEA slot value */
  312. int spk_mask; /* speaker position bit mask */
  313. };
  314. /**
  315. * union aud_cfg - Audio configuration
  316. *
  317. * @cfg_regx: individual register bits
  318. * @cfg_regval: full register value
  319. *
  320. */
  321. union aud_cfg {
  322. struct {
  323. u32 aud_en:1;
  324. u32 layout:1;
  325. u32 fmt:2;
  326. u32 num_ch:3;
  327. u32 set:1;
  328. u32 flat:1;
  329. u32 val_bit:1;
  330. u32 user_bit:1;
  331. u32 underrun:1;
  332. u32 packet_mode:1;
  333. u32 left_align:1;
  334. u32 bogus_sample:1;
  335. u32 dp_modei:1;
  336. u32 rsvd:16;
  337. } cfg_regx_v2;
  338. u32 cfg_regval;
  339. };
  340. /**
  341. * union aud_ch_status_0 - Audio Channel Status 0 Attributes
  342. *
  343. * @status_0_regx:individual register bits
  344. * @status_0_regval:full register value
  345. *
  346. */
  347. union aud_ch_status_0 {
  348. struct {
  349. u32 ch_status:1;
  350. u32 lpcm_id:1;
  351. u32 cp_info:1;
  352. u32 format:3;
  353. u32 mode:2;
  354. u32 ctg_code:8;
  355. u32 src_num:4;
  356. u32 ch_num:4;
  357. u32 samp_freq:4;
  358. u32 clk_acc:2;
  359. u32 rsvd:2;
  360. } status_0_regx;
  361. u32 status_0_regval;
  362. };
  363. /**
  364. * union aud_ch_status_1 - Audio Channel Status 1 Attributes
  365. *
  366. * @status_1_regx: individual register bits
  367. * @status_1_regval: full register value
  368. *
  369. */
  370. union aud_ch_status_1 {
  371. struct {
  372. u32 max_wrd_len:1;
  373. u32 wrd_len:3;
  374. u32 rsvd:28;
  375. } status_1_regx;
  376. u32 status_1_regval;
  377. };
  378. /**
  379. * union aud_hdmi_cts - CTS register
  380. *
  381. * @cts_regx: individual register bits
  382. * @cts_regval: full register value
  383. *
  384. */
  385. union aud_hdmi_cts {
  386. struct {
  387. u32 cts_val:24;
  388. u32 en_cts_prog:1;
  389. u32 rsvd:7;
  390. } cts_regx_v2;
  391. u32 cts_regval;
  392. };
  393. /**
  394. * union aud_hdmi_n_enable - N register
  395. *
  396. * @n_regx: individual register bits
  397. * @n_regval: full register value
  398. *
  399. */
  400. union aud_hdmi_n_enable {
  401. struct {
  402. u32 n_val:24;
  403. u32 en_n_prog:1;
  404. u32 rsvd:7;
  405. } n_regx_v2;
  406. u32 n_regval;
  407. };
  408. /**
  409. * union aud_buf_config - Audio Buffer configurations
  410. *
  411. * @buf_cfg_regx: individual register bits
  412. * @buf_cfgval: full register value
  413. *
  414. */
  415. union aud_buf_config {
  416. struct {
  417. u32 audio_fifo_watermark:8;
  418. u32 dma_fifo_watermark:3;
  419. u32 rsvd0:5;
  420. u32 aud_delay:8;
  421. u32 rsvd1:8;
  422. } buf_cfg_regx_v2;
  423. u32 buf_cfgval;
  424. };
  425. /**
  426. * union aud_buf_ch_swap - Audio Sample Swapping offset
  427. *
  428. * @buf_ch_swap_regx: individual register bits
  429. * @buf_ch_swap_val: full register value
  430. *
  431. */
  432. union aud_buf_ch_swap {
  433. struct {
  434. u32 first_0:3;
  435. u32 second_0:3;
  436. u32 first_1:3;
  437. u32 second_1:3;
  438. u32 first_2:3;
  439. u32 second_2:3;
  440. u32 first_3:3;
  441. u32 second_3:3;
  442. u32 rsvd:8;
  443. } buf_ch_swap_regx;
  444. u32 buf_ch_swap_val;
  445. };
  446. /**
  447. * union aud_buf_addr - Address for Audio Buffer
  448. *
  449. * @buf_addr_regx: individual register bits
  450. * @buf_addr_val: full register value
  451. *
  452. */
  453. union aud_buf_addr {
  454. struct {
  455. u32 valid:1;
  456. u32 intr_en:1;
  457. u32 rsvd:4;
  458. u32 addr:26;
  459. } buf_addr_regx;
  460. u32 buf_addr_val;
  461. };
  462. /**
  463. * union aud_buf_len - Length of Audio Buffer
  464. *
  465. * @buf_len_regx: individual register bits
  466. * @buf_len_val: full register value
  467. *
  468. */
  469. union aud_buf_len {
  470. struct {
  471. u32 buf_len:20;
  472. u32 rsvd:12;
  473. } buf_len_regx;
  474. u32 buf_len_val;
  475. };
  476. /**
  477. * union aud_ctrl_st - Audio Control State Register offset
  478. *
  479. * @ctrl_regx: individual register bits
  480. * @ctrl_val: full register value
  481. *
  482. */
  483. union aud_ctrl_st {
  484. struct {
  485. u32 ram_addr:4;
  486. u32 eld_ack:1;
  487. u32 eld_addr:4;
  488. u32 eld_buf_size:5;
  489. u32 eld_valid:1;
  490. u32 cp_ready:1;
  491. u32 dip_freq:2;
  492. u32 dip_idx:3;
  493. u32 dip_en_sta:4;
  494. u32 rsvd:7;
  495. } ctrl_regx;
  496. u32 ctrl_val;
  497. };
  498. /**
  499. * union aud_info_frame1 - Audio HDMI Widget Data Island Packet offset
  500. *
  501. * @fr1_regx: individual register bits
  502. * @fr1_val: full register value
  503. *
  504. */
  505. union aud_info_frame1 {
  506. struct {
  507. u32 pkt_type:8;
  508. u32 ver_num:8;
  509. u32 len:5;
  510. u32 rsvd:11;
  511. } fr1_regx;
  512. u32 fr1_val;
  513. };
  514. /**
  515. * union aud_info_frame2 - DIP frame 2
  516. *
  517. * @fr2_regx: individual register bits
  518. * @fr2_val: full register value
  519. *
  520. */
  521. union aud_info_frame2 {
  522. struct {
  523. u32 chksum:8;
  524. u32 chnl_cnt:3;
  525. u32 rsvd0:1;
  526. u32 coding_type:4;
  527. u32 smpl_size:2;
  528. u32 smpl_freq:3;
  529. u32 rsvd1:3;
  530. u32 format:8;
  531. } fr2_regx;
  532. u32 fr2_val;
  533. };
  534. /**
  535. * union aud_info_frame3 - DIP frame 3
  536. *
  537. * @fr3_regx: individual register bits
  538. * @fr3_val: full register value
  539. *
  540. */
  541. union aud_info_frame3 {
  542. struct {
  543. u32 chnl_alloc:8;
  544. u32 rsvd0:3;
  545. u32 lsv:4;
  546. u32 dm_inh:1;
  547. u32 rsvd1:16;
  548. } fr3_regx;
  549. u32 fr3_val;
  550. };
  551. enum hdmi_connector_status {
  552. hdmi_connector_status_connected = 1,
  553. hdmi_connector_status_disconnected = 2,
  554. hdmi_connector_status_unknown = 3,
  555. };
  556. #define HDMI_AUDIO_UNDERRUN (1UL<<31)
  557. #define HDMI_AUDIO_BUFFER_DONE (1UL<<29)
  558. #define PORT_ENABLE (1 << 31)
  559. #define SDVO_AUDIO_ENABLE (1 << 6)
  560. enum had_caps_list {
  561. HAD_GET_ELD = 1,
  562. HAD_GET_DISPLAY_RATE,
  563. HAD_GET_DP_OUTPUT,
  564. HAD_GET_LINK_RATE,
  565. HAD_SET_ENABLE_AUDIO,
  566. HAD_SET_DISABLE_AUDIO,
  567. HAD_SET_ENABLE_AUDIO_INT,
  568. HAD_SET_DISABLE_AUDIO_INT,
  569. };
  570. enum had_event_type {
  571. HAD_EVENT_HOT_PLUG = 1,
  572. HAD_EVENT_HOT_UNPLUG,
  573. HAD_EVENT_MODE_CHANGING,
  574. HAD_EVENT_AUDIO_BUFFER_DONE,
  575. HAD_EVENT_AUDIO_BUFFER_UNDERRUN,
  576. HAD_EVENT_QUERY_IS_AUDIO_BUSY,
  577. HAD_EVENT_QUERY_IS_AUDIO_SUSPENDED,
  578. };
  579. /*
  580. * HDMI Display Controller Audio Interface
  581. *
  582. */
  583. typedef int (*had_event_call_back) (enum had_event_type event_type,
  584. void *ctxt_info);
  585. struct hdmi_audio_event {
  586. int type;
  587. };
  588. bool mid_hdmi_audio_is_busy(void *dev);
  589. void mid_hdmi_audio_signal_event(enum had_event_type event);
  590. int mid_hdmi_audio_setup(had_event_call_back audio_callbacks);
  591. int mid_hdmi_audio_read(u32 reg, u32 *val);
  592. int mid_hdmi_audio_write(u32 reg, u32 val);
  593. int mid_hdmi_audio_rmw(u32 reg, u32 val, u32 mask);
  594. int mid_hdmi_audio_get_caps(enum had_caps_list get_element,
  595. void *capabilities);
  596. int mid_hdmi_audio_set_caps(enum had_caps_list set_element,
  597. void *capabilties);
  598. #endif