/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
/*
 * mtk_amp_ad82089.h  --  ESMT AMP AD82089 header
 *
 * Copyright (c) 2022 MediaTek Inc.
 *
 */

#ifndef _AMP_AD82088D_HEADER
#define _AMP_AD82088D_HEADER

#include "cus_ini_parser.h"

#define MTK_AMP_AD82088D_PARAM_COUNT	64

/* Register Address Map */
#define AD82088D_STATE_CTRL1_REG	0x00
#define AD82088D_STATE_CTRL2_REG	0x01
#define AD82088D_STATE_CTRL3_REG	0x02
#define AD82088D_VOLUME_CTRL_REG	0x03
#define AD82088D_STATE_CTRL5_REG	0x1A

#define CFADDR    0x1d
#define A1CF1     0x1e
#define A1CF2     0x1f
#define A1CF3     0x20
#define A1CF4     0x21
#define A2CF1     0x22
#define A2CF2     0x23
#define A2CF3     0x24
#define A2CF4     0x25
#define B1CF1     0x26
#define B1CF2     0x27
#define B1CF3     0x28
#define B1CF4     0x29
#define B2CF1     0x2A
#define B2CF2     0x2B
#define B2CF3     0x2C
#define B2CF4     0x2D
#define A0CF1     0x2E
#define A0CF2     0x2F
#define A0CF3     0x30
#define A0CF4     0x31

#define CFUD      0x32

#define AD82088D_FAULT_REG		0x69
#define AD82088D_MAX_REG		0xA6

struct amp_ad82088d_priv {
	struct device	*dev;
	struct i2c_client *client;
	struct snd_soc_component *component;
	struct gpio_desc *amp_powerdown;
	struct regmap *regmap;
	struct work_struct work;
	struct cus_param *cus_param;
	const struct firmware *fw;
	bool suspended;
	const char *mtk_ini;
	const char *cus_ini;
	u8 *init_table;
	bool initialized;
	int type;
	bool no_extini;
	bool no_cusini;
	unsigned int sound_mode;
	unsigned int vol_interval;
	int volume;
	int curr_vol_interval;
	int curr_sound_mode;
	unsigned int sysfs_sound_mode;
	unsigned int sysfs_vol_index;
};

#endif /* _AMP_AD82088D_HEADER */
