Sachin Bhayare | eeb8889 | 2018-01-02 16:36:01 +0530 | [diff] [blame] | 1 | /* include/linux/msm_hdmi.h |
| 2 | * |
| 3 | <<<<<<< HEAD |
| 4 | * Copyright (c) 2014-2015, 2018, The Linux Foundation. All rights reserved. |
| 5 | ======= |
| 6 | * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. |
| 7 | >>>>>>> dfa46f9... fbdev: msm: fix compilation error |
| 8 | * |
| 9 | * This software is licensed under the terms of the GNU General Public |
| 10 | * License version 2, as published by the Free Software Foundation, and |
| 11 | * may be copied, distributed, and modified under those terms. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | */ |
| 18 | #ifndef _MSM_HDMI_H_ |
| 19 | #define _MSM_HDMI_H_ |
| 20 | |
| 21 | #include <linux/device.h> |
| 22 | #include <linux/platform_device.h> |
| 23 | |
| 24 | /* |
| 25 | * HDMI cable notify handler structure. |
| 26 | * link A link for the linked list |
| 27 | * status Current status of HDMI cable connection |
| 28 | * hpd_notify Callback function to provide cable status |
| 29 | */ |
| 30 | struct hdmi_cable_notify { |
| 31 | struct list_head link; |
| 32 | int status; |
| 33 | void (*hpd_notify)(struct hdmi_cable_notify *h); |
| 34 | }; |
| 35 | |
| 36 | struct msm_hdmi_audio_edid_blk { |
| 37 | u8 *audio_data_blk; |
| 38 | unsigned int audio_data_blk_size; /* in bytes */ |
| 39 | u8 *spk_alloc_data_blk; |
| 40 | unsigned int spk_alloc_data_blk_size; /* in bytes */ |
| 41 | }; |
| 42 | |
| 43 | struct msm_hdmi_audio_setup_params { |
| 44 | u32 sample_rate_hz; |
| 45 | u32 num_of_channels; |
| 46 | u32 channel_allocation; |
| 47 | u32 level_shift; |
| 48 | bool down_mix; |
| 49 | u32 sample_present; |
| 50 | }; |
| 51 | |
| 52 | struct msm_hdmi_audio_codec_ops { |
| 53 | int (*audio_info_setup)(struct platform_device *pdev, |
| 54 | struct msm_hdmi_audio_setup_params *params); |
| 55 | int (*get_audio_edid_blk)(struct platform_device *pdev, |
| 56 | struct msm_hdmi_audio_edid_blk *blk); |
| 57 | int (*hdmi_cable_status)(struct platform_device *pdev, u32 vote); |
| 58 | }; |
| 59 | |
| 60 | #ifdef CONFIG_FB_MSM_MDSS_HDMI_PANEL |
| 61 | /* |
| 62 | * Register for HDMI cable connect or disconnect notification. |
| 63 | * @param handler callback handler for notification |
| 64 | * @return negative value as error otherwise current status of cable |
| 65 | */ |
| 66 | int register_hdmi_cable_notification( |
| 67 | struct hdmi_cable_notify *handler); |
| 68 | |
| 69 | /* |
| 70 | * Un-register for HDMI cable connect or disconnect notification. |
| 71 | * @param handler callback handler for notification |
| 72 | * @return negative value as error |
| 73 | */ |
| 74 | int unregister_hdmi_cable_notification( |
| 75 | struct hdmi_cable_notify *handler); |
| 76 | |
| 77 | int msm_hdmi_register_audio_codec(struct platform_device *pdev, |
| 78 | struct msm_hdmi_audio_codec_ops *ops); |
| 79 | |
| 80 | #else |
| 81 | static inline int register_hdmi_cable_notification( |
| 82 | struct hdmi_cable_notify *handler) { |
| 83 | return 0; |
| 84 | } |
| 85 | |
| 86 | static inline int unregister_hdmi_cable_notification( |
| 87 | struct hdmi_cable_notify *handler) { |
| 88 | return 0; |
| 89 | } |
| 90 | |
| 91 | static inline int msm_hdmi_register_audio_codec(struct platform_device *pdev, |
| 92 | struct msm_hdmi_audio_codec_ops *ops) { |
| 93 | return 0; |
| 94 | } |
| 95 | #endif /* CONFIG_FB_MSM_MDSS_HDMI_PANEL */ |
| 96 | |
| 97 | #endif /*_MSM_HDMI_H_*/ |