linux/sound/soc/codecs/rt715.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * rt715.h -- RT715 ALSA SoC audio driver header
 *
 * Copyright(c) 2019 Realtek Semiconductor Corp.
 */

#ifndef __RT715_H__
#define __RT715_H__

#include <linux/regulator/consumer.h>

struct rt715_priv {};

/* NID */
#define RT715_AUDIO_FUNCTION_GROUP
#define RT715_MIC_ADC
#define RT715_LINE_ADC
#define RT715_MIX_ADC
#define RT715_DMIC1
#define RT715_DMIC2
#define RT715_MIC1
#define RT715_MIC2
#define RT715_LINE1
#define RT715_LINE2
#define RT715_DMIC3
#define RT715_DMIC4
#define RT715_VENDOR_REGISTERS
#define RT715_MUX_IN1
#define RT715_MUX_IN2
#define RT715_MUX_IN3
#define RT715_MUX_IN4
#define RT715_MIX_ADC2
#define RT715_INLINE_CMD

/* Index (NID:20h) */
#define RT715_VD_CLEAR_CTRL
#define RT715_SDW_INPUT_SEL
#define RT715_EXT_DMIC_CLK_CTRL2

/* Verb */
#define RT715_VERB_SET_CONNECT_SEL
#define RT715_VERB_GET_CONNECT_SEL
#define RT715_VERB_SET_EAPD_BTLENABLE
#define RT715_VERB_SET_POWER_STATE
#define RT715_VERB_SET_CHANNEL_STREAMID
#define RT715_VERB_SET_PIN_WIDGET_CONTROL
#define RT715_VERB_SET_CONFIG_DEFAULT1
#define RT715_VERB_SET_CONFIG_DEFAULT2
#define RT715_VERB_SET_CONFIG_DEFAULT3
#define RT715_VERB_SET_CONFIG_DEFAULT4
#define RT715_VERB_SET_UNSOLICITED_ENABLE
#define RT715_SET_AMP_GAIN_MUTE_H
#define RT715_SET_AMP_GAIN_MUTE_L
#define RT715_READ_HDA_3
#define RT715_READ_HDA_2
#define RT715_READ_HDA_1
#define RT715_READ_HDA_0
#define RT715_PRIV_INDEX_W_H
#define RT715_PRIV_INDEX_W_L
#define RT715_PRIV_INDEX_W_H_2
#define RT715_PRIV_INDEX_W_L_2
#define RT715_PRIV_DATA_W_H
#define RT715_PRIV_DATA_W_L
#define RT715_PRIV_INDEX_R_H
#define RT715_PRIV_INDEX_R_L
#define RT715_PRIV_DATA_R_H
#define RT715_PRIV_DATA_R_L
#define RT715_MIC_ADC_FORMAT_H
#define RT715_MIC_ADC_FORMAT_L
#define RT715_MIC_LINE_FORMAT_H
#define RT715_MIC_LINE_FORMAT_L
#define RT715_MIX_ADC_FORMAT_H
#define RT715_MIX_ADC_FORMAT_L
#define RT715_MIX_ADC2_FORMAT_H
#define RT715_MIX_ADC2_FORMAT_L
#define RT715_FUNC_RESET

#define RT715_SET_AUDIO_POWER_STATE
#define RT715_SET_PIN_DMIC1
#define RT715_SET_PIN_DMIC2
#define RT715_SET_PIN_DMIC3
#define RT715_SET_PIN_DMIC4
#define RT715_SET_PIN_MIC1
#define RT715_SET_PIN_MIC2
#define RT715_SET_PIN_LINE1
#define RT715_SET_PIN_LINE2
#define RT715_SET_MIC1_UNSOLICITED_ENABLE
#define RT715_SET_MIC2_UNSOLICITED_ENABLE
#define RT715_SET_STREAMID_MIC_ADC
#define RT715_SET_STREAMID_LINE_ADC
#define RT715_SET_STREAMID_MIX_ADC
#define RT715_SET_STREAMID_MIX_ADC2
#define RT715_SET_GAIN_MIC_ADC_L
#define RT715_SET_GAIN_MIC_ADC_H
#define RT715_SET_GAIN_LINE_ADC_L
#define RT715_SET_GAIN_LINE_ADC_H
#define RT715_SET_GAIN_MIX_ADC_L
#define RT715_SET_GAIN_MIX_ADC_H
#define RT715_SET_GAIN_MIX_ADC2_L
#define RT715_SET_GAIN_MIX_ADC2_H
#define RT715_SET_GAIN_DMIC1_L
#define RT715_SET_GAIN_DMIC1_H
#define RT715_SET_GAIN_DMIC2_L
#define RT715_SET_GAIN_DMIC2_H
#define RT715_SET_GAIN_DMIC3_L
#define RT715_SET_GAIN_DMIC3_H
#define RT715_SET_GAIN_DMIC4_L
#define RT715_SET_GAIN_DMIC4_H
#define RT715_SET_GAIN_MIC1_L
#define RT715_SET_GAIN_MIC1_H
#define RT715_SET_GAIN_MIC2_L
#define RT715_SET_GAIN_MIC2_H
#define RT715_SET_GAIN_LINE1_L
#define RT715_SET_GAIN_LINE1_H
#define RT715_SET_GAIN_LINE2_L
#define RT715_SET_GAIN_LINE2_H
#define RT715_SET_DMIC1_CONFIG_DEFAULT1
#define RT715_SET_DMIC2_CONFIG_DEFAULT1
#define RT715_SET_DMIC1_CONFIG_DEFAULT2
#define RT715_SET_DMIC2_CONFIG_DEFAULT2
#define RT715_SET_DMIC1_CONFIG_DEFAULT3
#define RT715_SET_DMIC2_CONFIG_DEFAULT3
#define RT715_SET_DMIC1_CONFIG_DEFAULT4
#define RT715_SET_DMIC2_CONFIG_DEFAULT4
#define RT715_SET_DMIC3_CONFIG_DEFAULT1
#define RT715_SET_DMIC4_CONFIG_DEFAULT1
#define RT715_SET_DMIC3_CONFIG_DEFAULT2
#define RT715_SET_DMIC4_CONFIG_DEFAULT2
#define RT715_SET_DMIC3_CONFIG_DEFAULT3
#define RT715_SET_DMIC4_CONFIG_DEFAULT3
#define RT715_SET_DMIC3_CONFIG_DEFAULT4
#define RT715_SET_DMIC4_CONFIG_DEFAULT4

/* vendor register clear ctrl-1    (0x01)(NID:20h) */
#define RT715_CLEAR_HIDDEN_REG


#define RT715_MUTE_SFT
#define RT715_DIR_IN_SFT
#define RT715_DIR_OUT_SFT

enum {};

#define RT715_POWER_UP_DELAY_MS

int rt715_io_init(struct device *dev, struct sdw_slave *slave);
int rt715_init(struct device *dev, struct regmap *sdw_regmap,
	struct regmap *regmap, struct sdw_slave *slave);

int hda_to_sdw(unsigned int nid, unsigned int verb, unsigned int payload,
	       unsigned int *sdw_addr_h, unsigned int *sdw_data_h,
	       unsigned int *sdw_addr_l, unsigned int *sdw_data_l);
int rt715_clock_config(struct device *dev);
#endif /* __RT715_H__ */