xref: /openbmc/linux/include/sound/cs35l35.h (revision d2c43ff1)
1 /*
2  * linux/sound/cs35l35.h -- Platform data for CS35l35
3  *
4  * Copyright (c) 2016 Cirrus Logic Inc.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  */
10 
11 #ifndef __CS35L35_H
12 #define __CS35L35_H
13 
14 struct classh_cfg {
15 	/*
16 	 * Class H Algorithm Control Variables
17 	 * You can either have it done
18 	 * automatically or you can adjust
19 	 * these variables for tuning
20 	 *
21 	 * if you do not enable the internal algorithm
22 	 * you will get a set of mixer controls for
23 	 * Class H tuning
24 	 *
25 	 * Section 4.3 of the datasheet
26 	 */
27 	bool classh_bst_override;
28 	bool classh_algo_enable;
29 	int classh_bst_max_limit;
30 	int classh_mem_depth;
31 	int classh_release_rate;
32 	int classh_headroom;
33 	int classh_wk_fet_disable;
34 	int classh_wk_fet_delay;
35 	int classh_wk_fet_thld;
36 	int classh_vpch_auto;
37 	int classh_vpch_rate;
38 	int classh_vpch_man;
39 };
40 
41 struct monitor_cfg {
42 	/*
43 	 * Signal Monitor Data
44 	 * highly configurable signal monitoring
45 	 * data positioning and different types of
46 	 * monitoring data.
47 	 *
48 	 * Section 4.8.2 - 4.8.4 of the datasheet
49 	 */
50 	bool is_present;
51 	bool imon_specs;
52 	bool vmon_specs;
53 	bool vpmon_specs;
54 	bool vbstmon_specs;
55 	bool vpbrstat_specs;
56 	bool zerofill_specs;
57 	u8 imon_dpth;
58 	u8 imon_loc;
59 	u8 imon_frm;
60 	u8 imon_scale;
61 	u8 vmon_dpth;
62 	u8 vmon_loc;
63 	u8 vmon_frm;
64 	u8 vpmon_dpth;
65 	u8 vpmon_loc;
66 	u8 vpmon_frm;
67 	u8 vbstmon_dpth;
68 	u8 vbstmon_loc;
69 	u8 vbstmon_frm;
70 	u8 vpbrstat_dpth;
71 	u8 vpbrstat_loc;
72 	u8 vpbrstat_frm;
73 	u8 zerofill_dpth;
74 	u8 zerofill_loc;
75 	u8 zerofill_frm;
76 };
77 
78 struct cs35l35_platform_data {
79 
80 	/* Stereo (2 Device) */
81 	bool stereo;
82 	/* serial port drive strength */
83 	int sp_drv_str;
84 	/* serial port drive in unused slots */
85 	int sp_drv_unused;
86 	/* Boost Power Down with FET */
87 	bool bst_pdn_fet_on;
88 	/* Boost Voltage : used if ClassH Algo Enabled */
89 	int bst_vctl;
90 	/* Boost Converter Peak Current CTRL */
91 	int bst_ipk;
92 	/* Amp Gain Zero Cross */
93 	bool gain_zc;
94 	/* Audio Input Location */
95 	int aud_channel;
96 	/* Advisory Input Location */
97 	int adv_channel;
98 	/* Shared Boost for stereo */
99 	bool shared_bst;
100 	/* Specifies this amp is using an external boost supply */
101 	bool ext_bst;
102 	/* Inductor Value */
103 	int boost_ind;
104 	/* ClassH Algorithm */
105 	struct classh_cfg classh_algo;
106 	/* Monitor Config */
107 	struct monitor_cfg mon_cfg;
108 };
109 
110 #endif /* __CS35L35_H */
111