1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef __UAPI_MFD_MSM_ADIE_CODEC_H
20 #define __UAPI_MFD_MSM_ADIE_CODEC_H
21 #include <linux/types.h>
22 #define ADIE_CODEC_ACTION_ENTRY 0x1
23 #define ADIE_CODEC_ACTION_DELAY_WAIT 0x2
24 #define ADIE_CODEC_ACTION_STAGE_REACHED 0x3
25 #define ADIE_CODEC_PATH_OFF 0x0050
26 #define ADIE_CODEC_DIGITAL_READY 0x0100
27 #define ADIE_CODEC_DIGITAL_ANALOG_READY 0x1000
28 #define ADIE_CODEC_ANALOG_OFF 0x0750
29 #define ADIE_CODEC_DIGITAL_OFF 0x0600
30 #define ADIE_CODEC_FLASH_IMAGE 0x0001
31 #define ADIE_CODEC_RX 0
32 #define ADIE_CODEC_TX 1
33 #define ADIE_CODEC_LB 3
34 #define ADIE_CODEC_MAX 4
35 #define ADIE_CODEC_PACK_ENTRY(reg,mask,val) ((val) | (mask << 8) | (reg << 16))
36 #define ADIE_CODEC_UNPACK_ENTRY(packed,reg,mask,val) do { ((reg) = ((packed >> 16) & (0xff))); ((mask) = ((packed >> 8) & (0xff))); ((val) = ((packed) & (0xff))); } while(0);
37 struct adie_codec_action_unit {
38   u32 type;
39   u32 action;
40 };
41 struct adie_codec_hwsetting_entry {
42   struct adie_codec_action_unit * actions;
43   u32 action_sz;
44   u32 freq_plan;
45   u32 osr;
46 };
47 struct adie_codec_dev_profile {
48   u32 path_type;
49   u32 setting_sz;
50   struct adie_codec_hwsetting_entry * settings;
51 };
52 struct adie_codec_register {
53   u8 reg;
54   u8 mask;
55   u8 val;
56 };
57 struct adie_codec_register_image {
58   struct adie_codec_register * regs;
59   u32 img_sz;
60 };
61 struct adie_codec_path;
62 struct adie_codec_anc_data {
63   u32 size;
64   u32 writes[];
65 };
66 struct adie_codec_operations {
67   int codec_id;
68   int(* codec_open) (struct adie_codec_dev_profile * profile, struct adie_codec_path * * path_pptr);
69   int(* codec_close) (struct adie_codec_path * path_ptr);
70   int(* codec_setpath) (struct adie_codec_path * path_ptr, u32 freq_plan, u32 osr);
71   int(* codec_proceed_stage) (struct adie_codec_path * path_ptr, u32 state);
72   u32(* codec_freq_supported) (struct adie_codec_dev_profile * profile, u32 requested_freq);
73   int(* codec_enable_sidetone) (struct adie_codec_path * rx_path_ptr, u32 enable);
74   int(* codec_enable_anc) (struct adie_codec_path * rx_path_ptr, u32 enable, struct adie_codec_anc_data * calibration_writes);
75   int(* codec_set_device_digital_volume) (struct adie_codec_path * path_ptr, u32 num_channels, u32 vol_percentage);
76   int(* codec_set_device_analog_volume) (struct adie_codec_path * path_ptr, u32 num_channels, u32 volume);
77   int(* codec_set_master_mode) (struct adie_codec_path * path_ptr, u8 master);
78 };
79 #endif
80 
81