18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef CM9780_H_INCLUDED
38c2ecf20Sopenharmony_ci#define CM9780_H_INCLUDED
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#define CM9780_JACK		0x62
68c2ecf20Sopenharmony_ci#define CM9780_MIXER		0x64
78c2ecf20Sopenharmony_ci#define CM9780_GPIO_SETUP	0x70
88c2ecf20Sopenharmony_ci#define CM9780_GPIO_STATUS	0x72
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci/* jack control */
118c2ecf20Sopenharmony_ci#define CM9780_RSOE		0x0001
128c2ecf20Sopenharmony_ci#define CM9780_CBOE		0x0002
138c2ecf20Sopenharmony_ci#define CM9780_SSOE		0x0004
148c2ecf20Sopenharmony_ci#define CM9780_FROE		0x0008
158c2ecf20Sopenharmony_ci#define CM9780_HP2FMICOE	0x0010
168c2ecf20Sopenharmony_ci#define CM9780_CB2MICOE		0x0020
178c2ecf20Sopenharmony_ci#define CM9780_FMIC2LI		0x0040
188c2ecf20Sopenharmony_ci#define CM9780_FMIC2MIC		0x0080
198c2ecf20Sopenharmony_ci#define CM9780_HP2LI		0x0100
208c2ecf20Sopenharmony_ci#define CM9780_HP2MIC		0x0200
218c2ecf20Sopenharmony_ci#define CM9780_MIC2LI		0x0400
228c2ecf20Sopenharmony_ci#define CM9780_MIC2MIC		0x0800
238c2ecf20Sopenharmony_ci#define CM9780_LI2LI		0x1000
248c2ecf20Sopenharmony_ci#define CM9780_LI2MIC		0x2000
258c2ecf20Sopenharmony_ci#define CM9780_LO2LI		0x4000
268c2ecf20Sopenharmony_ci#define CM9780_LO2MIC		0x8000
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci/* mixer control */
298c2ecf20Sopenharmony_ci#define CM9780_BSTSEL		0x0001
308c2ecf20Sopenharmony_ci#define CM9780_STRO_MIC		0x0002
318c2ecf20Sopenharmony_ci#define CM9780_SPDI_FREX	0x0004
328c2ecf20Sopenharmony_ci#define CM9780_SPDI_SSEX	0x0008
338c2ecf20Sopenharmony_ci#define CM9780_SPDI_CBEX	0x0010
348c2ecf20Sopenharmony_ci#define CM9780_SPDI_RSEX	0x0020
358c2ecf20Sopenharmony_ci#define CM9780_MIX2FR		0x0040
368c2ecf20Sopenharmony_ci#define CM9780_MIX2SS		0x0080
378c2ecf20Sopenharmony_ci#define CM9780_MIX2CB		0x0100
388c2ecf20Sopenharmony_ci#define CM9780_MIX2RS		0x0200
398c2ecf20Sopenharmony_ci#define CM9780_MIX2FR_EX	0x0400
408c2ecf20Sopenharmony_ci#define CM9780_MIX2SS_EX	0x0800
418c2ecf20Sopenharmony_ci#define CM9780_MIX2CB_EX	0x1000
428c2ecf20Sopenharmony_ci#define CM9780_MIX2RS_EX	0x2000
438c2ecf20Sopenharmony_ci#define CM9780_P47_IO		0x4000
448c2ecf20Sopenharmony_ci#define CM9780_PCBSW		0x8000
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci/* GPIO setup */
478c2ecf20Sopenharmony_ci#define CM9780_GPI0EN		0x0001
488c2ecf20Sopenharmony_ci#define CM9780_GPI1EN		0x0002
498c2ecf20Sopenharmony_ci#define CM9780_SENSE_P		0x0004
508c2ecf20Sopenharmony_ci#define CM9780_LOCK_P		0x0008
518c2ecf20Sopenharmony_ci#define CM9780_GPIO0P		0x0010
528c2ecf20Sopenharmony_ci#define CM9780_GPIO1P		0x0020
538c2ecf20Sopenharmony_ci#define CM9780_GPIO0IO		0x0100
548c2ecf20Sopenharmony_ci#define CM9780_GPIO1IO		0x0200
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci/* GPIO status */
578c2ecf20Sopenharmony_ci#define CM9780_GPO0		0x0001
588c2ecf20Sopenharmony_ci#define CM9780_GPO1		0x0002
598c2ecf20Sopenharmony_ci#define CM9780_GPIO0S		0x0010
608c2ecf20Sopenharmony_ci#define CM9780_GPIO1S		0x0020
618c2ecf20Sopenharmony_ci#define CM9780_GPII0S		0x0100
628c2ecf20Sopenharmony_ci#define CM9780_GPII1S		0x0200
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci#endif
65