msm_dba.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. /*
  2. * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 and
  6. * only version 2 as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef _MSM_DBA_H
  14. #define _MSM_DBA_H
  15. #include <linux/types.h>
  16. #include <linux/bitops.h>
  17. #define MSM_DBA_CHIP_NAME_MAX_LEN 20
  18. #define MSM_DBA_CLIENT_NAME_LEN 20
  19. #define MSM_DBA_DEFER_PROPERTY_FLAG 0x1
  20. #define MSM_DBA_ASYNC_FLAG 0x2
  21. /**
  22. * enum msm_dba_callback_event - event types for callback notification
  23. * @MSM_DBA_CB_REMOTE_INT: Event associated with remote devices on an interface
  24. * that supports a bi-directional control channel.
  25. * @MSM_DBA_CB_HDCP_LINK_AUTHENTICATED: Authentication session is successful.
  26. * The link is authenticated and encryption
  27. * can be enabled if not enabled already.
  28. * @MSM_DBA_CB_HDCP_LINK_UNAUTHENTICATED: A previously authenticated link has
  29. * failed. The content on the interface
  30. * is no longer secure.
  31. * @MSM_DBA_CB_HPD_CONNECT: Detected a cable connect event.
  32. * @MSM_DBA_CB_HPD_DISCONNECT: Detected a cable disconnect event.
  33. * @MSM_DBA_CB_VIDEO_FAILURE: Detected a failure with respect to video data on
  34. * the interface. This is a generic failure and
  35. * client should request a debug dump to debug the
  36. * issue. Client can also attempt a reset to recover
  37. * the device.
  38. * @MSM_DBA_CB_AUDIO_FAILURE: Detected a failure with respect to audio data on
  39. * the interface. This is a generic failure and
  40. * client should request a debug dump. Client can
  41. * also attempt a reset to recover the device.
  42. * @MSM_DBA_CB_CEC_WRITE_SUCCESS: The asynchronous CEC write request is
  43. * successful.
  44. * @MSM_DBA_CB_CEC_WRITE_FAIL: The asynchronous CEC write request failed.
  45. * @MSM_DBA_CB_CEC_READ_PENDING: There is a pending CEC read message.
  46. * @MSM_DBA_CB_PRE_RESET: This callback is called just before the device is
  47. * being reset.
  48. * @MSM_DBA_CB_POST_RESET: This callback is called after device reset is
  49. * complete and the driver has applied back all the
  50. * properties.
  51. *
  52. * Clients for this driver can register for receiving callbacks for specific
  53. * events. This enum defines the type of events supported by the driver. An
  54. * event mask is typically used to denote multiple events.
  55. */
  56. enum msm_dba_callback_event {
  57. MSM_DBA_CB_REMOTE_INT = BIT(0),
  58. MSM_DBA_CB_HDCP_LINK_AUTHENTICATED = BIT(1),
  59. MSM_DBA_CB_HDCP_LINK_UNAUTHENTICATED = BIT(2),
  60. MSM_DBA_CB_HPD_CONNECT = BIT(3),
  61. MSM_DBA_CB_HPD_DISCONNECT = BIT(4),
  62. MSM_DBA_CB_VIDEO_FAILURE = BIT(5),
  63. MSM_DBA_CB_AUDIO_FAILURE = BIT(6),
  64. MSM_DBA_CB_CEC_WRITE_SUCCESS = BIT(7),
  65. MSM_DBA_CB_CEC_WRITE_FAIL = BIT(8),
  66. MSM_DBA_CB_CEC_READ_PENDING = BIT(9),
  67. MSM_DBA_CB_PRE_RESET = BIT(10),
  68. MSM_DBA_CB_POST_RESET = BIT(11),
  69. };
  70. /**
  71. * enum msm_dba_audio_interface_type - audio interface type
  72. * @MSM_DBA_AUDIO_I2S_INTERFACE: I2S interface for audio
  73. * @MSM_DBA_AUDIO_SPDIF_INTERFACE: SPDIF interface for audio
  74. */
  75. enum msm_dba_audio_interface_type {
  76. MSM_DBA_AUDIO_I2S_INTERFACE = BIT(0),
  77. MSM_DBA_AUDIO_SPDIF_INTERFACE = BIT(1),
  78. };
  79. /**
  80. * enum msm_dba_audio_format_type - audio format type
  81. * @MSM_DBA_AUDIO_FMT_UNCOMPRESSED_LPCM: uncompressed format
  82. * @MSM_DBA_AUDIO_FMT_COMPRESSED: compressed formats
  83. */
  84. enum msm_dba_audio_format_type {
  85. MSM_DBA_AUDIO_FMT_UNCOMPRESSED_LPCM = BIT(0),
  86. MSM_DBA_AUDIO_FMT_COMPRESSED = BIT(1),
  87. };
  88. /**
  89. * enum msm_dba_audio_copyright_type - audio copyright
  90. * @MSM_DBA_AUDIO_COPYRIGHT_PROTECTED: copy right protected
  91. * @MSM_DBA_AUDIO_COPYRIGHT_NOT_PROTECTED: not copy right protected
  92. */
  93. enum msm_dba_audio_copyright_type {
  94. MSM_DBA_AUDIO_COPYRIGHT_PROTECTED = BIT(0),
  95. MSM_DBA_AUDIO_COPYRIGHT_NOT_PROTECTED = BIT(1),
  96. };
  97. /**
  98. * enum msm_dba_audio_pre_emphasis_type - pre-emphasis
  99. * @MSM_DBA_AUDIO_NO_PRE_EMPHASIS: 2 audio channels w/o pre-emphasis
  100. * @MSM_DBA_AUDIO_PRE_EMPHASIS_50_15us: 2 audio channels with 50/15uS
  101. */
  102. enum msm_dba_audio_pre_emphasis_type {
  103. MSM_DBA_AUDIO_NO_PRE_EMPHASIS = BIT(0),
  104. MSM_DBA_AUDIO_PRE_EMPHASIS_50_15us = BIT(1),
  105. };
  106. /**
  107. * enum msm_dba_audio_clock_accuracy - Audio Clock Accuracy
  108. * @MSM_DBA_AUDIO_CLOCK_ACCURACY_LVL1: normal accuracy +/-1000 x 10^-6
  109. * @MSM_DBA_AUDIO_CLOCK_ACCURACY_LVL2: high accuracy +/- 50 x 10^-6
  110. * @MSM_DBA_AUDIO_CLOCK_ACCURACY_LVL3: variable pitch shifted clock
  111. */
  112. enum msm_dba_audio_clock_accuracy {
  113. MSM_DBA_AUDIO_CLOCK_ACCURACY_LVL1 = BIT(1),
  114. MSM_DBA_AUDIO_CLOCK_ACCURACY_LVL2 = BIT(0),
  115. MSM_DBA_AUDIO_CLOCK_ACCURACY_LVL3 = BIT(2),
  116. };
  117. /**
  118. * enum msm_dba_channel_status_source - CS override
  119. * @MSM_DBA_AUDIO_CS_SOURCE_I2S_STREAM: use channel status bits from I2S stream
  120. * @MSM_DBA_AUDIO_CS_SOURCE_REGISTERS: use channel status bits from registers
  121. */
  122. enum msm_dba_channel_status_source {
  123. MSM_DBA_AUDIO_CS_SOURCE_I2S_STREAM,
  124. MSM_DBA_AUDIO_CS_SOURCE_REGISTERS
  125. };
  126. /**
  127. * enum msm_dba_audio_sampling_rates_type - audio sampling rates
  128. * @MSM_DBA_AUDIO_32KHZ: 32KHz sampling rate
  129. * @MSM_DBA_AUDIO_44P1KHZ: 44.1KHz sampling rate
  130. * @MSM_DBA_AUDIO_48KHZ: 48KHz sampling rate
  131. * @MSM_DBA_AUDIO_96KHZ: 96KHz sampling rate
  132. * @MSM_DBA_AUDIO_192KHZ: 192KHz sampling rate
  133. */
  134. enum msm_dba_audio_sampling_rates_type {
  135. MSM_DBA_AUDIO_32KHZ = BIT(0),
  136. MSM_DBA_AUDIO_44P1KHZ = BIT(1),
  137. MSM_DBA_AUDIO_48KHZ = BIT(2),
  138. MSM_DBA_AUDIO_88P2KHZ = BIT(1),
  139. MSM_DBA_AUDIO_96KHZ = BIT(3),
  140. MSM_DBA_AUDIO_176P4KHZ = BIT(1),
  141. MSM_DBA_AUDIO_192KHZ = BIT(4),
  142. };
  143. /**
  144. * enum msm_dba_audio_word_bit_depth - audio word size
  145. * @MSM_DBA_AUDIO_WORD_16BIT: 16 bits per word
  146. * @MSM_DBA_AUDIO_WORD_24BIT: 24 bits per word
  147. * @MSM_DBA_AUDIO_WORD_32BIT: 32 bits per word
  148. */
  149. enum msm_dba_audio_word_bit_depth {
  150. MSM_DBA_AUDIO_WORD_16BIT = BIT(1),
  151. MSM_DBA_AUDIO_WORD_24BIT = BIT(2),
  152. MSM_DBA_AUDIO_WORD_32BIT = BIT(3),
  153. };
  154. /**
  155. * enum msm_dba_audio_channel_count - audio channel count
  156. * @MSM_DBA_AUDIO_CHANNEL_2: 2 channel audio
  157. * @MSM_DBA_AUDIO_CHANNEL_4: 4 channel audio
  158. * @MSM_DBA_AUDIO_CHANNEL_8: 8 channel audio
  159. */
  160. enum msm_dba_audio_channel_count {
  161. MSM_DBA_AUDIO_CHANNEL_2 = BIT(0),
  162. MSM_DBA_AUDIO_CHANNEL_4 = BIT(1),
  163. MSM_DBA_AUDIO_CHANNEL_8 = BIT(2),
  164. };
  165. /**
  166. * enum msm_dba_audio_i2s_format - i2s audio data format
  167. * @MSM_DBA_AUDIO_I2S_FMT_STANDARD: Standard format
  168. * @MSM_DBA_AUDIO_I2S_FMT_RIGHT_JUSTIFIED: i2s data is right justified
  169. * @MSM_DBA_AUDIO_I2S_FMT_LEFT_JUSTIFIED: i2s data is left justified
  170. * @MSM_DBA_AUDIO_I2S_FMT_AES3_DIRECT: AES signal format
  171. */
  172. enum msm_dba_audio_i2s_format {
  173. MSM_DBA_AUDIO_I2S_FMT_STANDARD = 0,
  174. MSM_DBA_AUDIO_I2S_FMT_RIGHT_JUSTIFIED,
  175. MSM_DBA_AUDIO_I2S_FMT_LEFT_JUSTIFIED,
  176. MSM_DBA_AUDIO_I2S_FMT_AES3_DIRECT,
  177. MSM_DBA_AUDIO_I2S_FMT_MAX,
  178. };
  179. enum msm_dba_video_aspect_ratio {
  180. MSM_DBA_AR_UNKNOWN = 0,
  181. MSM_DBA_AR_4_3,
  182. MSM_DBA_AR_5_4,
  183. MSM_DBA_AR_16_9,
  184. MSM_DBA_AR_16_10,
  185. MSM_DBA_AR_64_27,
  186. MSM_DBA_AR_256_135,
  187. MSM_DBA_AR_MAX
  188. };
  189. enum msm_dba_audio_word_endian_type {
  190. MSM_DBA_AUDIO_WORD_LITTLE_ENDIAN = 0,
  191. MSM_DBA_AUDIO_WORD_BIG_ENDIAN,
  192. MSM_DBA_AUDIO_WORD_ENDIAN_MAX
  193. };
  194. /**
  195. * msm_dba_audio_op_mode - i2s audio operation mode
  196. * @MSM_DBA_AUDIO_MODE_MANUAL: Manual mode
  197. * @MSM_DBA_AUDIO_MODE_AUTOMATIC: Automatic mode
  198. */
  199. enum msm_dba_audio_op_mode {
  200. MSM_DBA_AUDIO_MODE_MANUAL,
  201. MSM_DBA_AUDIO_MODE_AUTOMATIC,
  202. };
  203. /**
  204. * typedef *msm_dba_cb() - Prototype for callback function
  205. * @data: Pointer to user data provided with register API
  206. * @event: Event type associated with callback. This can be a bitmask.
  207. */
  208. typedef void (*msm_dba_cb)(void *data, enum msm_dba_callback_event event);
  209. /**
  210. * struct msm_dba_reg_info - Client information used with register API
  211. * @client_name: Name of the client for debug purposes
  212. * @chip_name: Bridge chip ID
  213. * @instance_id: Instance ID of the bridge chip in case of multiple instances
  214. * @cb: callback function called in case of events.
  215. * @cb_data: pointer to a data structure that will be returned with callback
  216. *
  217. * msm_dba_reg_info structure will be used to provide information during
  218. * registering with driver. This structure will contain the information required
  219. * to identify the specific bridge chip the client wants to use.
  220. *
  221. * Client should also specify the callback function which needs to be called in
  222. * case of events. There is an optional data field which is a pointer that will
  223. * be returned as one of arguments in the callback function. This data field can
  224. * be NULL if client does not wish to use it.
  225. */
  226. struct msm_dba_reg_info {
  227. char client_name[MSM_DBA_CLIENT_NAME_LEN];
  228. char chip_name[MSM_DBA_CHIP_NAME_MAX_LEN];
  229. u32 instance_id;
  230. msm_dba_cb cb;
  231. void *cb_data;
  232. };
  233. /**
  234. * struct msm_dba_video_caps_info - video capabilities of the bridge chip
  235. * @hdcp_support: if hdcp is supported
  236. * @edid_support: if reading edid from sink is supported
  237. * @data_lanes_lp_support: if low power mode is supported on data lanes
  238. * @clock_lanes_lp_support: If low power mode is supported on clock lanes
  239. * @max_pclk_khz: maximum pixel clock supported
  240. * @num_of_input_lanes: Number of input data lanes supported by the bridge chip
  241. */
  242. struct msm_dba_video_caps_info {
  243. bool hdcp_support;
  244. bool edid_support;
  245. bool data_lanes_lp_support;
  246. bool clock_lanes_lp_support;
  247. u32 max_pclk_khz;
  248. u32 num_of_input_lanes;
  249. };
  250. /**
  251. * struct msm_dba_audio_caps_info - audio capabilities of the bridge chip
  252. * @audio_support: if audio is supported
  253. * @audio_rates: audio sampling rates supported
  254. * @audio_fmts: audio formats supported
  255. */
  256. struct msm_dba_audio_caps_info {
  257. u32 audio_support;
  258. u32 audio_rates;
  259. u32 audio_fmts;
  260. };
  261. /**
  262. * struct msm_dba_capabilities - general capabilities of the bridge chip
  263. * @vid_caps: video capabilities
  264. * @aud_caps: audio capabilities
  265. * @av_mute_support: av mute support in bridge chip
  266. * @deferred_commit_support: support for deferred commit
  267. */
  268. struct msm_dba_capabilities {
  269. struct msm_dba_video_caps_info vid_caps;
  270. struct msm_dba_audio_caps_info aud_caps;
  271. bool av_mute_support;
  272. bool deferred_commit_support;
  273. };
  274. /**
  275. * struct msm_dba_audio_cfg - Structure for audio configuration
  276. * @interface: Specifies audio interface type. Client should check the
  277. * capabilities for the interfaces supported by the bridge.
  278. * @format: Compressed vs Uncompressed formats.
  279. * @channels: Number of channels.
  280. * @i2s_fmt: I2S data packing format. This is valid only if interface is I2S.
  281. * @sampling_rate: sampling rate of audio data
  282. * @word_size: word size
  283. * @word_endianness: little or big endian words
  284. */
  285. struct msm_dba_audio_cfg {
  286. enum msm_dba_audio_interface_type interface;
  287. enum msm_dba_audio_format_type format;
  288. enum msm_dba_audio_channel_count channels;
  289. enum msm_dba_audio_i2s_format i2s_fmt;
  290. enum msm_dba_audio_sampling_rates_type sampling_rate;
  291. enum msm_dba_audio_word_bit_depth word_size;
  292. enum msm_dba_audio_word_endian_type word_endianness;
  293. enum msm_dba_audio_copyright_type copyright;
  294. enum msm_dba_audio_pre_emphasis_type pre_emphasis;
  295. enum msm_dba_audio_clock_accuracy clock_accuracy;
  296. enum msm_dba_channel_status_source channel_status_source;
  297. enum msm_dba_audio_op_mode mode;
  298. u32 channel_status_category_code;
  299. u32 channel_status_source_number;
  300. u32 channel_status_v_bit;
  301. u32 channel_allocation;
  302. u32 channel_status_word_length;
  303. u32 n;
  304. u32 cts;
  305. };
  306. /**
  307. * struct msm_dba_video_cfg - video configuration data
  308. * @h_active: active width of the video signal
  309. * @h_front_porch: horizontal front porch in pixels
  310. * @h_pulse_width: pulse width of hsync in pixels
  311. * @h_back_porch: horizontal back porch in pixels
  312. * @h_polarity: polarity of hsync signal
  313. * @v_active: active height of the video signal
  314. * @v_front_porch: vertical front porch in lines
  315. * @v_pulse_width: pulse width of vsync in lines
  316. * @v_back_porch: vertical back porch in lines
  317. * @v_polarity: polarity of vsync signal
  318. * @pclk_khz: pixel clock in KHz
  319. * @interlaced: if video is interlaced
  320. * @vic: video indetification code
  321. * @hdmi_mode: hdmi or dvi mode for the sink
  322. * @ar: aspect ratio of the signal
  323. * @num_of_input_lanes: number of input lanes in case of DSI/LVDS
  324. */
  325. struct msm_dba_video_cfg {
  326. u32 h_active;
  327. u32 h_front_porch;
  328. u32 h_pulse_width;
  329. u32 h_back_porch;
  330. bool h_polarity;
  331. u32 v_active;
  332. u32 v_front_porch;
  333. u32 v_pulse_width;
  334. u32 v_back_porch;
  335. bool v_polarity;
  336. u32 pclk_khz;
  337. bool interlaced;
  338. u32 vic;
  339. bool hdmi_mode;
  340. enum msm_dba_video_aspect_ratio ar;
  341. u32 num_of_input_lanes;
  342. u8 scaninfo;
  343. };
  344. struct mdss_dba_timing_info {
  345. u16 xres;
  346. u16 yres;
  347. u8 bpp;
  348. u8 fps;
  349. u8 lanes;
  350. };
  351. /**
  352. * struct msm_dba_ops- operation supported by bridge chip
  353. * @get_caps: returns the bridge chip capabilities
  354. * DEFER and ASYNC flags are not supported.
  355. * @power_on: powers on/off the bridge chip. This usually involves turning on
  356. * the power regulators and bringing the chip out of reset. Chip
  357. * should be capable of raising interrupts at this point.
  358. * DEFER and ASYNC flags are supported.
  359. * @video_on: turn on/off video stream. This function also requires the video
  360. * timing information that might be needed for programming the bridge
  361. * chip.
  362. * DEFER flag is supported.
  363. * ASYNC flag is not supported.
  364. * @audio_on: turn on/off audio stream.
  365. * DEFER flag is supported.
  366. * ASYNC flag is not supported.
  367. * @configure_audio: setup audio configuration
  368. * DEFER flag is supported.
  369. * ASYNC flag is not supported.
  370. * @av_mute: controls av mute functionalities if supported. AV mute is different
  371. * from audio_on and video_on where in even though the actual data is
  372. * sent, mute is specified through control packets.
  373. * DEFER flag is supported.
  374. * ASYNC flag is not supported.
  375. * @interupts_enable: enables interrupts to get event callbacks. Clients need
  376. * to specify an event mask of the events they are
  377. * interested in. If a client provides an event as part of
  378. * the mask, it will receive the interrupt regardless of the
  379. * client modifying the property.
  380. * DEFER flag is supported.
  381. * ASYNC flag is not supported.
  382. * @hdcp_enable: enable/disable hdcp. If HDCP is enabled, this function will
  383. * start a new authentication session. There is a separate
  384. * argument for enabling encryption. Encryption can be enabled any
  385. * time after HDCP has been fully authenticated. This function
  386. * will support an asynchronous mode where calling this function
  387. * will kick off HDCP and return to the caller. Caller has to wait
  388. * for MSM_DBA_CB_HDCP_SUCCESS callback to ensure link is
  389. * authenticated.
  390. * DEFER flag is not supported.
  391. * ASYNC flag is supported.
  392. * @hdcp_get_ksv_list_size: returns the KSV list size. In case of a simple sink
  393. * the size will be 1. In case of a repeater, this can
  394. * be more than one.
  395. * DEFER and ASYNC flags are not supported.
  396. * @hdcp_get_ksv_list: return the KSV list. Client can query the KSV information
  397. * from the bridge. Client should call
  398. * hdcp_get_ksv_list_size first and then allocate 40*size
  399. * bytes to hold all the KSVs.
  400. * DEFER and ASYNC flags are not supported.
  401. * @hdmi_cec_on: enable or disable cec module. Clients need to enable CEC
  402. * feature before they do read or write CEC messages.
  403. * @hdmi_cec_write: perform a CEC write. For bridges with HDMI as output
  404. * interface, this function allows clients to send a CEC
  405. * message. Client should pack the data according to the CEC
  406. * specification and provide the final buffer. Since CEC writes
  407. * can take longer time to ascertaining if they are successful,
  408. * this function supports the ASYNC flag. Driver will return
  409. * either MSM_DBA_CB_CEC_WRITE_SUCCESS or
  410. * MSM_DBA_CB_CEC_WRITE_FAIL callbacks.
  411. * DEFER is not supported.
  412. * ASYNC flag is supported.
  413. * @hdmi_cec_read: get a pending CEC read message. In case of an incoming CEC
  414. * message, driver will return MSM_DBA_CB_CEC_READ_PENDING
  415. * callback. On getting this event callback, client should call
  416. * hdmi_cec_read to get the message. The buffer should at least
  417. * be 15 bytes or more. Client should read the CEC message from
  418. * a thread different from the callback.
  419. * DEFER and ASYNC flags are not supported.
  420. * @get_edid_size: returns size of the edid.
  421. * DEFER and ASYNC flags are not supported.
  422. * @get_raw_edid: returns raw edid data.
  423. * DEFER and ASYNC flags are not supported.
  424. * @enable_remote_comm: enable/disable remote communication. Some interfaces
  425. * like FPDLINK III support a bi-directional control
  426. * channel that could be used to send control data using an
  427. * I2C or SPI protocol. This Function will enable this
  428. * control channel if supported.
  429. * DEFER and ASYNC flags are not supported.
  430. * @add_remote_device: add slaves on remote side for enabling communication. For
  431. * interfaces that support bi directional control channel,
  432. * this function allows clients to specify slave IDs of
  433. * devices on remote bus. Messages addressed to these IDs
  434. * will be trapped by the bridge chip and put on the remote
  435. * bus.
  436. * DEFER and ASYNC flags are not supported.
  437. * @commit_deferred_props: commits deferred properties
  438. * DEFER and ASYNC flags are not supported.
  439. * @force_reset: reset the device forcefully. In case the device goes into a bad
  440. * state, a client can force reset to try and recover the device.
  441. * The reset will be applied in spite of different configurations
  442. * from other clients. Driver will apply all the properties that
  443. * have been applied so far after the reset is complete. In case
  444. * of multiple clients, driver will issue a reset callback.
  445. * @dump_debug_info: dumps debug information to dmesg.
  446. * @check_hpd: Check if cable is connected or not. if cable is connected we
  447. * send notification to display framework.
  448. * @set_audio_block: This function will populate the raw audio speaker block
  449. * data along with size of each block in bridgechip buffer.
  450. * @get_audio_block: This function will return the raw audio speaker block
  451. * along with size of each block.
  452. *
  453. * The msm_dba_ops structure represents a set of operations that can be
  454. * supported by each bridge chip. Depending on the functionality supported by a
  455. * specific bridge chip, some of the operations need not be supported. For
  456. * example if a bridge chip does not support reading EDID from a sink device,
  457. * get_edid_size and get_raw_edid can be NULL.
  458. *
  459. * Deferring properties: The deferred flag allows us to address any quirks with
  460. * respect to specific bridge chips. If there is a need for some properties to
  461. * be committed together, turning on video and audio at the same time, the
  462. * deferred flag can be used. Properties that are set using a DEFER flag will
  463. * not be committed to hardware until commit_deferred_props() function is
  464. * called.
  465. *
  466. */
  467. struct msm_dba_ops {
  468. int (*get_caps)(void *client,
  469. struct msm_dba_capabilities *caps);
  470. int (*power_on)(void *client,
  471. bool on,
  472. u32 flags);
  473. int (*video_on)(void *client,
  474. bool on,
  475. struct msm_dba_video_cfg *cfg,
  476. u32 flags);
  477. int (*audio_on)(void *client,
  478. bool on,
  479. u32 flags);
  480. int (*configure_audio)(void *client,
  481. struct msm_dba_audio_cfg *cfg,
  482. u32 flags);
  483. int (*av_mute)(void *client,
  484. bool video_mute,
  485. bool audio_mute,
  486. u32 flags);
  487. int (*interrupts_enable)(void *client,
  488. bool on,
  489. u32 event_mask,
  490. u32 flags);
  491. int (*hdcp_enable)(void *client,
  492. bool hdcp_on,
  493. bool enc_on,
  494. u32 flags);
  495. int (*hdcp_get_ksv_list_size)(void *client,
  496. u32 *count,
  497. u32 flags);
  498. int (*hdcp_get_ksv_list)(void *client,
  499. u32 count,
  500. char *buf,
  501. u32 flags);
  502. int (*hdmi_cec_on)(void *client,
  503. bool enable,
  504. u32 flags);
  505. int (*hdmi_cec_write)(void *client,
  506. u32 size,
  507. char *buf,
  508. u32 flags);
  509. int (*hdmi_cec_read)(void *client,
  510. u32 *size,
  511. char *buf,
  512. u32 flags);
  513. int (*get_edid_size)(void *client,
  514. u32 *size,
  515. u32 flags);
  516. int (*get_raw_edid)(void *client,
  517. u32 size,
  518. char *buf,
  519. u32 flags);
  520. int (*enable_remote_comm)(void *client,
  521. bool on,
  522. u32 flags);
  523. int (*add_remote_device)(void *client,
  524. u32 *slave_ids,
  525. u32 count,
  526. u32 flags);
  527. int (*commit_deferred_props)(void *client,
  528. u32 flags);
  529. int (*force_reset)(void *client, u32 flags);
  530. int (*dump_debug_info)(void *client, u32 flags);
  531. int (*check_hpd)(void *client, u32 flags);
  532. void (*set_audio_block)(void *client, u32 size, void *buf);
  533. void (*get_audio_block)(void *client, u32 size, void *buf);
  534. void* (*get_supp_timing_info)(void);
  535. };
  536. /**
  537. * msm_dba_register_client() - Allows a client to register with the driver.
  538. * @info: Client information along with the bridge chip id the client wishes to
  539. * program.
  540. * @ops: Function pointers to bridge chip operations. Some function pointers can
  541. * be NULL depending on the functionalities supported by bridge chip.
  542. *
  543. * The register API supports multiple clients to register for the same bridge
  544. * chip. If Successful, this will return a pointer that should be used as a
  545. * handle for all subsequent function calls.
  546. */
  547. void *msm_dba_register_client(struct msm_dba_reg_info *info,
  548. struct msm_dba_ops *ops);
  549. /**
  550. * msm_dba_deregister_client() - Allows client to de-register with the driver.
  551. * @client: client handle returned by register API.
  552. *
  553. * This function will release all the resources used by a particular client. If
  554. * it is the only client using the bridge chip, the bridge chip will be powered
  555. * down and put into reset.
  556. */
  557. int msm_dba_deregister_client(void *client);
  558. #endif /* _MSM_DBA_H */