16387f866SBrian Austin /* 26387f866SBrian Austin * linux/sound/cs35l35.h -- Platform data for CS35l35 36387f866SBrian Austin * 46387f866SBrian Austin * Copyright (c) 2016 Cirrus Logic Inc. 56387f866SBrian Austin * 66387f866SBrian Austin * This program is free software; you can redistribute it and/or modify 76387f866SBrian Austin * it under the terms of the GNU General Public License version 2 as 86387f866SBrian Austin * published by the Free Software Foundation. 96387f866SBrian Austin */ 106387f866SBrian Austin 116387f866SBrian Austin #ifndef __CS35L35_H 126387f866SBrian Austin #define __CS35L35_H 136387f866SBrian Austin 146387f866SBrian Austin struct classh_cfg { 156387f866SBrian Austin /* 166387f866SBrian Austin * Class H Algorithm Control Variables 176387f866SBrian Austin * You can either have it done 186387f866SBrian Austin * automatically or you can adjust 196387f866SBrian Austin * these variables for tuning 206387f866SBrian Austin * 216387f866SBrian Austin * if you do not enable the internal algorithm 226387f866SBrian Austin * you will get a set of mixer controls for 236387f866SBrian Austin * Class H tuning 246387f866SBrian Austin * 256387f866SBrian Austin * Section 4.3 of the datasheet 266387f866SBrian Austin */ 276387f866SBrian Austin bool classh_bst_override; 286387f866SBrian Austin bool classh_algo_enable; 296387f866SBrian Austin int classh_bst_max_limit; 306387f866SBrian Austin int classh_mem_depth; 316387f866SBrian Austin int classh_release_rate; 326387f866SBrian Austin int classh_headroom; 336387f866SBrian Austin int classh_wk_fet_disable; 346387f866SBrian Austin int classh_wk_fet_delay; 356387f866SBrian Austin int classh_wk_fet_thld; 366387f866SBrian Austin int classh_vpch_auto; 376387f866SBrian Austin int classh_vpch_rate; 386387f866SBrian Austin int classh_vpch_man; 396387f866SBrian Austin }; 406387f866SBrian Austin 416387f866SBrian Austin struct monitor_cfg { 426387f866SBrian Austin /* 436387f866SBrian Austin * Signal Monitor Data 446387f866SBrian Austin * highly configurable signal monitoring 456387f866SBrian Austin * data positioning and different types of 466387f866SBrian Austin * monitoring data. 476387f866SBrian Austin * 486387f866SBrian Austin * Section 4.8.2 - 4.8.4 of the datasheet 496387f866SBrian Austin */ 506387f866SBrian Austin bool is_present; 516387f866SBrian Austin bool imon_specs; 526387f866SBrian Austin bool vmon_specs; 536387f866SBrian Austin bool vpmon_specs; 546387f866SBrian Austin bool vbstmon_specs; 556387f866SBrian Austin bool vpbrstat_specs; 566387f866SBrian Austin bool zerofill_specs; 576387f866SBrian Austin u8 imon_dpth; 586387f866SBrian Austin u8 imon_loc; 596387f866SBrian Austin u8 imon_frm; 6006bdf385SCharles Keepax u8 imon_scale; 616387f866SBrian Austin u8 vmon_dpth; 626387f866SBrian Austin u8 vmon_loc; 636387f866SBrian Austin u8 vmon_frm; 646387f866SBrian Austin u8 vpmon_dpth; 656387f866SBrian Austin u8 vpmon_loc; 666387f866SBrian Austin u8 vpmon_frm; 676387f866SBrian Austin u8 vbstmon_dpth; 686387f866SBrian Austin u8 vbstmon_loc; 696387f866SBrian Austin u8 vbstmon_frm; 706387f866SBrian Austin u8 vpbrstat_dpth; 716387f866SBrian Austin u8 vpbrstat_loc; 726387f866SBrian Austin u8 vpbrstat_frm; 736387f866SBrian Austin u8 zerofill_dpth; 746387f866SBrian Austin u8 zerofill_loc; 756387f866SBrian Austin u8 zerofill_frm; 766387f866SBrian Austin }; 776387f866SBrian Austin 786387f866SBrian Austin struct cs35l35_platform_data { 796387f866SBrian Austin 806387f866SBrian Austin /* Stereo (2 Device) */ 816387f866SBrian Austin bool stereo; 826387f866SBrian Austin /* serial port drive strength */ 836387f866SBrian Austin int sp_drv_str; 848d45f2d2SCharles Keepax /* serial port drive in unused slots */ 858d45f2d2SCharles Keepax int sp_drv_unused; 866387f866SBrian Austin /* Boost Power Down with FET */ 876387f866SBrian Austin bool bst_pdn_fet_on; 886387f866SBrian Austin /* Boost Voltage : used if ClassH Algo Enabled */ 896387f866SBrian Austin int bst_vctl; 906387f866SBrian Austin /* Boost Converter Peak Current CTRL */ 916387f866SBrian Austin int bst_ipk; 926387f866SBrian Austin /* Amp Gain Zero Cross */ 936387f866SBrian Austin bool gain_zc; 946387f866SBrian Austin /* Audio Input Location */ 956387f866SBrian Austin int aud_channel; 966387f866SBrian Austin /* Advisory Input Location */ 976387f866SBrian Austin int adv_channel; 986387f866SBrian Austin /* Shared Boost for stereo */ 996387f866SBrian Austin bool shared_bst; 10077b329d1SCharles Keepax /* Specifies this amp is using an external boost supply */ 10177b329d1SCharles Keepax bool ext_bst; 102b7c752d6SBrian Austin /* Inductor Value */ 103b7c752d6SBrian Austin int boost_ind; 1046387f866SBrian Austin /* ClassH Algorithm */ 1056387f866SBrian Austin struct classh_cfg classh_algo; 1066387f866SBrian Austin /* Monitor Config */ 1076387f866SBrian Austin struct monitor_cfg mon_cfg; 1086387f866SBrian Austin }; 1096387f866SBrian Austin 1106387f866SBrian Austin #endif /* __CS35L35_H */ 111