linux/sound/soc/codecs/ak4458.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Audio driver for AK4458
 *
 * Copyright (C) 2016 Asahi Kasei Microdevices Corporation
 * Copyright 2018 NXP
 */

#ifndef _AK4458_H
#define _AK4458_H

#include <linux/regmap.h>

/* Settings */

#define AK4458_00_CONTROL1
#define AK4458_01_CONTROL2
#define AK4458_02_CONTROL3
#define AK4458_03_LCHATT
#define AK4458_04_RCHATT
#define AK4458_05_CONTROL4
#define AK4458_06_DSD1
#define AK4458_07_CONTROL5
#define AK4458_08_SOUND_CONTROL
#define AK4458_09_DSD2
#define AK4458_0A_CONTROL6
#define AK4458_0B_CONTROL7
#define AK4458_0C_CONTROL8
#define AK4458_0D_CONTROL9
#define AK4458_0E_CONTROL10
#define AK4458_0F_L2CHATT
#define AK4458_10_R2CHATT
#define AK4458_11_L3CHATT
#define AK4458_12_R3CHATT
#define AK4458_13_L4CHATT
#define AK4458_14_R4CHATT

/* Bitfield Definitions */

/* AK4458_00_CONTROL1 (0x00) Fields
 * Addr Register Name  D7     D6    D5    D4    D3    D2    D1    D0
 * 00H  Control 1      ACKS   0     0     0     DIF2  DIF1  DIF0  RSTN
 */

/* Digital Filter (SD, SLOW, SSLOW) */
#define AK4458_SD_MASK
#define AK4458_SLOW_MASK
#define AK4458_SSLOW_MASK

/* DIF2	1 0
 *  x	1 0 MSB justified  Figure 3 (default)
 *  x	1 1 I2S Compliment  Figure 4
 */
#define AK4458_DIF_SHIFT
#define AK4458_DIF_MASK

#define AK4458_DIF_16BIT_LSB
#define AK4458_DIF_24BIT_I2S
#define AK4458_DIF_32BIT_LSB
#define AK4458_DIF_32BIT_MSB
#define AK4458_DIF_32BIT_I2S

/* AK4458_00_CONTROL1 (0x00) D0 bit */
#define AK4458_RSTN_MASK
#define AK4458_RSTN

/* AK4458_0A_CONTROL6 Mode bits */
#define AK4458_MODE_SHIFT
#define AK4458_MODE_MASK
#define AK4458_MODE_NORMAL
#define AK4458_MODE_TDM128
#define AK4458_MODE_TDM256
#define AK4458_MODE_TDM512

/* DAC Digital attenuator transition time setting
 * Table 19
 * Mode	ATS1	ATS2	ATT speed
 * 0	0	0	4080/fs
 * 1	0	1	2040/fs
 * 2	1	0	510/fs
 * 3	1	1	255/fs
 * */
#define AK4458_ATS_SHIFT
#define AK4458_ATS_MASK
#define AK4458_DCHAIN_MASK

#define AK4458_DSDSEL_MASK
#define AK4458_DP_MASK

#endif