162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * cs42l42.h -- CS42L42 ALSA SoC audio driver DT bindings header
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright 2016 Cirrus Logic, Inc.
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * Author: James Schulman <james.schulman@cirrus.com>
862306a36Sopenharmony_ci * Author: Brian Austin <brian.austin@cirrus.com>
962306a36Sopenharmony_ci * Author: Michael White <michael.white@cirrus.com>
1062306a36Sopenharmony_ci */
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#ifndef __DT_CS42L42_H
1362306a36Sopenharmony_ci#define __DT_CS42L42_H
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci/* HPOUT Load Capacity */
1662306a36Sopenharmony_ci#define CS42L42_HPOUT_LOAD_1NF		0
1762306a36Sopenharmony_ci#define CS42L42_HPOUT_LOAD_10NF		1
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci/* HPOUT Clamp to GND Override */
2062306a36Sopenharmony_ci#define CS42L42_HPOUT_CLAMP_EN		0
2162306a36Sopenharmony_ci#define CS42L42_HPOUT_CLAMP_DIS		1
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci/* Tip Sense Inversion */
2462306a36Sopenharmony_ci#define CS42L42_TS_INV_DIS			0
2562306a36Sopenharmony_ci#define CS42L42_TS_INV_EN			1
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci/* Tip Sense Debounce */
2862306a36Sopenharmony_ci#define CS42L42_TS_DBNCE_0			0
2962306a36Sopenharmony_ci#define CS42L42_TS_DBNCE_125			1
3062306a36Sopenharmony_ci#define CS42L42_TS_DBNCE_250			2
3162306a36Sopenharmony_ci#define CS42L42_TS_DBNCE_500			3
3262306a36Sopenharmony_ci#define CS42L42_TS_DBNCE_750			4
3362306a36Sopenharmony_ci#define CS42L42_TS_DBNCE_1000			5
3462306a36Sopenharmony_ci#define CS42L42_TS_DBNCE_1250			6
3562306a36Sopenharmony_ci#define CS42L42_TS_DBNCE_1500			7
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci/* Button Press Software Debounce Times */
3862306a36Sopenharmony_ci#define CS42L42_BTN_DET_INIT_DBNCE_MIN		0
3962306a36Sopenharmony_ci#define CS42L42_BTN_DET_INIT_DBNCE_DEFAULT	100
4062306a36Sopenharmony_ci#define CS42L42_BTN_DET_INIT_DBNCE_MAX		200
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ci#define CS42L42_BTN_DET_EVENT_DBNCE_MIN		0
4362306a36Sopenharmony_ci#define CS42L42_BTN_DET_EVENT_DBNCE_DEFAULT	10
4462306a36Sopenharmony_ci#define CS42L42_BTN_DET_EVENT_DBNCE_MAX		20
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci/* Button Detect Level Sensitivities */
4762306a36Sopenharmony_ci#define CS42L42_NUM_BIASES		4
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci#define CS42L42_HS_DET_LEVEL_15		0x0F
5062306a36Sopenharmony_ci#define CS42L42_HS_DET_LEVEL_8		0x08
5162306a36Sopenharmony_ci#define CS42L42_HS_DET_LEVEL_4		0x04
5262306a36Sopenharmony_ci#define CS42L42_HS_DET_LEVEL_1		0x01
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ci#define CS42L42_HS_DET_LEVEL_MIN	0
5562306a36Sopenharmony_ci#define CS42L42_HS_DET_LEVEL_MAX	0x3F
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci/* HS Bias Ramp Rate */
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci#define CS42L42_HSBIAS_RAMP_FAST_RISE_SLOW_FALL		0
6062306a36Sopenharmony_ci#define CS42L42_HSBIAS_RAMP_FAST			1
6162306a36Sopenharmony_ci#define CS42L42_HSBIAS_RAMP_SLOW			2
6262306a36Sopenharmony_ci#define CS42L42_HSBIAS_RAMP_SLOWEST			3
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ci#define CS42L42_HSBIAS_RAMP_TIME0			10
6562306a36Sopenharmony_ci#define CS42L42_HSBIAS_RAMP_TIME1			40
6662306a36Sopenharmony_ci#define CS42L42_HSBIAS_RAMP_TIME2			90
6762306a36Sopenharmony_ci#define CS42L42_HSBIAS_RAMP_TIME3			170
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ci#endif /* __DT_CS42L42_H */
70