// SPDX-License-Identifier: GPL-2.0-only
/*
* Regmap tables for CS47L15 codec
*
* Copyright (C) 2016-2019 Cirrus Logic, Inc. and
* Cirrus Logic International Semiconductor Ltd.
*/
#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 cs47l15_reva_16_patch[] = {
{ 0x8C, 0x5555 },
{ 0x8C, 0xAAAA },
{ 0x314, 0x0080 },
{ 0x4A8, 0x6023 },
{ 0x4A9, 0x6023 },
{ 0x4D4, 0x0008 },
{ 0x4CF, 0x0F00 },
{ 0x4D7, 0x1B2B },
{ 0x8C, 0xCCCC },
{ 0x8C, 0x3333 },
};
int cs47l15_patch(struct madera *madera)
{
int ret;
ret = regmap_register_patch(madera->regmap,
cs47l15_reva_16_patch,
ARRAY_SIZE(cs47l15_reva_16_patch));
if (ret < 0) {
dev_err(madera->dev,
"Error in applying 16-bit patch: %d\n", ret);
return ret;
}
return 0;
}
EXPORT_SYMBOL_GPL(cs47l15_patch);
static const struct reg_default cs47l15_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, 0x00