summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/msm_ext_display.h96
-rwxr-xr-xinclude/uapi/linux/mfd/wcd9xxx/Kbuild1
-rw-r--r--[-rwxr-xr-x]include/uapi/linux/mfd/wcd9xxx/wcd9xxx_registers.h (renamed from include/linux/mfd/wcd9xxx/wcd9xxx_registers.h)11
3 files changed, 103 insertions, 5 deletions
diff --git a/include/linux/msm_ext_display.h b/include/linux/msm_ext_display.h
index c0a506fa66ec..81a95657a719 100644
--- a/include/linux/msm_ext_display.h
+++ b/include/linux/msm_ext_display.h
@@ -17,11 +17,15 @@
#include <linux/device.h>
#include <linux/platform_device.h>
-/*
- * External display cable notify handler structure.
- * link A link for the linked list
- * status Current status of HDMI/DP cable connection
- * hpd_notify Callback function to provide cable status
+#define AUDIO_ACK_SET_ENABLE BIT(5)
+#define AUDIO_ACK_ENABLE BIT(4)
+#define AUDIO_ACK_CONNECT BIT(0)
+
+/**
+ * struct ext_disp_cable_notify - cable notify handler structure
+ * @link: a link for the linked list
+ * @status: current status of HDMI/DP cable connection
+ * @hpd_notify: callback function to provide cable status
*/
struct ext_disp_cable_notify {
struct list_head link;
@@ -45,14 +49,96 @@ struct msm_ext_disp_audio_setup_params {
u32 sample_present;
};
+/**
+ * External Display identifier for use to determine which interface
+ * the audio driver is interacting with.
+ */
+enum msm_ext_disp_type {
+ EXT_DISPLAY_TYPE_HDMI,
+ EXT_DISPLAY_TYPE_DP,
+ EXT_DISPLAY_TYPE_MAX
+};
+
+/**
+ * External Display cable state used by display interface to indicate
+ * connect/disconnect of interface.
+ */
+enum msm_ext_disp_cable_state {
+ EXT_DISPLAY_CABLE_DISCONNECT,
+ EXT_DISPLAY_CABLE_CONNECT,
+ EXT_DISPLAY_CABLE_STATE_MAX
+};
+
+/**
+ * External Display power state used by display interface to indicate
+ * power on/off of the interface.
+ */
+enum msm_ext_disp_power_state {
+ EXT_DISPLAY_POWER_OFF,
+ EXT_DISPLAY_POWER_ON,
+ EXT_DISPLAY_POWER_MAX
+};
+
+/**
+ * struct msm_ext_disp_intf_ops - operations exposed to display interface
+ * @hpd: updates external display interface state
+ * @notify: updates audio framework with interface state
+ */
+struct msm_ext_disp_intf_ops {
+ int (*hpd)(struct platform_device *pdev,
+ enum msm_ext_disp_type type,
+ enum msm_ext_disp_cable_state state);
+ int (*notify)(struct platform_device *pdev,
+ enum msm_ext_disp_cable_state state);
+ int (*ack)(struct platform_device *pdev,
+ u32 ack);
+};
+
+/**
+ * struct msm_ext_disp_audio_codec_ops - operations exposed to audio codec
+ * @audio_info_setup: configure audio on interface
+ * @get_audio_edid_blk: retrieve audio edid block
+ * @cable_status: cable connected/disconnected
+ * @get_intf_id: id of connected interface
+ */
struct msm_ext_disp_audio_codec_ops {
int (*audio_info_setup)(struct platform_device *pdev,
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);
+ int (*get_intf_id)(struct platform_device *pdev);
+};
+
+/*
+ * struct msm_ext_disp_init_data - data needed to register the display interface
+ * @disp: external display type
+ * @intf_ops: external display interface operations
+ * @codec_ops: audio codec operations
+ */
+struct msm_ext_disp_init_data {
+ enum msm_ext_disp_type type;
+ struct kobject *kobj;
+ struct msm_ext_disp_intf_ops intf_ops;
+ struct msm_ext_disp_audio_codec_ops codec_ops;
};
+/*
+ * msm_ext_disp_register_audio_codec() - audio codec registration
+ * @pdev: platform device pointer
+ * @codec_ops: audio codec operations
+ */
+int msm_ext_disp_register_audio_codec(struct platform_device *pdev,
+ struct msm_ext_disp_audio_codec_ops *ops);
+
+/*
+ * msm_ext_disp_register_intf() - display interface registration
+ * @init_data: data needed to register the display interface
+ */
+int msm_ext_disp_register_intf(struct platform_device *pdev,
+ struct msm_ext_disp_init_data *init_data);
+
+/* TODO: remove all the display specific functions below */
#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);
diff --git a/include/uapi/linux/mfd/wcd9xxx/Kbuild b/include/uapi/linux/mfd/wcd9xxx/Kbuild
index da9fe03b0bed..8e55965bbe7e 100755
--- a/include/uapi/linux/mfd/wcd9xxx/Kbuild
+++ b/include/uapi/linux/mfd/wcd9xxx/Kbuild
@@ -1 +1,2 @@
+header-y += wcd9xxx_registers.h
header-y += wcd9320_registers.h
diff --git a/include/linux/mfd/wcd9xxx/wcd9xxx_registers.h b/include/uapi/linux/mfd/wcd9xxx/wcd9xxx_registers.h
index 1dac14bd8427..a9fe10d8cd6e 100755..100644
--- a/include/linux/mfd/wcd9xxx/wcd9xxx_registers.h
+++ b/include/uapi/linux/mfd/wcd9xxx/wcd9xxx_registers.h
@@ -330,6 +330,8 @@
#define WCD9XXX_A_ANA_HPH (0x609)
#define WCD9XXX_A_CDC_CLSH_CRC (0xC01)
#define WCD9XXX_FLYBACK_EN (0x6A4)
+#define WCD9XXX_FLYBACK_VNEG_CTRL_1 (0x6A5)
+#define WCD9XXX_FLYBACK_VNEGDAC_CTRL_2 (0x6AF)
#define WCD9XXX_RX_BIAS_FLYB_BUFF (0x6C7)
#define WCD9XXX_HPH_L_EN (0x6D3)
#define WCD9XXX_HPH_R_EN (0x6D6)
@@ -341,4 +343,13 @@
#define WCD9XXX_CDC_RX2_RX_PATH_CTL (0xB69)
#define WCD9XXX_CDC_CLK_RST_CTRL_MCLK_CONTROL (0xD41)
#define WCD9XXX_CLASSH_CTRL_CCL_1 (0x69C)
+
+/* RX Gain control registers of codecs from and above WCD9335 */
+#define WCD9XXX_CDC_RX1_RX_VOL_CTL (0xB59)
+#define WCD9XXX_CDC_RX1_RX_VOL_MIX_CTL (0xB5C)
+#define WCD9XXX_CDC_RX1_RX_PATH_SEC1 (0xB5E)
+#define WCD9XXX_CDC_RX2_RX_VOL_CTL (0xB6D)
+#define WCD9XXX_CDC_RX2_RX_VOL_MIX_CTL (0xB70)
+#define WCD9XXX_CDC_RX2_RX_PATH_SEC1 (0xB72)
+
#endif