1a1533d94SBarry Song /* 2a1533d94SBarry Song * AD193X Audio Codec driver 3a1533d94SBarry Song * 4a1533d94SBarry Song * Copyright 2010 Analog Devices Inc. 5a1533d94SBarry Song * 6a1533d94SBarry Song * Licensed under the GPL-2 or later. 7a1533d94SBarry Song */ 8a1533d94SBarry Song 9a1533d94SBarry Song #ifndef __AD193X_H__ 10a1533d94SBarry Song #define __AD193X_H__ 11a1533d94SBarry Song 126c3d713eSLars-Peter Clausen #include <linux/regmap.h> 136c3d713eSLars-Peter Clausen 146c3d713eSLars-Peter Clausen struct device; 156c3d713eSLars-Peter Clausen 166c3d713eSLars-Peter Clausen extern const struct regmap_config ad193x_regmap_config; 176c3d713eSLars-Peter Clausen int ad193x_probe(struct device *dev, struct regmap *regmap); 186c3d713eSLars-Peter Clausen 1930ab1e78SLars-Peter Clausen #define AD193X_PLL_CLK_CTRL0 0x00 20a1533d94SBarry Song #define AD193X_PLL_POWERDOWN 0x01 21f3aa7219SAxel Lin #define AD193X_PLL_INPUT_MASK 0x6 22fab90aa4SBarry Song #define AD193X_PLL_INPUT_256 (0 << 1) 23fab90aa4SBarry Song #define AD193X_PLL_INPUT_384 (1 << 1) 24fab90aa4SBarry Song #define AD193X_PLL_INPUT_512 (2 << 1) 25fab90aa4SBarry Song #define AD193X_PLL_INPUT_768 (3 << 1) 2630ab1e78SLars-Peter Clausen #define AD193X_PLL_CLK_CTRL1 0x01 2730ab1e78SLars-Peter Clausen #define AD193X_DAC_CTRL0 0x02 28a1533d94SBarry Song #define AD193X_DAC_POWERDOWN 0x01 29a1533d94SBarry Song #define AD193X_DAC_SERFMT_MASK 0xC0 30a1533d94SBarry Song #define AD193X_DAC_SERFMT_STEREO (0 << 6) 31a1533d94SBarry Song #define AD193X_DAC_SERFMT_TDM (1 << 6) 3230ab1e78SLars-Peter Clausen #define AD193X_DAC_CTRL1 0x03 33a1533d94SBarry Song #define AD193X_DAC_CHAN_SHFT 1 34a1533d94SBarry Song #define AD193X_DAC_CHAN_MASK (3 << AD193X_DAC_CHAN_SHFT) 35a1533d94SBarry Song #define AD193X_DAC_LCR_MASTER (1 << 4) 36a1533d94SBarry Song #define AD193X_DAC_BCLK_MASTER (1 << 5) 37a1533d94SBarry Song #define AD193X_DAC_LEFT_HIGH (1 << 3) 38a1533d94SBarry Song #define AD193X_DAC_BCLK_INV (1 << 7) 39b82ca578SLars-Peter Clausen #define AD193X_DAC_FMT_MASK (AD193X_DAC_LCR_MASTER | \ 40b82ca578SLars-Peter Clausen AD193X_DAC_BCLK_MASTER | AD193X_DAC_LEFT_HIGH | AD193X_DAC_BCLK_INV) 4130ab1e78SLars-Peter Clausen #define AD193X_DAC_CTRL2 0x04 4295c93d85SScott Jiang #define AD193X_DAC_WORD_LEN_SHFT 3 43bf545ed7SScott Jiang #define AD193X_DAC_WORD_LEN_MASK 0x18 44a1533d94SBarry Song #define AD193X_DAC_MASTER_MUTE 1 4530ab1e78SLars-Peter Clausen #define AD193X_DAC_CHNL_MUTE 0x05 46a1533d94SBarry Song #define AD193X_DACL1_MUTE 0 47a1533d94SBarry Song #define AD193X_DACR1_MUTE 1 48a1533d94SBarry Song #define AD193X_DACL2_MUTE 2 49a1533d94SBarry Song #define AD193X_DACR2_MUTE 3 50a1533d94SBarry Song #define AD193X_DACL3_MUTE 4 51a1533d94SBarry Song #define AD193X_DACR3_MUTE 5 52a1533d94SBarry Song #define AD193X_DACL4_MUTE 6 53a1533d94SBarry Song #define AD193X_DACR4_MUTE 7 5430ab1e78SLars-Peter Clausen #define AD193X_DAC_L1_VOL 0x06 5530ab1e78SLars-Peter Clausen #define AD193X_DAC_R1_VOL 0x07 5630ab1e78SLars-Peter Clausen #define AD193X_DAC_L2_VOL 0x08 5730ab1e78SLars-Peter Clausen #define AD193X_DAC_R2_VOL 0x09 5830ab1e78SLars-Peter Clausen #define AD193X_DAC_L3_VOL 0x0a 5930ab1e78SLars-Peter Clausen #define AD193X_DAC_R3_VOL 0x0b 6030ab1e78SLars-Peter Clausen #define AD193X_DAC_L4_VOL 0x0c 6130ab1e78SLars-Peter Clausen #define AD193X_DAC_R4_VOL 0x0d 6230ab1e78SLars-Peter Clausen #define AD193X_ADC_CTRL0 0x0e 63a1533d94SBarry Song #define AD193X_ADC_POWERDOWN 0x01 64a1533d94SBarry Song #define AD193X_ADC_HIGHPASS_FILTER 1 65a1533d94SBarry Song #define AD193X_ADCL1_MUTE 2 66a1533d94SBarry Song #define AD193X_ADCR1_MUTE 3 67a1533d94SBarry Song #define AD193X_ADCL2_MUTE 4 68a1533d94SBarry Song #define AD193X_ADCR2_MUTE 5 6930ab1e78SLars-Peter Clausen #define AD193X_ADC_CTRL1 0x0f 70a1533d94SBarry Song #define AD193X_ADC_SERFMT_MASK 0x60 71a1533d94SBarry Song #define AD193X_ADC_SERFMT_STEREO (0 << 5) 72bf545ed7SScott Jiang #define AD193X_ADC_SERFMT_TDM (1 << 5) 73a1533d94SBarry Song #define AD193X_ADC_SERFMT_AUX (2 << 5) 74a1533d94SBarry Song #define AD193X_ADC_WORD_LEN_MASK 0x3 7530ab1e78SLars-Peter Clausen #define AD193X_ADC_CTRL2 0x10 76a1533d94SBarry Song #define AD193X_ADC_CHAN_SHFT 4 77a1533d94SBarry Song #define AD193X_ADC_CHAN_MASK (3 << AD193X_ADC_CHAN_SHFT) 78a1533d94SBarry Song #define AD193X_ADC_LCR_MASTER (1 << 3) 79a1533d94SBarry Song #define AD193X_ADC_BCLK_MASTER (1 << 6) 80a1533d94SBarry Song #define AD193X_ADC_LEFT_HIGH (1 << 2) 81a1533d94SBarry Song #define AD193X_ADC_BCLK_INV (1 << 1) 82b82ca578SLars-Peter Clausen #define AD193X_ADC_FMT_MASK (AD193X_ADC_LCR_MASTER | \ 83b82ca578SLars-Peter Clausen AD193X_ADC_BCLK_MASTER | AD193X_ADC_LEFT_HIGH | AD193X_ADC_BCLK_INV) 84b82ca578SLars-Peter Clausen 85b82ca578SLars-Peter Clausen #define AD193X_2_CHANNELS 0 86b82ca578SLars-Peter Clausen #define AD193X_4_CHANNELS 1 87b82ca578SLars-Peter Clausen #define AD193X_8_CHANNELS 2 88b82ca578SLars-Peter Clausen #define AD193X_16_CHANNELS 3 89a1533d94SBarry Song 90a1533d94SBarry Song #define AD193X_NUM_REGS 17 91a1533d94SBarry Song 92a1533d94SBarry Song #endif 93