1d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
22c394ca7SJames Schulman /*
32c394ca7SJames Schulman  * cs42l42.h -- CS42L42 ALSA SoC audio driver DT bindings header
42c394ca7SJames Schulman  *
52c394ca7SJames Schulman  * Copyright 2016 Cirrus Logic, Inc.
62c394ca7SJames Schulman  *
72c394ca7SJames Schulman  * Author: James Schulman <james.schulman@cirrus.com>
82c394ca7SJames Schulman  * Author: Brian Austin <brian.austin@cirrus.com>
92c394ca7SJames Schulman  * Author: Michael White <michael.white@cirrus.com>
102c394ca7SJames Schulman  */
112c394ca7SJames Schulman 
122c394ca7SJames Schulman #ifndef __DT_CS42L42_H
132c394ca7SJames Schulman #define __DT_CS42L42_H
142c394ca7SJames Schulman 
152c394ca7SJames Schulman /* HPOUT Load Capacity */
162c394ca7SJames Schulman #define CS42L42_HPOUT_LOAD_1NF		0
172c394ca7SJames Schulman #define CS42L42_HPOUT_LOAD_10NF		1
182c394ca7SJames Schulman 
19505d3085SMasahiro Yamada /* HPOUT Clamp to GND Override */
202c394ca7SJames Schulman #define CS42L42_HPOUT_CLAMP_EN		0
212c394ca7SJames Schulman #define CS42L42_HPOUT_CLAMP_DIS		1
222c394ca7SJames Schulman 
232c394ca7SJames Schulman /* Tip Sense Inversion */
242c394ca7SJames Schulman #define CS42L42_TS_INV_DIS			0
252c394ca7SJames Schulman #define CS42L42_TS_INV_EN			1
262c394ca7SJames Schulman 
272c394ca7SJames Schulman /* Tip Sense Debounce */
282c394ca7SJames Schulman #define CS42L42_TS_DBNCE_0			0
292c394ca7SJames Schulman #define CS42L42_TS_DBNCE_125			1
302c394ca7SJames Schulman #define CS42L42_TS_DBNCE_250			2
312c394ca7SJames Schulman #define CS42L42_TS_DBNCE_500			3
322c394ca7SJames Schulman #define CS42L42_TS_DBNCE_750			4
332c394ca7SJames Schulman #define CS42L42_TS_DBNCE_1000			5
342c394ca7SJames Schulman #define CS42L42_TS_DBNCE_1250			6
352c394ca7SJames Schulman #define CS42L42_TS_DBNCE_1500			7
362c394ca7SJames Schulman 
372c394ca7SJames Schulman /* Button Press Software Debounce Times */
382c394ca7SJames Schulman #define CS42L42_BTN_DET_INIT_DBNCE_MIN		0
392c394ca7SJames Schulman #define CS42L42_BTN_DET_INIT_DBNCE_DEFAULT	100
402c394ca7SJames Schulman #define CS42L42_BTN_DET_INIT_DBNCE_MAX		200
412c394ca7SJames Schulman 
422c394ca7SJames Schulman #define CS42L42_BTN_DET_EVENT_DBNCE_MIN		0
432c394ca7SJames Schulman #define CS42L42_BTN_DET_EVENT_DBNCE_DEFAULT	10
442c394ca7SJames Schulman #define CS42L42_BTN_DET_EVENT_DBNCE_MAX		20
452c394ca7SJames Schulman 
462c394ca7SJames Schulman /* Button Detect Level Sensitivities */
472c394ca7SJames Schulman #define CS42L42_NUM_BIASES		4
482c394ca7SJames Schulman 
492c394ca7SJames Schulman #define CS42L42_HS_DET_LEVEL_15		0x0F
502c394ca7SJames Schulman #define CS42L42_HS_DET_LEVEL_8		0x08
512c394ca7SJames Schulman #define CS42L42_HS_DET_LEVEL_4		0x04
522c394ca7SJames Schulman #define CS42L42_HS_DET_LEVEL_1		0x01
532c394ca7SJames Schulman 
542c394ca7SJames Schulman #define CS42L42_HS_DET_LEVEL_MIN	0
552c394ca7SJames Schulman #define CS42L42_HS_DET_LEVEL_MAX	0x3F
562c394ca7SJames Schulman 
572c394ca7SJames Schulman /* HS Bias Ramp Rate */
582c394ca7SJames Schulman 
592c394ca7SJames Schulman #define CS42L42_HSBIAS_RAMP_FAST_RISE_SLOW_FALL		0
602c394ca7SJames Schulman #define CS42L42_HSBIAS_RAMP_FAST			1
612c394ca7SJames Schulman #define CS42L42_HSBIAS_RAMP_SLOW			2
622c394ca7SJames Schulman #define CS42L42_HSBIAS_RAMP_SLOWEST			3
632c394ca7SJames Schulman 
642c394ca7SJames Schulman #define CS42L42_HSBIAS_RAMP_TIME0			10
652c394ca7SJames Schulman #define CS42L42_HSBIAS_RAMP_TIME1			40
662c394ca7SJames Schulman #define CS42L42_HSBIAS_RAMP_TIME2			90
672c394ca7SJames Schulman #define CS42L42_HSBIAS_RAMP_TIME3			170
682c394ca7SJames Schulman 
692c394ca7SJames Schulman #endif /* __DT_CS42L42_H */
70