2016-03-28 16:34:27 -07:00
|
|
|
/* include/linux/msm_ext_display.h
|
2013-08-25 00:54:42 -07:00
|
|
|
*
|
2016-03-28 16:34:27 -07:00
|
|
|
* Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
|
2013-08-25 00:54:42 -07:00
|
|
|
*
|
2016-05-27 14:48:14 +05:30
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 and
|
|
|
|
* only version 2 as published by the Free Software Foundation.
|
2013-08-25 00:54:42 -07:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*/
|
2016-03-28 16:34:27 -07:00
|
|
|
#ifndef _MSM_EXT_DISPLAY_H_
|
|
|
|
#define _MSM_EXT_DISPLAY_H_
|
2013-08-25 00:54:42 -07:00
|
|
|
|
2014-03-26 18:22:37 -07:00
|
|
|
#include <linux/device.h>
|
|
|
|
#include <linux/platform_device.h>
|
|
|
|
|
2013-08-25 00:54:42 -07:00
|
|
|
/*
|
2016-03-28 16:34:27 -07:00
|
|
|
* External display cable notify handler structure.
|
2013-08-25 00:54:42 -07:00
|
|
|
* link A link for the linked list
|
2016-03-28 16:34:27 -07:00
|
|
|
* status Current status of HDMI/DP cable connection
|
2013-08-25 00:54:42 -07:00
|
|
|
* hpd_notify Callback function to provide cable status
|
|
|
|
*/
|
2016-03-28 16:34:27 -07:00
|
|
|
struct ext_disp_cable_notify {
|
2013-08-25 00:54:42 -07:00
|
|
|
struct list_head link;
|
|
|
|
int status;
|
2016-03-28 16:34:27 -07:00
|
|
|
void (*hpd_notify)(struct ext_disp_cable_notify *h);
|
2013-08-25 00:54:42 -07:00
|
|
|
};
|
|
|
|
|
2016-03-28 16:34:27 -07:00
|
|
|
struct msm_ext_disp_audio_edid_blk {
|
2014-03-26 18:22:37 -07:00
|
|
|
u8 *audio_data_blk;
|
|
|
|
unsigned int audio_data_blk_size; /* in bytes */
|
|
|
|
u8 *spk_alloc_data_blk;
|
|
|
|
unsigned int spk_alloc_data_blk_size; /* in bytes */
|
|
|
|
};
|
|
|
|
|
2016-03-28 16:34:27 -07:00
|
|
|
struct msm_ext_disp_audio_setup_params {
|
2015-10-14 16:28:04 -07:00
|
|
|
u32 sample_rate_hz;
|
|
|
|
u32 num_of_channels;
|
|
|
|
u32 channel_allocation;
|
|
|
|
u32 level_shift;
|
|
|
|
bool down_mix;
|
|
|
|
u32 sample_present;
|
|
|
|
};
|
|
|
|
|
2016-03-28 16:34:27 -07:00
|
|
|
struct msm_ext_disp_audio_codec_ops {
|
2014-03-26 18:22:37 -07:00
|
|
|
int (*audio_info_setup)(struct platform_device *pdev,
|
2016-03-28 16:34:27 -07:00
|
|
|
struct msm_ext_disp_audio_setup_params *params);
|
|
|
|
int (*get_audio_edid_blk)(struct platform_device *pdev,
|
|
|
|
struct msm_ext_disp_audio_edid_blk *blk);
|
|
|
|
int (*cable_status)(struct platform_device *pdev, u32 vote);
|
2014-03-26 18:22:37 -07:00
|
|
|
};
|
|
|
|
|
2016-03-28 16:34:27 -07:00
|
|
|
#ifdef CONFIG_FB_MSM_MDSS_DP_PANEL
|
|
|
|
int msm_dp_register_audio_codec(struct platform_device *pdev,
|
|
|
|
struct msm_ext_disp_audio_codec_ops *ops);
|
|
|
|
|
|
|
|
#else
|
|
|
|
static inline int msm_dp_register_audio_codec(struct platform_device *pdev,
|
|
|
|
struct msm_ext_disp_audio_codec_ops *ops) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif /* CONFIG_FB_MSM_MDSS_DP_PANEL */
|
2013-08-25 00:54:42 -07:00
|
|
|
#ifdef CONFIG_FB_MSM_MDSS_HDMI_PANEL
|
|
|
|
/*
|
|
|
|
* Register for HDMI cable connect or disconnect notification.
|
|
|
|
* @param handler callback handler for notification
|
|
|
|
* @return negative value as error otherwise current status of cable
|
|
|
|
*/
|
|
|
|
int register_hdmi_cable_notification(
|
2016-03-28 16:34:27 -07:00
|
|
|
struct ext_disp_cable_notify *handler);
|
2013-08-25 00:54:42 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Un-register for HDMI cable connect or disconnect notification.
|
|
|
|
* @param handler callback handler for notification
|
|
|
|
* @return negative value as error
|
|
|
|
*/
|
|
|
|
int unregister_hdmi_cable_notification(
|
2016-03-28 16:34:27 -07:00
|
|
|
struct ext_disp_cable_notify *handler);
|
2014-03-26 18:22:37 -07:00
|
|
|
|
|
|
|
int msm_hdmi_register_audio_codec(struct platform_device *pdev,
|
2016-03-28 16:34:27 -07:00
|
|
|
struct msm_ext_disp_audio_codec_ops *ops);
|
2014-03-26 18:22:37 -07:00
|
|
|
|
2013-08-25 00:54:42 -07:00
|
|
|
#else
|
2014-03-26 18:22:37 -07:00
|
|
|
static inline int register_hdmi_cable_notification(
|
2016-03-28 16:34:27 -07:00
|
|
|
struct ext_disp_cable_notify *handler) {
|
2013-08-25 00:54:42 -07:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-03-26 18:22:37 -07:00
|
|
|
static inline int unregister_hdmi_cable_notification(
|
2016-03-28 16:34:27 -07:00
|
|
|
struct ext_disp_cable_notify *handler) {
|
2013-08-25 00:54:42 -07:00
|
|
|
return 0;
|
|
|
|
}
|
2014-03-26 18:22:37 -07:00
|
|
|
|
|
|
|
static inline int msm_hdmi_register_audio_codec(struct platform_device *pdev,
|
2016-03-28 16:34:27 -07:00
|
|
|
struct msm_ext_disp_audio_codec_ops *ops) {
|
2014-03-26 18:22:37 -07:00
|
|
|
return 0;
|
|
|
|
}
|
2013-08-25 00:54:42 -07:00
|
|
|
#endif /* CONFIG_FB_MSM_MDSS_HDMI_PANEL */
|
|
|
|
|
2016-03-28 16:34:27 -07:00
|
|
|
#endif /*_MSM_EXT_DISPLAY_H_*/
|