summaryrefslogtreecommitdiff
path: root/cs40l25/include/linux/mfd/cs40l25-wavetable.h
blob: 2b35db3892d33feba70a53554bf8f83c6c8dd6fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * CS40L20/CS40L25/CS40L25A/CS40L25B Wavetable Definitions
 *
 *
 * Copyright (C) 2020-2021 Cirrus Logic, Inc. and
 *                         Cirrus Logic International Semiconductor Ltd.
 */

#ifndef CS40L25_WAVETABLE_H
#define CS40L25_WAVETABLE_H

#define WT_WAVELEN_MAX		0x3FFFFF
#define WT_WAVELEN_INDEFINITE	0x400000
#define WT_WAVELEN_CALCULATED	0x800000

#define WT_REPEAT_LOOP_MARKER	0xFF

#define WT_MAX_SECTIONS		255

#define WT_T10_FLAG_DURATION	0x8

struct wt_type10_comp_section {
	u8 amplitude;
	u8 index;
	u8 repeat;
	u8 flags;
	u16 delay;
	u16 duration;
};

struct wt_type10_comp {
	u32 wlength;
	u8 nsections;
	u8 repeat;

	struct wt_type10_comp_section sections[WT_MAX_SECTIONS];
};

#define WT_T12_FLAG_CHIRP	BIT(7)
#define WT_T12_FLAG_BRAKE	BIT(6)
#define WT_T12_FLAG_AMP_REG	BIT(5)

struct wt_type12_pwle_section {
	u16 time;
	u16 level;
	u16 frequency;
	u8 flags;
	u32 vbtarget;
};

struct wt_type12_pwle {
	u32 wlength;
	u8 repeat;
	u16 wait;
	u8 nsections;

	struct wt_type12_pwle_section sections[WT_MAX_SECTIONS];
};

#endif