diff options
| -rw-r--r-- | sound/soc/codecs/Kconfig | 4 | ||||
| -rw-r--r-- | sound/soc/codecs/Makefile | 2 | ||||
| -rw-r--r-- | sound/soc/codecs/max98090.c | 577 |
3 files changed, 583 insertions, 0 deletions
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index b92759a39361..1801a6517ddf 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig | |||
| @@ -44,6 +44,7 @@ config SND_SOC_ALL_CODECS | |||
| 44 | select SND_SOC_LM4857 if I2C | 44 | select SND_SOC_LM4857 if I2C |
| 45 | select SND_SOC_LM49453 if I2C | 45 | select SND_SOC_LM49453 if I2C |
| 46 | select SND_SOC_MAX98088 if I2C | 46 | select SND_SOC_MAX98088 if I2C |
| 47 | select SND_SOC_MAX98090 if I2C | ||
| 47 | select SND_SOC_MAX98095 if I2C | 48 | select SND_SOC_MAX98095 if I2C |
| 48 | select SND_SOC_MAX9850 if I2C | 49 | select SND_SOC_MAX9850 if I2C |
| 49 | select SND_SOC_MAX9768 if I2C | 50 | select SND_SOC_MAX9768 if I2C |
| @@ -258,6 +259,9 @@ config SND_SOC_LM49453 | |||
| 258 | config SND_SOC_MAX98088 | 259 | config SND_SOC_MAX98088 |
| 259 | tristate | 260 | tristate |
| 260 | 261 | ||
| 262 | config SND_SOC_MAX98090 | ||
| 263 | tristate | ||
| 264 | |||
| 261 | config SND_SOC_MAX98095 | 265 | config SND_SOC_MAX98095 |
| 262 | tristate | 266 | tristate |
| 263 | 267 | ||
diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile index 9bd4d95aab4f..fff64db4bf29 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile | |||
| @@ -34,6 +34,7 @@ snd-soc-lm4857-objs := lm4857.o | |||
| 34 | snd-soc-lm49453-objs := lm49453.o | 34 | snd-soc-lm49453-objs := lm49453.o |
| 35 | snd-soc-max9768-objs := max9768.o | 35 | snd-soc-max9768-objs := max9768.o |
| 36 | snd-soc-max98088-objs := max98088.o | 36 | snd-soc-max98088-objs := max98088.o |
| 37 | snd-soc-max98090-objs := max98090.o | ||
| 37 | snd-soc-max98095-objs := max98095.o | 38 | snd-soc-max98095-objs := max98095.o |
| 38 | snd-soc-max9850-objs := max9850.o | 39 | snd-soc-max9850-objs := max9850.o |
| 39 | snd-soc-mc13783-objs := mc13783.o | 40 | snd-soc-mc13783-objs := mc13783.o |
| @@ -155,6 +156,7 @@ obj-$(CONFIG_SND_SOC_LM4857) += snd-soc-lm4857.o | |||
| 155 | obj-$(CONFIG_SND_SOC_LM49453) += snd-soc-lm49453.o | 156 | obj-$(CONFIG_SND_SOC_LM49453) += snd-soc-lm49453.o |
| 156 | obj-$(CONFIG_SND_SOC_MAX9768) += snd-soc-max9768.o | 157 | obj-$(CONFIG_SND_SOC_MAX9768) += snd-soc-max9768.o |
| 157 | obj-$(CONFIG_SND_SOC_MAX98088) += snd-soc-max98088.o | 158 | obj-$(CONFIG_SND_SOC_MAX98088) += snd-soc-max98088.o |
| 159 | obj-$(CONFIG_SND_SOC_MAX98090) += snd-soc-max98090.o | ||
| 158 | obj-$(CONFIG_SND_SOC_MAX98095) += snd-soc-max98095.o | 160 | obj-$(CONFIG_SND_SOC_MAX98095) += snd-soc-max98095.o |
| 159 | obj-$(CONFIG_SND_SOC_MAX9850) += snd-soc-max9850.o | 161 | obj-$(CONFIG_SND_SOC_MAX9850) += snd-soc-max9850.o |
| 160 | obj-$(CONFIG_SND_SOC_MC13783) += snd-soc-mc13783.o | 162 | obj-$(CONFIG_SND_SOC_MC13783) += snd-soc-mc13783.o |
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c new file mode 100644 index 000000000000..c9772ca3da4f --- /dev/null +++ b/sound/soc/codecs/max98090.c | |||
| @@ -0,0 +1,577 @@ | |||
| 1 | /* | ||
| 2 | * max98090.c -- MAX98090 ALSA SoC Audio driver | ||
| 3 | * based on Rev0p8 datasheet | ||
| 4 | * | ||
| 5 | * Copyright (C) 2012 Renesas Solutions Corp. | ||
| 6 | * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | ||
| 7 | * | ||
| 8 | * Based on | ||
| 9 | * | ||
| 10 | * max98095.c | ||
| 11 | * Copyright 2011 Maxim Integrated Products | ||
| 12 | * | ||
| 13 | * https://github.com/hardkernel/linux/commit/\ | ||
| 14 | * 3417d7166b17113b3b33b0a337c74d1c7cc313df#sound/soc/codecs/max98090.c | ||
| 15 | * Copyright 2011 Maxim Integrated Products | ||
| 16 | * | ||
| 17 | * This program is free software; you can redistribute it and/or modify | ||
| 18 | * it under the terms of the GNU General Public License version 2 as | ||
| 19 | * published by the Free Software Foundation. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include <linux/i2c.h> | ||
| 23 | #include <linux/module.h> | ||
| 24 | #include <linux/regmap.h> | ||
| 25 | #include <sound/soc.h> | ||
| 26 | #include <sound/tlv.h> | ||
| 27 | |||
| 28 | /* | ||
| 29 | * | ||
| 30 | * MAX98090 Registers Definition | ||
| 31 | * | ||
| 32 | */ | ||
| 33 | |||
| 34 | /* RESET / STATUS / INTERRUPT REGISTERS */ | ||
| 35 | #define MAX98090_0x00_SW_RESET 0x00 | ||
| 36 | #define MAX98090_0x01_INT_STS 0x01 | ||
| 37 | #define MAX98090_0x02_JACK_STS 0x02 | ||
| 38 | #define MAX98090_0x03_INT_MASK 0x03 | ||
| 39 | |||
| 40 | /* QUICK SETUP REGISTERS */ | ||
| 41 | #define MAX98090_0x04_SYS_CLK 0x04 | ||
| 42 | #define MAX98090_0x05_SAMPLE_RATE 0x05 | ||
| 43 | #define MAX98090_0x06_DAI_IF 0x06 | ||
| 44 | #define MAX98090_0x07_DAC_PATH 0x07 | ||
| 45 | #define MAX98090_0x08_MIC_TO_ADC 0x08 | ||
| 46 | #define MAX98090_0x09_LINE_TO_ADC 0x09 | ||
| 47 | #define MAX98090_0x0A_ANALOG_MIC_LOOP 0x0A | ||
| 48 | #define MAX98090_0x0B_ANALOG_LINE_LOOP 0x0B | ||
| 49 | |||
| 50 | /* ANALOG INPUT CONFIGURATION REGISTERS */ | ||
| 51 | #define MAX98090_0x0D_INPUT_CONFIG 0x0D | ||
| 52 | #define MAX98090_0x0E_LINE_IN_LVL 0x0E | ||
| 53 | #define MAX98090_0x0F_LINI_IN_CFG 0x0F | ||
| 54 | #define MAX98090_0x10_MIC1_IN_LVL 0x10 | ||
| 55 | #define MAX98090_0x11_MIC2_IN_LVL 0x11 | ||
| 56 | |||
| 57 | /* MICROPHONE CONFIGURATION REGISTERS */ | ||
| 58 | #define MAX98090_0x12_MIC_BIAS_VOL 0x12 | ||
| 59 | #define MAX98090_0x13_DIGITAL_MIC_CFG 0x13 | ||
| 60 | #define MAX98090_0x14_DIGITAL_MIC_MODE 0x14 | ||
| 61 | |||
| 62 | /* ADC PATH AND CONFIGURATION REGISTERS */ | ||
| 63 | #define MAX98090_0x15_L_ADC_MIX 0x15 | ||
| 64 | #define MAX98090_0x16_R_ADC_MIX 0x16 | ||
| 65 | #define MAX98090_0x17_L_ADC_LVL 0x17 | ||
| 66 | #define MAX98090_0x18_R_ADC_LVL 0x18 | ||
| 67 | #define MAX98090_0x19_ADC_BIQUAD_LVL 0x19 | ||
| 68 | #define MAX98090_0x1A_ADC_SIDETONE 0x1A | ||
| 69 | |||
| 70 | /* CLOCK CONFIGURATION REGISTERS */ | ||
| 71 | #define MAX98090_0x1B_SYS_CLK 0x1B | ||
| 72 | #define MAX98090_0x1C_CLK_MODE 0x1C | ||
| 73 | #define MAX98090_0x1D_ANY_CLK1 0x1D | ||
| 74 | #define MAX98090_0x1E_ANY_CLK2 0x1E | ||
| 75 | #define MAX98090_0x1F_ANY_CLK3 0x1F | ||
| 76 | #define MAX98090_0x20_ANY_CLK4 0x20 | ||
| 77 | #define MAX98090_0x21_MASTER_MODE 0x21 | ||
| 78 | |||
| 79 | /* INTERFACE CONTROL REGISTERS */ | ||
| 80 | #define MAX98090_0x22_DAI_IF_FMT 0x22 | ||
| 81 | #define MAX98090_0x23_DAI_TDM_FMT1 0x23 | ||
| 82 | #define MAX98090_0x24_DAI_TDM_FMT2 0x24 | ||
| 83 | #define MAX98090_0x25_DAI_IO_CFG 0x25 | ||
| 84 | #define MAX98090_0x26_FILTER_CFG 0x26 | ||
| 85 | #define MAX98090_0x27_DAI_PLAYBACK_LVL 0x27 | ||
| 86 | #define MAX98090_0x28_EQ_PLAYBACK_LVL 0x28 | ||
| 87 | |||
| 88 | /* HEADPHONE CONTROL REGISTERS */ | ||
| 89 | #define MAX98090_0x29_L_HP_MIX 0x29 | ||
| 90 | #define MAX98090_0x2A_R_HP_MIX 0x2A | ||
| 91 | #define MAX98090_0x2B_HP_CTR 0x2B | ||
| 92 | #define MAX98090_0x2C_L_HP_VOL 0x2C | ||
| 93 | #define MAX98090_0x2D_R_HP_VOL 0x2D | ||
| 94 | |||
| 95 | /* SPEAKER CONFIGURATION REGISTERS */ | ||
| 96 | #define MAX98090_0x2E_L_SPK_MIX 0x2E | ||
| 97 | #define MAX98090_0x2F_R_SPK_MIX 0x2F | ||
| 98 | #define MAX98090_0x30_SPK_CTR 0x30 | ||
| 99 | #define MAX98090_0x31_L_SPK_VOL 0x31 | ||
| 100 | #define MAX98090_0x32_R_SPK_VOL 0x32 | ||
| 101 | |||
| 102 | /* ALC CONFIGURATION REGISTERS */ | ||
| 103 | #define MAX98090_0x33_ALC_TIMING 0x33 | ||
| 104 | #define MAX98090_0x34_ALC_COMPRESSOR 0x34 | ||
| 105 | #define MAX98090_0x35_ALC_EXPANDER 0x35 | ||
| 106 | #define MAX98090_0x36_ALC_GAIN 0x36 | ||
| 107 | |||
| 108 | /* RECEIVER AND LINE_OUTPUT REGISTERS */ | ||
| 109 | #define MAX98090_0x37_RCV_LOUT_L_MIX 0x37 | ||
| 110 | #define MAX98090_0x38_RCV_LOUT_L_CNTL 0x38 | ||
| 111 | #define MAX98090_0x39_RCV_LOUT_L_VOL 0x39 | ||
| 112 | #define MAX98090_0x3A_LOUT_R_MIX 0x3A | ||
| 113 | #define MAX98090_0x3B_LOUT_R_CNTL 0x3B | ||
| 114 | #define MAX98090_0x3C_LOUT_R_VOL 0x3C | ||
| 115 | |||
| 116 | /* JACK DETECT AND ENABLE REGISTERS */ | ||
| 117 | #define MAX98090_0x3D_JACK_DETECT 0x3D | ||
| 118 | #define MAX98090_0x3E_IN_ENABLE 0x3E | ||
| 119 | #define MAX98090_0x3F_OUT_ENABLE 0x3F | ||
| 120 | #define MAX98090_0x40_LVL_CTR 0x40 | ||
| 121 | #define MAX98090_0x41_DSP_FILTER_ENABLE 0x41 | ||
| 122 | |||
| 123 | /* BIAS AND POWER MODE CONFIGURATION REGISTERS */ | ||
| 124 | #define MAX98090_0x42_BIAS_CTR 0x42 | ||
| 125 | #define MAX98090_0x43_DAC_CTR 0x43 | ||
| 126 | #define MAX98090_0x44_ADC_CTR 0x44 | ||
| 127 | #define MAX98090_0x45_DEV_SHUTDOWN 0x45 | ||
| 128 | |||
| 129 | /* REVISION ID REGISTER */ | ||
| 130 | #define MAX98090_0xFF_REV_ID 0xFF | ||
| 131 | |||
| 132 | #define MAX98090_REG_MAX_CACHED 0x45 | ||
| 133 | #define MAX98090_REG_END 0xFF | ||
| 134 | |||
| 135 | /* | ||
| 136 | * | ||
| 137 | * MAX98090 Registers Bit Fields | ||
| 138 | * | ||
| 139 | */ | ||
| 140 | |||
| 141 | /* MAX98090_0x06_DAI_IF */ | ||
| 142 | #define MAX98090_DAI_IF_MASK 0x3F | ||
| 143 | #define MAX98090_RJ_M (1 << 5) | ||
| 144 | #define MAX98090_RJ_S (1 << 4) | ||
| 145 | #define MAX98090_LJ_M (1 << 3) | ||
| 146 | #define MAX98090_LJ_S (1 << 2) | ||
| 147 | #define MAX98090_I2S_M (1 << 1) | ||
| 148 | #define MAX98090_I2S_S (1 << 0) | ||
| 149 | |||
| 150 | /* MAX98090_0x45_DEV_SHUTDOWN */ | ||
| 151 | #define MAX98090_SHDNRUN (1 << 7) | ||
