// SPDX-License-Identifier: GPL-2.0
//
// rt1015.c -- RT1015 ALSA SoC audio amplifier driver
//
// Copyright 2019 Realtek Semiconductor Corp.
//
// Author: Jack Yu <jack.yu@realtek.com>
//
//
#include <linux/fs.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/regmap.h>
#include <linux/i2c.h>
#include <linux/platform_device.h>
#include <linux/firmware.h>
#include <linux/gpio.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/initval.h>
#include <sound/tlv.h>
#include "rl6231.h"
#include "rt1015.h"
static const struct reg_default rt1015_reg[] = {
{ 0x0000, 0x0000 },
{ 0x0004, 0xa000 },
{ 0x0006, 0x0003 },
{ 0x000a, 0x0802 },
{ 0x000c, 0x0020 },
{ 0x000e, 0x0000 },
{ 0x0010, 0x0000 },
{ 0x0012, 0x0000 },
{ 0x0020, 0x8000 },
{ 0x0022, 0x471b },
{ 0x006a, 0x0000 },
{ 0x006c, 0x4020 },
{ 0x0076, 0x0000 },
{ 0x0078, 0x0000 },
{ 0x007a, 0x0000 },
{ 0x007c, 0x10ec },
{ 0x007d, 0x1015 },
{ 0x00f0, 0x5000 },
{ 0x00f2, 0x0774 },
{ 0x00f3, 0x8400 },
{ 0x00f4, 0x0000 },
{ 0x0100, 0x0028 },
{ 0x0102, 0xff02 },
{ 0x0104, 0x8232 },
{ 0x0106, 0x200c },
{ 0x010c, 0x002f },
{ 0x010e, 0xc000 },
{ 0x0111, 0x0200 },
{ 0x0112, 0x0400 },
{ 0x0114, 0x0022 },
{ 0x0116, 0x0000 },
{ 0x0118, 0x0000 },
{ 0x011a, 0x0123 },
{ 0x011c, 0x4567 },
{ 0x0300, 0xdddd },
{ 0x0302, 0x0000 },
{ 0x0311, 0x9330 },
{ 0x0313, 0x0000 },
{ 0x0314, 0x0000 },
{ 0x031a, 0x00a0 },
{ 0x031c, 0x001f },
{ 0x031d, 0xffff },
{ 0x031e, 0x0000 },
{ 0x031f, 0x0000 },
{ 0x0321, 0x0000 },
{ 0x0322, 0x0000 },
{ 0x0328, 0x0000 },
{ 0x0329, 0x0000 },
{ 0x032a, 0x0000 },
{ 0x032b, 0x0000 },
{ 0x032c, 0x0000 },
{ 0x032d, 0x0000 },
{ 0x032e, 0x030e },
{ 0x0330, 0x0080 },
{ 0x0332, 0x0034 },
{ 0x0334, 0x0000 },
{ 0x0336, 0x0000 },
{ 0x0506, 0x04ff },
{ 0x0508, 0x0030 },
{ 0x050a, 0x0018 },
{ 0x0519, 0x307f },
{ 0x051a, 0xffff },
{ 0x051b, 0x4000 },
{ 0x051d, 0x0000 },
{ 0x051f, 0x0000 },
{ 0x0536, 0x1000 },
{ 0x0538, 0x0000 },
{ 0x053a, 0x0000 },
{ 0x053c, 0x0000 },
{ 0x053d, 0x0000 },
{ 0x053e, 0x0000 },
{ 0x053f, 0x0000 },
{ 0x0540, 0x0000 },
{ 0x0541, 0x0000 },
{ 0x0542, 0x0000 },
{ 0x0543, 0x0000 },
{ 0x0544, 0x0000 },
{ 0x0568, 0x0000 },
{ 0x056a, 0x0000 },
{ 0x1000, 0x0000 },
{ 0x1002, 0x6505 },
{ 0x1006, 0x5515 },
{ 0x1007, 0x003f },
{ 0x1009, 0x770f },
{ 0x100a, 0x01ff },
{ 0x100c, 0x0000 },
{ 0x100d, 0x0003 },
{ 0x1010, 0xa433 },
{