// SPDX-License-Identifier: GPL-2.0-only
/*
* Regmap tables for CS47L35 codec
*
* Copyright (C) 2015-2017 Cirrus Logic
*/
#include <linux/device.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/mfd/madera/core.h>
#include <linux/mfd/madera/registers.h>
#include "madera.h"
static const struct reg_sequence cs47l35_reva_16_patch[] = {
{ 0x460, 0x0c40 },
{ 0x461, 0xcd1a },
{ 0x462, 0x0c40 },
{ 0x463, 0xb53b },
{ 0x464, 0x0c40 },
{ 0x465, 0x7503 },
{ 0x466, 0x0c40 },
{ 0x467, 0x4a41 },
{ 0x468, 0x0041 },
{ 0x469, 0x3491 },
{ 0x46a, 0x0841 },
{ 0x46b, 0x1f50 },
{ 0x46c, 0x0446 },
{ 0x46d, 0x14ed },
{ 0x46e, 0x0446 },
{ 0x46f, 0x1455 },
{ 0x470, 0x04c6 },
{ 0x471, 0x1220 },
{ 0x472, 0x04c6 },
{ 0x473, 0x040f },
{ 0x474, 0x04ce },
{ 0x475, 0x0339 },
{ 0x476, 0x05df },
{ 0x477, 0x028f },
{ 0x478, 0x05df },
{ 0x479, 0x0209 },
{ 0x47a, 0x05df },
{ 0x47b, 0x00cf },
{ 0x47c, 0x05df },
{ 0x47d, 0x0001 },
{ 0x47e, 0x07ff },
};
int cs47l35_patch(struct madera *madera)
{
int ret;
ret = regmap_register_patch(madera->regmap, cs47l35_reva_16_patch,
ARRAY_SIZE(cs47l35_reva_16_patch));
if (ret < 0)
dev_err(madera->dev, "Error applying patch: %d\n", ret);
return ret;
}
EXPORT_SYMBOL_GPL(cs47l35_patch);
static const struct reg_default cs47l35_reg_default[] = {
{ 0x00000020, 0x0000 }, /* R32 (0x20) - Tone Generator 1 */
{ 0x00000021, 0x1000 }, /* R33 (0x21) - Tone Generator 2 */
{ 0x00000022, 0x0000 }, /* R34 (0x22) - Tone Generator 3 */
{ 0x00000023, 0x1000 }, /* R35 (0x23) - Tone Generator 4 */
{ 0x00000024, 0x0000 }, /* R36 (0x24) - Tone Generator 5 */
{ 0x00000030, 0x0000 }, /* R48 (0x30) - PWM Drive 1 */
{ 0x00000031, 0x0100 }, /* R49 (0x31) - PWM Drive 2 */
{ 0x00000032, 0x0100 }, /* R50 (0x32) - PWM Drive 3 */
{ 0x00000061, 0x01ff }, /* R97 (0x61) - Sample Rate Sequence Select 1 */
{ 0x00000062, 0x01ff }, /* R98 (0x62) - Sample Rate Sequence Select 2 */
{ 0x00000063, 0x01ff }, /* R99 (0x63) - Sample Rate Sequence Select 3 */
{ 0x00000064, 0x01ff }, /* R100 (0x64) - Sample Rate Sequence Select 4*/
{ 0x00000066, 0x01ff }, /* R102 (0x66) - Always On Triggers Sequence Select 1*/
{ 0x00000067, 0x01ff }, /* R103 (0x67) - Always On Triggers Sequence Select 2*/
{ 0x00000090, 0x0000 }, /* R144 (0x90) - Haptics Control 1 */
{ 0x00000091, 0x7fff }, /* R145 (0x91) - Haptics Control 2 */
{ 0x00000092, 0x0000 }, /* R146 (0x92) - Haptics phase 1 intensity */
{ 0x00000093, 0x0000 }, /* R147 (0x93) - Haptics phase 1 duration */
{ 0x00000094, 0x0000 }, /* R148 (0x94) - Haptics phase 2 intensity */
{ 0x00000095, 0x0000 }, /* R149 (0x95) - Haptics phase 2 duration */
{ 0x00000096, 0x0000 }, /* R150 (0x96) - Haptics phase 3 intensity */
{ 0x00000097, 0x0000 }, /* R151 (0x97) - Haptics phase 3 duration */
{ 0x000000A0, 0x0000 }, /* R160 (0xa0) - Comfort Noise Generator */
{ 0x00000100, 0x0002 }, /* R256 (0x100) - Clock 32k 1 */
{ 0x00000101, 0x0404 }, /* R257 (0x101) - System Clock 1 */
{ 0x00000102, 0x0011 }, /* R258 (0x102) - Sample rate 1 */
{ 0x00000103, 0x0011 }, /* R259 (0x103) - Sample rate 2 */
{ 0x00000104, 0x0011 }, /* R260 (0x104) - Sample rate 3 */
{ 0x00000120, 0x0305 }, /* R288 (0x120) - DSP Clock 1 */
{ 0x00000122, 0x0000 }, /* R290 (0x122) - DSP Clock 2 */
{ 0x00000149, 0x0000 }, /* R329 (0x149) - Output system clock */
{ 0x0000014a, 0x0000 }, /* R330 (0x14a) - Output async clock */
{ 0x00000152, 0x0000 }, /* R338 (0x152) - Rate Estimator 1 */
{ 0x00000153, 0x0000 }, /* R339 (0x153) - Rate Estimator 2 */
{ 0x00000154, 0x0000 }, /* R340 (0x154) - Rate Estimator 3 */
{ 0x00000155, 0x0000 }, /* R341 (0x155) - Rate Estimator 4 */
{ 0x00000156, 0x0000 }, /* R342 (0x156) - Rate Estimator 5 */
{ 0x00000171, 0x0002 }, /* R369 (0x171) - FLL1 Control 1 */
{ 0x00000172, 0x0008 }, /* R370 (0x172) - FLL1 Control 2 */
{ 0x00000173, 0x0018 }, /* R371 (0x173) - FLL1 Control 3 */
{ 0x00000174, 0x007d }, /* R372 (0x174) - FLL1 Control 4 */
{ 0x00000175, 0x0000 }, /* R373 (0x175) - FLL1 Control 5 */
{ 0x00000176, 0x0000 }, /* R374 (0x176) - FLL1 Control 6 */
{ 0x00000179, 0x0000 }, /* R377 (0x179) - FLL1 Control 7 */
{ 0x0000017a, 0x2906 }, /* R378 (0x17a) - FLL1 EFS2 */
{ 0x0000017f, 0x0000 }, /* R383 (0x17f) - FLL1 Synchroniser 1 */
{ 0x00000180, 0x0000 }, /* R384 (0x180) - FLL1 Synchroniser 2 */
{ 0x00000181, 0x0000 }, /* R385 (0x181) - FLL1 Synchroniser 3 */
{ 0x00000182, 0x0000 }, /* R386 (0x182) - FLL1 Synchroniser 4 */
{ 0x00000183, 0x0000 }, /* R387 (0x183) - FLL1 Synchroniser 5 */
{ 0x00000184, 0x0000 }, /* R388 (0x184) - FLL1 Synchroniser 6 */
{ 0x00000185, 0x0001 }, /* R389 (0x185) - FLL1 Synchroniser 7 */
{ 0x00000187, 0x0000 }, /* R391 (0x187) - FLL1 Spread Spectrum */
{ 0x00000188, 0x000c }, /* R392 (0x188) - FLL1 GPIO Clock */
{ 0x00000200, 0x0006 }, /* R512 (0x200) - Mic Charge Pump 1 */
{ 0x0000020b, 0x0400 }, /* R523 (0x20b) - HP Charge Pump 8 */
{ 0x00000213, 0x03e4 }, /* R531 (0x213) - LDO2 Control 1 */
{ 0x00000218, 0x00e6 }, /* R536 (0x218) - Mic Bias Ctrl 1 */
{ 0x00000219, 0x00e6 }, /* R537 (0x219) - Mic Bias Ctrl 2 */
{ 0x0000021c, 0x0022 }, /* R540 (0x21c) - Mic Bias Ctrl 5 */
{ 0x0000021e, 0x0022 }, /* R542 (0x21e) - Mic Bias Ctrl 6 */
{ 0x0000027e, 0x0000 }, /* R638 (0x27e) - EDRE HP stereo control */
{ 0x00000293, 0x0080 }, /* R659 (0x293) - Accessory Detect Mode 1 */
{ 0x0000029b, 0x0000 }, /* R667 (0x29b) - Headphone Detect 1 */
{ 0x000002a3, 0x1102 }, /* R675 (0x2a3) - Mic Detect Control 1 */
{ 0x000002a4, 0x009f }, /* R676 (0x2a4) - Mic Detect Control 2 */
{ 0x000002a6, 0x3d3d }, /* R678 (0x2a6) - Mic Detect Level 1 */
{ 0x000002a7, 0x3d3d }, /* R679 (0x2a7) - Mic Detect Level 2 */
{ 0x000002a8, 0x333d }, /* R680 (0x2a8) - Mic Detect Level 3 */
{ 0x000002a9, 0x202d }, /* R681 (0x2a9) - Mic Detect Level 4 */
{ 0x000002c6, 0x0010 }, /* R710 (0x2c5) - Mic Clamp control */
{ 0x000002c8, 0x0000 }, /* R712 (0x2c8) - GP switch 1 */
{ 0x000002d3, 0x0000 }, /* R723 (0x2d3) - Jack detect analogue */
{ 0x00000300, 0x0000 }, /* R768 (0x300) - Input Enables */
{ 0x00000308, 0x0000 }, /* R776 (0x308) - Input Rate */
{ 0x00000309, 0x0022 }, /* R777 (0x309) - Input Volume Ramp */
{ 0x0000030c, 0x0002 }, /* R780 (0x30c) - HPF Control */
{ 0x00000310, 0x0080 }, /* R784 (0x310) - IN1L Control */
{ 0x00000311, 0x0180 }, /* R785 (0x311) - ADC Digital Volume 1L */
{ 0x00000312, 0x0500 }, /* R786 (0x312) - DMIC1L Control */
{ 0x00000314, 0x0080 }, /* R788 (0x314) - IN1R Control */
{ 0x00000315, 0x0180 }, /* R789 (0x315) - ADC Digital Volume 1R */
{ 0x0000031
|