1 /* SPDX-License-Identifier: GPL-2.0-only */ << 2 /* 1 /* 3 * max9867.h -- MAX9867 ALSA SoC Audio driver 2 * max9867.h -- MAX9867 ALSA SoC Audio driver 4 * 3 * 5 * Copyright 2013-2015 Maxim Integrated Produc 4 * Copyright 2013-2015 Maxim Integrated Products >> 5 * >> 6 * This program is free software; you can redistribute it and/or modify >> 7 * it under the terms of the GNU General Public License version 2 as >> 8 * published by the Free Software Foundation. 6 */ 9 */ 7 10 8 #ifndef _MAX9867_H 11 #ifndef _MAX9867_H 9 #define _MAX9867_H 12 #define _MAX9867_H 10 13 11 /* MAX9867 register space */ 14 /* MAX9867 register space */ 12 15 13 #define MAX9867_STATUS 0x00 16 #define MAX9867_STATUS 0x00 14 #define MAX9867_JACKSTATUS 0x01 17 #define MAX9867_JACKSTATUS 0x01 15 #define MAX9867_AUXHIGH 0x02 18 #define MAX9867_AUXHIGH 0x02 16 #define MAX9867_AUXLOW 0x03 19 #define MAX9867_AUXLOW 0x03 17 #define MAX9867_INTEN 0x04 20 #define MAX9867_INTEN 0x04 18 #define MAX9867_SYSCLK 0x05 21 #define MAX9867_SYSCLK 0x05 19 #define MAX9867_FREQ_MASK 0xF 22 #define MAX9867_FREQ_MASK 0xF 20 #define MAX9867_PSCLK_SHIFT 0x4 23 #define MAX9867_PSCLK_SHIFT 0x4 21 #define MAX9867_PSCLK_WIDTH 0x2 24 #define MAX9867_PSCLK_WIDTH 0x2 22 #define MAX9867_PSCLK_MASK (0x03<<MAX9867_PS 25 #define MAX9867_PSCLK_MASK (0x03<<MAX9867_PSCLK_SHIFT) 23 #define MAX9867_PSCLK_10_20 0x1 26 #define MAX9867_PSCLK_10_20 0x1 24 #define MAX9867_PSCLK_20_40 0x2 27 #define MAX9867_PSCLK_20_40 0x2 25 #define MAX9867_PSCLK_40_60 0x3 28 #define MAX9867_PSCLK_40_60 0x3 26 #define MAX9867_AUDIOCLKHIGH 0x06 !! 29 #define MAX9867_AUDIOCLKHIGH 0x06 27 #define MAX9867_NI_HIGH_MASK 0x7F !! 30 #define MAX9867_NI_HIGH_WIDTH 0x7 28 #define MAX9867_NI_LOW_MASK 0xFE !! 31 #define MAX9867_NI_HIGH_MASK 0x7F 29 #define MAX9867_PLL (1<<7) !! 32 #define MAX9867_NI_LOW_MASK 0x7F 30 #define MAX9867_AUDIOCLKLOW 0x07 !! 33 #define MAX9867_NI_LOW_SHIFT 0x1 >> 34 #define MAX9867_PLL (1<<7) >> 35 #define MAX9867_AUDIOCLKLOW 0x07 31 #define MAX9867_RAPID_LOCK 0x01 36 #define MAX9867_RAPID_LOCK 0x01 32 #define MAX9867_IFC1A 0x08 37 #define MAX9867_IFC1A 0x08 33 #define MAX9867_MASTER (1<<7) 38 #define MAX9867_MASTER (1<<7) 34 #define MAX9867_I2S_DLY (1<<4) 39 #define MAX9867_I2S_DLY (1<<4) 35 #define MAX9867_SDOUT_HIZ (1<<3) 40 #define MAX9867_SDOUT_HIZ (1<<3) 36 #define MAX9867_TDM_MODE (1<<2) 41 #define MAX9867_TDM_MODE (1<<2) 37 #define MAX9867_WCI_MODE (1<<6) 42 #define MAX9867_WCI_MODE (1<<6) 38 #define MAX9867_BCI_MODE (1<<5) 43 #define MAX9867_BCI_MODE (1<<5) 39 #define MAX9867_IFC1B 0x09 44 #define MAX9867_IFC1B 0x09 40 #define MAX9867_IFC1B_BCLK_MASK 7 45 #define MAX9867_IFC1B_BCLK_MASK 7 41 #define MAX9867_IFC1B_64X 0x01 !! 46 #define MAX9867_IFC1B_32BIT 0x01 42 #define MAX9867_IFC1B_48X 0x02 !! 47 #define MAX9867_IFC1B_24BIT 0x02 43 #define MAX9867_IFC1B_PCLK_2 0x04 !! 48 #define MAX9867_IFC1B_PCLK_2 4 44 #define MAX9867_IFC1B_PCLK_4 0x05 !! 49 #define MAX9867_IFC1B_PCLK_4 5 45 #define MAX9867_IFC1B_PCLK_8 0x06 !! 50 #define MAX9867_IFC1B_PCLK_8 6 46 #define MAX9867_IFC1B_PCLK_16 0x07 !! 51 #define MAX9867_IFC1B_PCLK_16 7 47 #define MAX9867_CODECFLTR 0x0a !! 52 #define MAX9867_CODECFLTR 0x0a 48 #define MAX9867_CODECFLTR_MODE (1<<7) !! 53 #define MAX9867_DACGAIN 0x0b 49 #define MAX9867_SIDETONE 0x0b << 50 #define MAX9867_DACLEVEL 0x0c 54 #define MAX9867_DACLEVEL 0x0c >> 55 #define MAX9867_DAC_MUTE_SHIFT 0x6 >> 56 #define MAX9867_DAC_MUTE_WIDTH 0x1 >> 57 #define MAX9867_DAC_MUTE_MASK (0x1<<MAX9867_DAC_MUTE_SHIFT) 51 #define MAX9867_ADCLEVEL 0x0d 58 #define MAX9867_ADCLEVEL 0x0d 52 #define MAX9867_LEFTLINELVL 0x0e 59 #define MAX9867_LEFTLINELVL 0x0e 53 #define MAX9867_RIGHTLINELVL 0x0f !! 60 #define MAX9867_RIGTHLINELVL 0x0f 54 #define MAX9867_LEFTVOL 0x10 61 #define MAX9867_LEFTVOL 0x10 55 #define MAX9867_RIGHTVOL 0x11 62 #define MAX9867_RIGHTVOL 0x11 56 #define MAX9867_LEFTMICGAIN 0x12 63 #define MAX9867_LEFTMICGAIN 0x12 57 #define MAX9867_RIGHTMICGAIN 0x13 64 #define MAX9867_RIGHTMICGAIN 0x13 58 #define MAX9867_INPUTCONFIG 0x14 65 #define MAX9867_INPUTCONFIG 0x14 >> 66 #define MAX9867_INPUT_SHIFT 0x6 59 #define MAX9867_MICCONFIG 0x15 67 #define MAX9867_MICCONFIG 0x15 60 #define MAX9867_MODECONFIG 0x16 68 #define MAX9867_MODECONFIG 0x16 61 #define MAX9867_PWRMAN 0x17 69 #define MAX9867_PWRMAN 0x17 62 #define MAX9867_PWRMAN_SHDN (1<<7) !! 70 #define MAX9867_SHTDOWN_MASK (1<<7) 63 #define MAX9867_REVISION 0xff 71 #define MAX9867_REVISION 0xff 64 72 65 #define MAX9867_CACHEREGNUM 10 73 #define MAX9867_CACHEREGNUM 10 66 74 >> 75 /* codec private data */ >> 76 struct max9867_priv { >> 77 struct regmap *regmap; >> 78 struct snd_soc_codec *codec; >> 79 unsigned int sysclk; >> 80 unsigned int pclk; >> 81 unsigned int master; >> 82 }; 67 #endif 83 #endif 68 84
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.