18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef WM8766_H_INCLUDED
38c2ecf20Sopenharmony_ci#define WM8766_H_INCLUDED
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#define WM8766_LDA1		0x00
68c2ecf20Sopenharmony_ci#define WM8766_RDA1		0x01
78c2ecf20Sopenharmony_ci#define WM8766_DAC_CTRL		0x02
88c2ecf20Sopenharmony_ci#define WM8766_INT_CTRL		0x03
98c2ecf20Sopenharmony_ci#define WM8766_LDA2		0x04
108c2ecf20Sopenharmony_ci#define WM8766_RDA2		0x05
118c2ecf20Sopenharmony_ci#define WM8766_LDA3		0x06
128c2ecf20Sopenharmony_ci#define WM8766_RDA3		0x07
138c2ecf20Sopenharmony_ci#define WM8766_MASTDA		0x08
148c2ecf20Sopenharmony_ci#define WM8766_DAC_CTRL2	0x09
158c2ecf20Sopenharmony_ci#define WM8766_DAC_CTRL3	0x0a
168c2ecf20Sopenharmony_ci#define WM8766_MUTE1		0x0c
178c2ecf20Sopenharmony_ci#define WM8766_MUTE2		0x0f
188c2ecf20Sopenharmony_ci#define WM8766_RESET		0x1f
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci/* LDAx/RDAx/MASTDA */
218c2ecf20Sopenharmony_ci#define WM8766_ATT_MASK		0x0ff
228c2ecf20Sopenharmony_ci#define WM8766_UPDATE		0x100
238c2ecf20Sopenharmony_ci/* DAC_CTRL */
248c2ecf20Sopenharmony_ci#define WM8766_MUTEALL		0x001
258c2ecf20Sopenharmony_ci#define WM8766_DEEMPALL		0x002
268c2ecf20Sopenharmony_ci#define WM8766_PWDN		0x004
278c2ecf20Sopenharmony_ci#define WM8766_ATC		0x008
288c2ecf20Sopenharmony_ci#define WM8766_IZD		0x010
298c2ecf20Sopenharmony_ci#define WM8766_PL_LEFT_MASK	0x060
308c2ecf20Sopenharmony_ci#define WM8766_PL_LEFT_MUTE	0x000
318c2ecf20Sopenharmony_ci#define WM8766_PL_LEFT_LEFT	0x020
328c2ecf20Sopenharmony_ci#define WM8766_PL_LEFT_RIGHT	0x040
338c2ecf20Sopenharmony_ci#define WM8766_PL_LEFT_LRMIX	0x060
348c2ecf20Sopenharmony_ci#define WM8766_PL_RIGHT_MASK	0x180
358c2ecf20Sopenharmony_ci#define WM8766_PL_RIGHT_MUTE	0x000
368c2ecf20Sopenharmony_ci#define WM8766_PL_RIGHT_LEFT	0x080
378c2ecf20Sopenharmony_ci#define WM8766_PL_RIGHT_RIGHT	0x100
388c2ecf20Sopenharmony_ci#define WM8766_PL_RIGHT_LRMIX	0x180
398c2ecf20Sopenharmony_ci/* INT_CTRL */
408c2ecf20Sopenharmony_ci#define WM8766_FMT_MASK		0x003
418c2ecf20Sopenharmony_ci#define WM8766_FMT_RJUST	0x000
428c2ecf20Sopenharmony_ci#define WM8766_FMT_LJUST	0x001
438c2ecf20Sopenharmony_ci#define WM8766_FMT_I2S		0x002
448c2ecf20Sopenharmony_ci#define WM8766_FMT_DSP		0x003
458c2ecf20Sopenharmony_ci#define WM8766_LRP		0x004
468c2ecf20Sopenharmony_ci#define WM8766_BCP		0x008
478c2ecf20Sopenharmony_ci#define WM8766_IWL_MASK		0x030
488c2ecf20Sopenharmony_ci#define WM8766_IWL_16		0x000
498c2ecf20Sopenharmony_ci#define WM8766_IWL_20		0x010
508c2ecf20Sopenharmony_ci#define WM8766_IWL_24		0x020
518c2ecf20Sopenharmony_ci#define WM8766_IWL_32		0x030
528c2ecf20Sopenharmony_ci#define WM8766_PHASE_MASK	0x1c0
538c2ecf20Sopenharmony_ci/* DAC_CTRL2 */
548c2ecf20Sopenharmony_ci#define WM8766_ZCD		0x001
558c2ecf20Sopenharmony_ci#define WM8766_DZFM_MASK	0x006
568c2ecf20Sopenharmony_ci#define WM8766_DMUTE_MASK	0x038
578c2ecf20Sopenharmony_ci#define WM8766_DEEMP_MASK	0x1c0
588c2ecf20Sopenharmony_ci/* DAC_CTRL3 */
598c2ecf20Sopenharmony_ci#define WM8766_DACPD_MASK	0x00e
608c2ecf20Sopenharmony_ci#define WM8766_PWRDNALL		0x010
618c2ecf20Sopenharmony_ci#define WM8766_MS		0x020
628c2ecf20Sopenharmony_ci#define WM8766_RATE_MASK	0x1c0
638c2ecf20Sopenharmony_ci#define WM8766_RATE_128		0x000
648c2ecf20Sopenharmony_ci#define WM8766_RATE_192		0x040
658c2ecf20Sopenharmony_ci#define WM8766_RATE_256		0x080
668c2ecf20Sopenharmony_ci#define WM8766_RATE_384		0x0c0
678c2ecf20Sopenharmony_ci#define WM8766_RATE_512		0x100
688c2ecf20Sopenharmony_ci#define WM8766_RATE_768		0x140
698c2ecf20Sopenharmony_ci/* MUTE1 */
708c2ecf20Sopenharmony_ci#define WM8766_MPD1		0x040
718c2ecf20Sopenharmony_ci/* MUTE2 */
728c2ecf20Sopenharmony_ci#define WM8766_MPD2		0x020
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci#endif
75