linux/sound/soc/codecs/ssm2602.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * File:         sound/soc/codecs/ssm2602.h
 * Author:       Cliff Cai <[email protected]>
 *
 * Created:      Tue June 06 2008
 *
 * Modified:
 *               Copyright 2008 Analog Devices Inc.
 *
 * Bugs:         Enter bugs at http://blackfin.uclinux.org/
 */

#ifndef _SSM2602_H
#define _SSM2602_H

#include <linux/regmap.h>

struct device;

enum ssm2602_type {};

extern const struct regmap_config ssm2602_regmap_config;

int ssm2602_probe(struct device *dev, enum ssm2602_type type,
	struct regmap *regmap);

/* SSM2602 Codec Register definitions */

#define SSM2602_LINVOL
#define SSM2602_RINVOL
#define SSM2602_LOUT1V
#define SSM2602_ROUT1V
#define SSM2602_APANA
#define SSM2602_APDIGI
#define SSM2602_PWR
#define SSM2602_IFACE
#define SSM2602_SRATE
#define SSM2602_ACTIVE
#define SSM2602_RESET

/*SSM2602 Codec Register Field definitions
 *(Mask value to extract the corresponding Register field)
 */

/*Left ADC Volume Control (SSM2602_REG_LEFT_ADC_VOL)*/
#define LINVOL_LIN_VOL
#define LINVOL_LIN_ENABLE_MUTE
#define LINVOL_LRIN_BOTH

/*Right ADC Volume Control (SSM2602_REG_RIGHT_ADC_VOL)*/
#define RINVOL_RIN_VOL
#define RINVOL_RIN_ENABLE_MUTE
#define RINVOL_RLIN_BOTH

/*Left DAC Volume Control (SSM2602_REG_LEFT_DAC_VOL)*/
#define LOUT1V_LHP_VOL
#define LOUT1V_ENABLE_LZC
#define LOUT1V_LRHP_BOTH

/*Right DAC Volume Control (SSM2602_REG_RIGHT_DAC_VOL)*/
#define ROUT1V_RHP_VOL
#define ROUT1V_ENABLE_RZC
#define ROUT1V_RLHP_BOTH

/*Analogue Audio Path Control (SSM2602_REG_ANALOGUE_PATH)*/
#define APANA_ENABLE_MIC_BOOST
#define APANA_ENABLE_MIC_MUTE
#define APANA_ADC_IN_SELECT
#define APANA_ENABLE_BYPASS
#define APANA_SELECT_DAC
#define APANA_ENABLE_SIDETONE
#define APANA_SIDETONE_ATTN
#define APANA_ENABLE_MIC_BOOST2

/*Digital Audio Path Control (SSM2602_REG_DIGITAL_PATH)*/
#define APDIGI_ENABLE_ADC_HPF
#define APDIGI_DE_EMPHASIS
#define APDIGI_ENABLE_DAC_MUTE
#define APDIGI_STORE_OFFSET

/*Power Down Control (SSM2602_REG_POWER)
 *(1=Enable PowerDown, 0=Disable PowerDown)
 */
#define PWR_LINE_IN_PDN
#define PWR_MIC_PDN
#define PWR_ADC_PDN
#define PWR_DAC_PDN
#define PWR_OUT_PDN
#define PWR_OSC_PDN
#define PWR_CLK_OUT_PDN
#define PWR_POWER_OFF

/*Digital Audio Interface Format (SSM2602_REG_DIGITAL_IFACE)*/
#define IFACE_IFACE_FORMAT
#define IFACE_AUDIO_DATA_LEN
#define IFACE_DAC_LR_POLARITY
#define IFACE_DAC_LR_SWAP
#define IFACE_ENABLE_MASTER
#define IFACE_BCLK_INVERT

/*Sampling Control (SSM2602_REG_SAMPLING_CTRL)*/
#define SRATE_ENABLE_USB_MODE
#define SRATE_BOS_RATE
#define SRATE_SAMPLE_RATE
#define SRATE_CORECLK_DIV2
#define SRATE_CLKOUT_DIV2

/*Active Control (SSM2602_REG_ACTIVE_CTRL)*/
#define ACTIVE_ACTIVATE_CODEC

/*********************************************************************/

#define SSM2602_CACHEREGNUM

enum ssm2602_clk {};

#endif