18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Driver for the PCM512x CODECs
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Author:	Mark Brown <broonie@kernel.org>
68c2ecf20Sopenharmony_ci *		Copyright 2014 Linaro Ltd
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef _SND_SOC_PCM512X
108c2ecf20Sopenharmony_ci#define _SND_SOC_PCM512X
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#include <linux/pm.h>
138c2ecf20Sopenharmony_ci#include <linux/regmap.h>
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#define PCM512x_VIRT_BASE 0x100
168c2ecf20Sopenharmony_ci#define PCM512x_PAGE_LEN  0x100
178c2ecf20Sopenharmony_ci#define PCM512x_PAGE_BASE(n)  (PCM512x_VIRT_BASE + (PCM512x_PAGE_LEN * n))
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#define PCM512x_PAGE              0
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#define PCM512x_RESET             (PCM512x_PAGE_BASE(0) +   1)
228c2ecf20Sopenharmony_ci#define PCM512x_POWER             (PCM512x_PAGE_BASE(0) +   2)
238c2ecf20Sopenharmony_ci#define PCM512x_MUTE              (PCM512x_PAGE_BASE(0) +   3)
248c2ecf20Sopenharmony_ci#define PCM512x_PLL_EN            (PCM512x_PAGE_BASE(0) +   4)
258c2ecf20Sopenharmony_ci#define PCM512x_SPI_MISO_FUNCTION (PCM512x_PAGE_BASE(0) +   6)
268c2ecf20Sopenharmony_ci#define PCM512x_DSP               (PCM512x_PAGE_BASE(0) +   7)
278c2ecf20Sopenharmony_ci#define PCM512x_GPIO_EN           (PCM512x_PAGE_BASE(0) +   8)
288c2ecf20Sopenharmony_ci#define PCM512x_BCLK_LRCLK_CFG    (PCM512x_PAGE_BASE(0) +   9)
298c2ecf20Sopenharmony_ci#define PCM512x_DSP_GPIO_INPUT    (PCM512x_PAGE_BASE(0) +  10)
308c2ecf20Sopenharmony_ci#define PCM512x_MASTER_MODE       (PCM512x_PAGE_BASE(0) +  12)
318c2ecf20Sopenharmony_ci#define PCM512x_PLL_REF           (PCM512x_PAGE_BASE(0) +  13)
328c2ecf20Sopenharmony_ci#define PCM512x_DAC_REF           (PCM512x_PAGE_BASE(0) +  14)
338c2ecf20Sopenharmony_ci#define PCM512x_GPIO_DACIN        (PCM512x_PAGE_BASE(0) +  16)
348c2ecf20Sopenharmony_ci#define PCM512x_GPIO_PLLIN        (PCM512x_PAGE_BASE(0) +  18)
358c2ecf20Sopenharmony_ci#define PCM512x_SYNCHRONIZE       (PCM512x_PAGE_BASE(0) +  19)
368c2ecf20Sopenharmony_ci#define PCM512x_PLL_COEFF_0       (PCM512x_PAGE_BASE(0) +  20)
378c2ecf20Sopenharmony_ci#define PCM512x_PLL_COEFF_1       (PCM512x_PAGE_BASE(0) +  21)
388c2ecf20Sopenharmony_ci#define PCM512x_PLL_COEFF_2       (PCM512x_PAGE_BASE(0) +  22)
398c2ecf20Sopenharmony_ci#define PCM512x_PLL_COEFF_3       (PCM512x_PAGE_BASE(0) +  23)
408c2ecf20Sopenharmony_ci#define PCM512x_PLL_COEFF_4       (PCM512x_PAGE_BASE(0) +  24)
418c2ecf20Sopenharmony_ci#define PCM512x_DSP_CLKDIV        (PCM512x_PAGE_BASE(0) +  27)
428c2ecf20Sopenharmony_ci#define PCM512x_DAC_CLKDIV        (PCM512x_PAGE_BASE(0) +  28)
438c2ecf20Sopenharmony_ci#define PCM512x_NCP_CLKDIV        (PCM512x_PAGE_BASE(0) +  29)
448c2ecf20Sopenharmony_ci#define PCM512x_OSR_CLKDIV        (PCM512x_PAGE_BASE(0) +  30)
458c2ecf20Sopenharmony_ci#define PCM512x_MASTER_CLKDIV_1   (PCM512x_PAGE_BASE(0) +  32)
468c2ecf20Sopenharmony_ci#define PCM512x_MASTER_CLKDIV_2   (PCM512x_PAGE_BASE(0) +  33)
478c2ecf20Sopenharmony_ci#define PCM512x_FS_SPEED_MODE     (PCM512x_PAGE_BASE(0) +  34)
488c2ecf20Sopenharmony_ci#define PCM512x_IDAC_1            (PCM512x_PAGE_BASE(0) +  35)
498c2ecf20Sopenharmony_ci#define PCM512x_IDAC_2            (PCM512x_PAGE_BASE(0) +  36)
508c2ecf20Sopenharmony_ci#define PCM512x_ERROR_DETECT      (PCM512x_PAGE_BASE(0) +  37)
518c2ecf20Sopenharmony_ci#define PCM512x_I2S_1             (PCM512x_PAGE_BASE(0) +  40)
528c2ecf20Sopenharmony_ci#define PCM512x_I2S_2             (PCM512x_PAGE_BASE(0) +  41)
538c2ecf20Sopenharmony_ci#define PCM512x_DAC_ROUTING       (PCM512x_PAGE_BASE(0) +  42)
548c2ecf20Sopenharmony_ci#define PCM512x_DSP_PROGRAM       (PCM512x_PAGE_BASE(0) +  43)
558c2ecf20Sopenharmony_ci#define PCM512x_CLKDET            (PCM512x_PAGE_BASE(0) +  44)
568c2ecf20Sopenharmony_ci#define PCM512x_AUTO_MUTE         (PCM512x_PAGE_BASE(0) +  59)
578c2ecf20Sopenharmony_ci#define PCM512x_DIGITAL_VOLUME_1  (PCM512x_PAGE_BASE(0) +  60)
588c2ecf20Sopenharmony_ci#define PCM512x_DIGITAL_VOLUME_2  (PCM512x_PAGE_BASE(0) +  61)
598c2ecf20Sopenharmony_ci#define PCM512x_DIGITAL_VOLUME_3  (PCM512x_PAGE_BASE(0) +  62)
608c2ecf20Sopenharmony_ci#define PCM512x_DIGITAL_MUTE_1    (PCM512x_PAGE_BASE(0) +  63)
618c2ecf20Sopenharmony_ci#define PCM512x_DIGITAL_MUTE_2    (PCM512x_PAGE_BASE(0) +  64)
628c2ecf20Sopenharmony_ci#define PCM512x_DIGITAL_MUTE_3    (PCM512x_PAGE_BASE(0) +  65)
638c2ecf20Sopenharmony_ci#define PCM512x_GPIO_OUTPUT_1     (PCM512x_PAGE_BASE(0) +  80)
648c2ecf20Sopenharmony_ci#define PCM512x_GPIO_OUTPUT_2     (PCM512x_PAGE_BASE(0) +  81)
658c2ecf20Sopenharmony_ci#define PCM512x_GPIO_OUTPUT_3     (PCM512x_PAGE_BASE(0) +  82)
668c2ecf20Sopenharmony_ci#define PCM512x_GPIO_OUTPUT_4     (PCM512x_PAGE_BASE(0) +  83)
678c2ecf20Sopenharmony_ci#define PCM512x_GPIO_OUTPUT_5     (PCM512x_PAGE_BASE(0) +  84)
688c2ecf20Sopenharmony_ci#define PCM512x_GPIO_OUTPUT_6     (PCM512x_PAGE_BASE(0) +  85)
698c2ecf20Sopenharmony_ci#define PCM512x_GPIO_CONTROL_1    (PCM512x_PAGE_BASE(0) +  86)
708c2ecf20Sopenharmony_ci#define PCM512x_GPIO_CONTROL_2    (PCM512x_PAGE_BASE(0) +  87)
718c2ecf20Sopenharmony_ci#define PCM512x_OVERFLOW          (PCM512x_PAGE_BASE(0) +  90)
728c2ecf20Sopenharmony_ci#define PCM512x_RATE_DET_1        (PCM512x_PAGE_BASE(0) +  91)
738c2ecf20Sopenharmony_ci#define PCM512x_RATE_DET_2        (PCM512x_PAGE_BASE(0) +  92)
748c2ecf20Sopenharmony_ci#define PCM512x_RATE_DET_3        (PCM512x_PAGE_BASE(0) +  93)
758c2ecf20Sopenharmony_ci#define PCM512x_RATE_DET_4        (PCM512x_PAGE_BASE(0) +  94)
768c2ecf20Sopenharmony_ci#define PCM512x_CLOCK_STATUS      (PCM512x_PAGE_BASE(0) +  95)
778c2ecf20Sopenharmony_ci#define PCM512x_ANALOG_MUTE_DET   (PCM512x_PAGE_BASE(0) + 108)
788c2ecf20Sopenharmony_ci#define PCM512x_GPIN              (PCM512x_PAGE_BASE(0) + 119)
798c2ecf20Sopenharmony_ci#define PCM512x_DIGITAL_MUTE_DET  (PCM512x_PAGE_BASE(0) + 120)
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci#define PCM512x_OUTPUT_AMPLITUDE  (PCM512x_PAGE_BASE(1) +   1)
828c2ecf20Sopenharmony_ci#define PCM512x_ANALOG_GAIN_CTRL  (PCM512x_PAGE_BASE(1) +   2)
838c2ecf20Sopenharmony_ci#define PCM512x_UNDERVOLTAGE_PROT (PCM512x_PAGE_BASE(1) +   5)
848c2ecf20Sopenharmony_ci#define PCM512x_ANALOG_MUTE_CTRL  (PCM512x_PAGE_BASE(1) +   6)
858c2ecf20Sopenharmony_ci#define PCM512x_ANALOG_GAIN_BOOST (PCM512x_PAGE_BASE(1) +   7)
868c2ecf20Sopenharmony_ci#define PCM512x_VCOM_CTRL_1       (PCM512x_PAGE_BASE(1) +   8)
878c2ecf20Sopenharmony_ci#define PCM512x_VCOM_CTRL_2       (PCM512x_PAGE_BASE(1) +   9)
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci#define PCM512x_CRAM_CTRL         (PCM512x_PAGE_BASE(44) +  1)
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci#define PCM512x_FLEX_A            (PCM512x_PAGE_BASE(253) + 63)
928c2ecf20Sopenharmony_ci#define PCM512x_FLEX_B            (PCM512x_PAGE_BASE(253) + 64)
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci#define PCM512x_MAX_REGISTER      (PCM512x_PAGE_BASE(253) + 64)
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci/* Page 0, Register 1 - reset */
978c2ecf20Sopenharmony_ci#define PCM512x_RSTR (1 << 0)
988c2ecf20Sopenharmony_ci#define PCM512x_RSTM (1 << 4)
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci/* Page 0, Register 2 - power */
1018c2ecf20Sopenharmony_ci#define PCM512x_RQPD       (1 << 0)
1028c2ecf20Sopenharmony_ci#define PCM512x_RQPD_SHIFT 0
1038c2ecf20Sopenharmony_ci#define PCM512x_RQST       (1 << 4)
1048c2ecf20Sopenharmony_ci#define PCM512x_RQST_SHIFT 4
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci/* Page 0, Register 3 - mute */
1078c2ecf20Sopenharmony_ci#define PCM512x_RQMR (1 << 0)
1088c2ecf20Sopenharmony_ci#define PCM512x_RQMR_SHIFT 0
1098c2ecf20Sopenharmony_ci#define PCM512x_RQML (1 << 4)
1108c2ecf20Sopenharmony_ci#define PCM512x_RQML_SHIFT 4
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci/* Page 0, Register 4 - PLL */
1138c2ecf20Sopenharmony_ci#define PCM512x_PLLE       (1 << 0)
1148c2ecf20Sopenharmony_ci#define PCM512x_PLLE_SHIFT 0
1158c2ecf20Sopenharmony_ci#define PCM512x_PLCK       (1 << 4)
1168c2ecf20Sopenharmony_ci#define PCM512x_PLCK_SHIFT 4
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci/* Page 0, Register 7 - DSP */
1198c2ecf20Sopenharmony_ci#define PCM512x_SDSL       (1 << 0)
1208c2ecf20Sopenharmony_ci#define PCM512x_SDSL_SHIFT 0
1218c2ecf20Sopenharmony_ci#define PCM512x_DEMP       (1 << 4)
1228c2ecf20Sopenharmony_ci#define PCM512x_DEMP_SHIFT 4
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci/* Page 0, Register 8 - GPIO output enable */
1258c2ecf20Sopenharmony_ci#define PCM512x_G1OE       (1 << 0)
1268c2ecf20Sopenharmony_ci#define PCM512x_G2OE       (1 << 1)
1278c2ecf20Sopenharmony_ci#define PCM512x_G3OE       (1 << 2)
1288c2ecf20Sopenharmony_ci#define PCM512x_G4OE       (1 << 3)
1298c2ecf20Sopenharmony_ci#define PCM512x_G5OE       (1 << 4)
1308c2ecf20Sopenharmony_ci#define PCM512x_G6OE       (1 << 5)
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci/* Page 0, Register 9 - BCK, LRCLK configuration */
1338c2ecf20Sopenharmony_ci#define PCM512x_LRKO       (1 << 0)
1348c2ecf20Sopenharmony_ci#define PCM512x_LRKO_SHIFT 0
1358c2ecf20Sopenharmony_ci#define PCM512x_BCKO       (1 << 4)
1368c2ecf20Sopenharmony_ci#define PCM512x_BCKO_SHIFT 4
1378c2ecf20Sopenharmony_ci#define PCM512x_BCKP       (1 << 5)
1388c2ecf20Sopenharmony_ci#define PCM512x_BCKP_SHIFT 5
1398c2ecf20Sopenharmony_ci
1408c2ecf20Sopenharmony_ci/* Page 0, Register 12 - Master mode BCK, LRCLK reset */
1418c2ecf20Sopenharmony_ci#define PCM512x_RLRK       (1 << 0)
1428c2ecf20Sopenharmony_ci#define PCM512x_RLRK_SHIFT 0
1438c2ecf20Sopenharmony_ci#define PCM512x_RBCK       (1 << 1)
1448c2ecf20Sopenharmony_ci#define PCM512x_RBCK_SHIFT 1
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ci/* Page 0, Register 13 - PLL reference */
1478c2ecf20Sopenharmony_ci#define PCM512x_SREF        (7 << 4)
1488c2ecf20Sopenharmony_ci#define PCM512x_SREF_SHIFT  4
1498c2ecf20Sopenharmony_ci#define PCM512x_SREF_SCK    (0 << 4)
1508c2ecf20Sopenharmony_ci#define PCM512x_SREF_BCK    (1 << 4)
1518c2ecf20Sopenharmony_ci#define PCM512x_SREF_GPIO   (3 << 4)
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ci/* Page 0, Register 14 - DAC reference */
1548c2ecf20Sopenharmony_ci#define PCM512x_SDAC        (7 << 4)
1558c2ecf20Sopenharmony_ci#define PCM512x_SDAC_SHIFT  4
1568c2ecf20Sopenharmony_ci#define PCM512x_SDAC_MCK    (0 << 4)
1578c2ecf20Sopenharmony_ci#define PCM512x_SDAC_PLL    (1 << 4)
1588c2ecf20Sopenharmony_ci#define PCM512x_SDAC_SCK    (3 << 4)
1598c2ecf20Sopenharmony_ci#define PCM512x_SDAC_BCK    (4 << 4)
1608c2ecf20Sopenharmony_ci#define PCM512x_SDAC_GPIO   (5 << 4)
1618c2ecf20Sopenharmony_ci
1628c2ecf20Sopenharmony_ci/* Page 0, Register 16, 18 - GPIO source for DAC, PLL */
1638c2ecf20Sopenharmony_ci#define PCM512x_GREF        (7 << 0)
1648c2ecf20Sopenharmony_ci#define PCM512x_GREF_SHIFT  0
1658c2ecf20Sopenharmony_ci#define PCM512x_GREF_GPIO1  (0 << 0)
1668c2ecf20Sopenharmony_ci#define PCM512x_GREF_GPIO2  (1 << 0)
1678c2ecf20Sopenharmony_ci#define PCM512x_GREF_GPIO3  (2 << 0)
1688c2ecf20Sopenharmony_ci#define PCM512x_GREF_GPIO4  (3 << 0)
1698c2ecf20Sopenharmony_ci#define PCM512x_GREF_GPIO5  (4 << 0)
1708c2ecf20Sopenharmony_ci#define PCM512x_GREF_GPIO6  (5 << 0)
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_ci/* Page 0, Register 19 - synchronize */
1738c2ecf20Sopenharmony_ci#define PCM512x_RQSY        (1 << 0)
1748c2ecf20Sopenharmony_ci#define PCM512x_RQSY_RESUME (0 << 0)
1758c2ecf20Sopenharmony_ci#define PCM512x_RQSY_HALT   (1 << 0)
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ci/* Page 0, Register 34 - fs speed mode */
1788c2ecf20Sopenharmony_ci#define PCM512x_FSSP        (3 << 0)
1798c2ecf20Sopenharmony_ci#define PCM512x_FSSP_SHIFT  0
1808c2ecf20Sopenharmony_ci#define PCM512x_FSSP_48KHZ  (0 << 0)
1818c2ecf20Sopenharmony_ci#define PCM512x_FSSP_96KHZ  (1 << 0)
1828c2ecf20Sopenharmony_ci#define PCM512x_FSSP_192KHZ (2 << 0)
1838c2ecf20Sopenharmony_ci#define PCM512x_FSSP_384KHZ (3 << 0)
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ci/* Page 0, Register 37 - Error detection */
1868c2ecf20Sopenharmony_ci#define PCM512x_IPLK (1 << 0)
1878c2ecf20Sopenharmony_ci#define PCM512x_DCAS (1 << 1)
1888c2ecf20Sopenharmony_ci#define PCM512x_IDCM (1 << 2)
1898c2ecf20Sopenharmony_ci#define PCM512x_IDCH (1 << 3)
1908c2ecf20Sopenharmony_ci#define PCM512x_IDSK (1 << 4)
1918c2ecf20Sopenharmony_ci#define PCM512x_IDBK (1 << 5)
1928c2ecf20Sopenharmony_ci#define PCM512x_IDFS (1 << 6)
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ci/* Page 0, Register 40 - I2S configuration */
1958c2ecf20Sopenharmony_ci#define PCM512x_ALEN       (3 << 0)
1968c2ecf20Sopenharmony_ci#define PCM512x_ALEN_SHIFT 0
1978c2ecf20Sopenharmony_ci#define PCM512x_ALEN_16    (0 << 0)
1988c2ecf20Sopenharmony_ci#define PCM512x_ALEN_20    (1 << 0)
1998c2ecf20Sopenharmony_ci#define PCM512x_ALEN_24    (2 << 0)
2008c2ecf20Sopenharmony_ci#define PCM512x_ALEN_32    (3 << 0)
2018c2ecf20Sopenharmony_ci#define PCM512x_AFMT       (3 << 4)
2028c2ecf20Sopenharmony_ci#define PCM512x_AFMT_SHIFT 4
2038c2ecf20Sopenharmony_ci#define PCM512x_AFMT_I2S   (0 << 4)
2048c2ecf20Sopenharmony_ci#define PCM512x_AFMT_DSP   (1 << 4)
2058c2ecf20Sopenharmony_ci#define PCM512x_AFMT_RTJ   (2 << 4)
2068c2ecf20Sopenharmony_ci#define PCM512x_AFMT_LTJ   (3 << 4)
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_ci/* Page 0, Register 42 - DAC routing */
2098c2ecf20Sopenharmony_ci#define PCM512x_AUPR_SHIFT 0
2108c2ecf20Sopenharmony_ci#define PCM512x_AUPL_SHIFT 4
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_ci/* Page 0, Register 59 - auto mute */
2138c2ecf20Sopenharmony_ci#define PCM512x_ATMR_SHIFT 0
2148c2ecf20Sopenharmony_ci#define PCM512x_ATML_SHIFT 4
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci/* Page 0, Register 63 - ramp rates */
2178c2ecf20Sopenharmony_ci#define PCM512x_VNDF_SHIFT 6
2188c2ecf20Sopenharmony_ci#define PCM512x_VNDS_SHIFT 4
2198c2ecf20Sopenharmony_ci#define PCM512x_VNUF_SHIFT 2
2208c2ecf20Sopenharmony_ci#define PCM512x_VNUS_SHIFT 0
2218c2ecf20Sopenharmony_ci
2228c2ecf20Sopenharmony_ci/* Page 0, Register 64 - emergency ramp rates */
2238c2ecf20Sopenharmony_ci#define PCM512x_VEDF_SHIFT 6
2248c2ecf20Sopenharmony_ci#define PCM512x_VEDS_SHIFT 4
2258c2ecf20Sopenharmony_ci
2268c2ecf20Sopenharmony_ci/* Page 0, Register 65 - Digital mute enables */
2278c2ecf20Sopenharmony_ci#define PCM512x_ACTL_SHIFT 2
2288c2ecf20Sopenharmony_ci#define PCM512x_AMLE_SHIFT 1
2298c2ecf20Sopenharmony_ci#define PCM512x_AMRE_SHIFT 0
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_ci/* Page 0, Register 80-85, GPIO output selection */
2328c2ecf20Sopenharmony_ci#define PCM512x_GxSL       (31 << 0)
2338c2ecf20Sopenharmony_ci#define PCM512x_GxSL_SHIFT 0
2348c2ecf20Sopenharmony_ci#define PCM512x_GxSL_OFF   (0 << 0)
2358c2ecf20Sopenharmony_ci#define PCM512x_GxSL_DSP   (1 << 0)
2368c2ecf20Sopenharmony_ci#define PCM512x_GxSL_REG   (2 << 0)
2378c2ecf20Sopenharmony_ci#define PCM512x_GxSL_AMUTB (3 << 0)
2388c2ecf20Sopenharmony_ci#define PCM512x_GxSL_AMUTL (4 << 0)
2398c2ecf20Sopenharmony_ci#define PCM512x_GxSL_AMUTR (5 << 0)
2408c2ecf20Sopenharmony_ci#define PCM512x_GxSL_CLKI  (6 << 0)
2418c2ecf20Sopenharmony_ci#define PCM512x_GxSL_SDOUT (7 << 0)
2428c2ecf20Sopenharmony_ci#define PCM512x_GxSL_ANMUL (8 << 0)
2438c2ecf20Sopenharmony_ci#define PCM512x_GxSL_ANMUR (9 << 0)
2448c2ecf20Sopenharmony_ci#define PCM512x_GxSL_PLLLK (10 << 0)
2458c2ecf20Sopenharmony_ci#define PCM512x_GxSL_CPCLK (11 << 0)
2468c2ecf20Sopenharmony_ci#define PCM512x_GxSL_UV0_7 (14 << 0)
2478c2ecf20Sopenharmony_ci#define PCM512x_GxSL_UV0_3 (15 << 0)
2488c2ecf20Sopenharmony_ci#define PCM512x_GxSL_PLLCK (16 << 0)
2498c2ecf20Sopenharmony_ci
2508c2ecf20Sopenharmony_ci/* Page 1, Register 2 - analog volume control */
2518c2ecf20Sopenharmony_ci#define PCM512x_RAGN_SHIFT 0
2528c2ecf20Sopenharmony_ci#define PCM512x_LAGN_SHIFT 4
2538c2ecf20Sopenharmony_ci
2548c2ecf20Sopenharmony_ci/* Page 1, Register 7 - analog boost control */
2558c2ecf20Sopenharmony_ci#define PCM512x_AGBR_SHIFT 0
2568c2ecf20Sopenharmony_ci#define PCM512x_AGBL_SHIFT 4
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_ciextern const struct dev_pm_ops pcm512x_pm_ops;
2598c2ecf20Sopenharmony_ciextern const struct regmap_config pcm512x_regmap;
2608c2ecf20Sopenharmony_ci
2618c2ecf20Sopenharmony_ciint pcm512x_probe(struct device *dev, struct regmap *regmap);
2628c2ecf20Sopenharmony_civoid pcm512x_remove(struct device *dev);
2638c2ecf20Sopenharmony_ci
2648c2ecf20Sopenharmony_ci#endif
265