diff options
| -rw-r--r-- | Documentation/devicetree/bindings/sound/tlv320aic32x4.txt | 13 | ||||
| -rw-r--r-- | Documentation/devicetree/bindings/sound/tlv320aic3x.txt | 5 | ||||
| -rw-r--r-- | include/sound/tlv320aic32x4.h | 23 | ||||
| -rw-r--r-- | sound/soc/codecs/tas2552.c | 11 | ||||
| -rw-r--r-- | sound/soc/codecs/tlv320aic32x4-i2c.c | 2 | ||||
| -rw-r--r-- | sound/soc/codecs/tlv320aic32x4-spi.c | 2 | ||||
| -rw-r--r-- | sound/soc/codecs/tlv320aic32x4.c | 206 | ||||
| -rw-r--r-- | sound/soc/codecs/tlv320aic32x4.h | 3 | ||||
| -rw-r--r-- | sound/soc/codecs/tlv320aic3x.c | 45 | ||||
| -rw-r--r-- | sound/soc/codecs/tlv320aic3x.h | 8 | ||||
| -rw-r--r-- | sound/soc/tegra/Kconfig | 42 | ||||
| -rw-r--r-- | sound/soc/tegra/tegra30_ahub.c | 4 | ||||
| -rw-r--r-- | sound/soc/tegra/tegra30_i2s.c | 2 | ||||
| -rw-r--r-- | sound/soc/tegra/tegra_alc5632.c | 1 | ||||
| -rw-r--r-- | sound/soc/tegra/tegra_max98090.c | 1 | ||||
| -rw-r--r-- | sound/soc/tegra/tegra_rt5640.c | 1 | ||||
| -rw-r--r-- | sound/soc/tegra/tegra_rt5677.c | 1 | ||||
| -rw-r--r-- | sound/soc/tegra/tegra_sgtl5000.c | 1 | ||||
| -rw-r--r-- | sound/soc/tegra/tegra_wm8753.c | 1 | ||||
| -rw-r--r-- | sound/soc/tegra/tegra_wm8903.c | 1 | ||||
| -rw-r--r-- | sound/soc/tegra/tegra_wm9712.c | 1 | ||||
| -rw-r--r-- | sound/soc/tegra/trimslice.c | 1 |
22 files changed, 330 insertions, 45 deletions
diff --git a/Documentation/devicetree/bindings/sound/tlv320aic32x4.txt b/Documentation/devicetree/bindings/sound/tlv320aic32x4.txt index 5e2741af27be..ca75890f0d07 100644 --- a/Documentation/devicetree/bindings/sound/tlv320aic32x4.txt +++ b/Documentation/devicetree/bindings/sound/tlv320aic32x4.txt | |||
| @@ -3,7 +3,9 @@ Texas Instruments - tlv320aic32x4 Codec module | |||
| 3 | The tlv320aic32x4 serial control bus communicates through I2C protocols | 3 | The tlv320aic32x4 serial control bus communicates through I2C protocols |
| 4 | 4 | ||
| 5 | Required properties: | 5 | Required properties: |
| 6 | - compatible: Should be "ti,tlv320aic32x4" | 6 | - compatible - "string" - One of: |
| 7 | "ti,tlv320aic32x4" TLV320AIC3204 | ||
| 8 | "ti,tlv320aic32x6" TLV320AIC3206, TLV320AIC3256 | ||
| 7 | - reg: I2C slave address | 9 | - reg: I2C slave address |
| 8 | - supply-*: Required supply regulators are: | 10 | - supply-*: Required supply regulators are: |
| 9 | "iov" - digital IO power supply | 11 | "iov" - digital IO power supply |
| @@ -18,6 +20,8 @@ Optional properties: | |||
| 18 | - reset-gpios: Reset-GPIO phandle with args as described in gpio/gpio.txt | 20 | - reset-gpios: Reset-GPIO phandle with args as described in gpio/gpio.txt |
| 19 | - clocks/clock-names: Clock named 'mclk' for the master clock of the codec. | 21 | - clocks/clock-names: Clock named 'mclk' for the master clock of the codec. |
| 20 | See clock/clock-bindings.txt for information about the detailed format. | 22 | See clock/clock-bindings.txt for information about the detailed format. |
| 23 | - aic32x4-gpio-func - <array of 5 int> | ||
| 24 | - Types are defined in include/sound/tlv320aic32x4.h | ||
| 21 | 25 | ||
| 22 | 26 | ||
| 23 | Example: | 27 | Example: |
| @@ -27,4 +31,11 @@ codec: tlv320aic32x4@18 { | |||
| 27 | reg = <0x18>; | 31 | reg = <0x18>; |
| 28 | clocks = <&clks 201>; | 32 | clocks = <&clks 201>; |
| 29 | clock-names = "mclk"; | 33 | clock-names = "mclk"; |
| 34 | aic32x4-gpio-func= < | ||
| 35 | 0xff /* AIC32X4_MFPX_DEFAULT_VALUE */ | ||
| 36 | 0xff /* AIC32X4_MFPX_DEFAULT_VALUE */ | ||
| 37 | 0x04 /* MFP3 AIC32X4_MFP3_GPIO_ENABLED */ | ||
| 38 | 0xff /* AIC32X4_MFPX_DEFAULT_VALUE */ | ||
| 39 | 0x08 /* MFP5 AIC32X4_MFP5_GPIO_INPUT */ | ||
| 40 | >; | ||
| 30 | }; | 41 | }; |
diff --git a/Documentation/devicetree/bindings/sound/tlv320aic3x.txt b/Documentation/devicetree/bindings/sound/tlv320aic3x.txt index 47a213c411ce..ba5b45c483f5 100644 --- a/Documentation/devicetree/bindings/sound/tlv320aic3x.txt +++ b/Documentation/devicetree/bindings/sound/tlv320aic3x.txt | |||
| @@ -26,6 +26,11 @@ Optional properties: | |||
| 26 | 3 - MICBIAS output is connected to AVDD, | 26 | 3 - MICBIAS output is connected to AVDD, |
| 27 | If this node is not mentioned or if the value is incorrect, then MicBias | 27 | If this node is not mentioned or if the value is incorrect, then MicBias |
| 28 | is powered down. | 28 | is powered down. |
| 29 | - ai3x-ocmv - Output Common-Mode Voltage selection: | ||
| 30 | 0 - 1.35V, | ||
| 31 | 1 - 1.5V, | ||
| 32 | 2 - 1.65V, | ||
| 33 | 3 - 1.8V | ||
| 29 | - AVDD-supply, IOVDD-supply, DRVDD-supply, DVDD-supply : power supplies for the | 34 | - AVDD-supply, IOVDD-supply, DRVDD-supply, DVDD-supply : power supplies for the |
| 30 | device as covered in Documentation/devicetree/bindings/regulator/regulator.txt | 35 | device as covered in Documentation/devicetree/bindings/regulator/regulator.txt |
| 31 | 36 | ||
diff --git a/include/sound/tlv320aic32x4.h b/include/sound/tlv320aic32x4.h index 24e5d991f148..22305c0ab31a 100644 --- a/include/sound/tlv320aic32x4.h +++ b/include/sound/tlv320aic32x4.h | |||
| @@ -22,7 +22,30 @@ | |||
| 22 | #define AIC32X4_MICPGA_ROUTE_LMIC_IN2R_10K 0x00000001 | 22 | #define AIC32X4_MICPGA_ROUTE_LMIC_IN2R_10K 0x00000001 |
| 23 | #define AIC32X4_MICPGA_ROUTE_RMIC_IN1L_10K 0x00000002 | 23 | #define AIC32X4_MICPGA_ROUTE_RMIC_IN1L_10K 0x00000002 |
| 24 | 24 | ||
| 25 | /* GPIO API */ | ||
| 26 | #define AIC32X4_MFPX_DEFAULT_VALUE 0xff | ||
| 27 | |||
| 28 | #define AIC32X4_MFP1_DIN_DISABLED 0 | ||
| 29 | #define AIC32X4_MFP1_DIN_ENABLED 0x2 | ||
| 30 | #define AIC32X4_MFP1_GPIO_IN 0x4 | ||
| 31 | |||
| 32 | #define AIC32X4_MFP2_GPIO_OUT_LOW 0x0 | ||
| 33 | #define AIC32X4_MFP2_GPIO_OUT_HIGH 0x1 | ||
| 34 | |||
| 35 | #define AIC32X4_MFP_GPIO_ENABLED 0x4 | ||
| 36 | |||
| 37 | #define AIC32X4_MFP5_GPIO_DISABLED 0x0 | ||
| 38 | #define AIC32X4_MFP5_GPIO_INPUT 0x8 | ||
| 39 | #define AIC32X4_MFP5_GPIO_OUTPUT 0xc | ||
| 40 | #define AIC32X4_MFP5_GPIO_OUT_LOW 0x0 | ||
| 41 | #define AIC32X4_MFP5_GPIO_OUT_HIGH 0x1 | ||
| 42 | |||
| 43 | struct aic32x4_setup_data { | ||
| 44 | unsigned int gpio_func[5]; | ||
| 45 | }; | ||
| 46 | |||
| 25 | struct aic32x4_pdata { | 47 | struct aic32x4_pdata { |
| 48 | struct aic32x4_setup_data *setup; | ||
| 26 | u32 power_cfg; | 49 | u32 power_cfg; |
| 27 | u32 micpga_routing; | 50 | u32 micpga_routing; |
| 28 | bool swapdacs; | 51 | bool swapdacs; |
diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c index 49cf9bc32eb6..87307dd0f12e 100644 --- a/sound/soc/codecs/tas2552.c +++ b/sound/soc/codecs/tas2552.c | |||
| @@ -192,7 +192,7 @@ static int tas2552_setup_pll(struct snd_soc_codec *codec, | |||
| 192 | * pll_clk = (.5 * pll_clkin * J.D) / 2^p | 192 | * pll_clk = (.5 * pll_clkin * J.D) / 2^p |
| 193 | * Need to fill in J and D here based on incoming freq | 193 | * Need to fill in J and D here based on incoming freq |
| 194 | */ | 194 | */ |
| 195 | unsigned int d; | 195 | unsigned int d, q, t; |
| 196 | u8 j; | 196 | u8 j; |
| 197 | u8 pll_sel = (tas2552->pll_clk_id << 3) & TAS2552_PLL_SRC_MASK; | 197 | u8 pll_sel = (tas2552->pll_clk_id << 3) & TAS2552_PLL_SRC_MASK; |
| 198 | u8 p = snd_soc_read(codec, TAS2552_PLL_CTRL_1); | 198 | u8 p = snd_soc_read(codec, TAS2552_PLL_CTRL_1); |
| @@ -200,9 +200,12 @@ static int tas2552_setup_pll(struct snd_soc_codec *codec, | |||
| 200 | p = (p >> 7); | 200 | p = (p >> 7); |
| 201 | 201 | ||
| 202 | recalc: | 202 | recalc: |
| 203 | j = (pll_clk * 2 * (1 << p)) / pll_clkin; | 203 | t = (pll_clk * 2) << p; |
| 204 | d = (pll_clk * 2 * (1 << p)) % pll_clkin; | 204 | j = t / pll_clkin; |
| 205 | d /= (pll_clkin / 10000); | 205 | d = t % pll_clkin; |
| 206 | t = pll_clkin / 10000; | ||
| 207 | q = d / (t + 1); | ||
| 208 | d = q + ((9999 - pll_clkin % 10000) * (d / t - q)) / 10000; | ||
| 206 | 209 | ||
| 207 | if (d && (pll_clkin < 512000 || pll_clkin > 9200000)) { | 210 | if (d && (pll_clkin < 512000 || pll_clkin > 9200000)) { |
| 208 | if (tas2552->pll_clk_id == TAS2552_PLL_CLKIN_BCLK) { | 211 | if (tas2552->pll_clk_id == TAS2552_PLL_CLKIN_BCLK) { |
diff --git a/sound/soc/codecs/tlv320aic32x4-i2c.c b/sound/soc/codecs/tlv320aic32x4-i2c.c index 59606cf3008f..385fa2e9525a 100644 --- a/sound/soc/codecs/tlv320aic32x4-i2c.c +++ b/sound/soc/codecs/tlv320aic32x4-i2c.c | |||
| @@ -47,12 +47,14 @@ static int aic32x4_i2c_remove(struct i2c_client *i2c) | |||
| 47 | 47 | ||
| 48 | static const struct i2c_device_id aic32x4_i2c_id[] = { | 48 | static const struct i2c_device_id aic32x4_i2c_id[] = { |
| 49 | { "tlv320aic32x4", 0 }, | 49 | { "tlv320aic32x4", 0 }, |
| 50 | { "tlv320aic32x6", 1 }, | ||
| 50 | { /* sentinel */ } | 51 | { /* sentinel */ } |
| 51 | }; | 52 | }; |
| 52 | MODULE_DEVICE_TABLE(i2c, aic32x4_i2c_id); | 53 | MODULE_DEVICE_TABLE(i2c, aic32x4_i2c_id); |
| 53 | 54 | ||
| 54 | static const struct of_device_id aic32x4_of_id[] = { | 55 | static const struct of_device_id aic32x4_of_id[] = { |
| 55 | { .compatible = "ti,tlv320aic32x4", }, | 56 | { .compatible = "ti,tlv320aic32x4", }, |
| 57 | { .compatible = "ti,tlv320aic32x6", }, | ||
| 56 | { /* senitel */ } | 58 | { /* senitel */ } |
| 57 | }; | 59 | }; |
| 58 | MODULE_DEVICE_TABLE(of, aic32x4_of_id); | 60 | MODULE_DEVICE_TABLE(of, aic32x4_of_id); |
diff --git a/sound/soc/codecs/tlv320aic32x4-spi.c b/sound/soc/codecs/tlv320aic32x4-spi.c index 724fcdd491b2..07d78ae51e05 100644 --- a/sound/soc/codecs/tlv320aic32x4-spi.c +++ b/sound/soc/codecs/tlv320aic32x4-spi.c | |||
| @@ -48,12 +48,14 @@ static int aic32x4_spi_remove(struct spi_device *spi) | |||
| 48 | 48 | ||
| 49 | static const struct spi_device_id aic32x4_spi_id[] = { | 49 | static const struct spi_device_id aic32x4_spi_id[] = { |
| 50 | { "tlv320aic32x4", 0 }, | 50 | { "tlv320aic32x4", 0 }, |
| 51 | { "tlv320aic32x6", 1 }, | ||
| 51 | { /* sentinel */ } | 52 | { /* sentinel */ } |
| 52 | }; | 53 | }; |
| 53 | MODULE_DEVICE_TABLE(spi, aic32x4_spi_id); | 54 | MODULE_DEVICE_TABLE(spi, aic32x4_spi_id); |
| 54 | 55 | ||
| 55 | static const struct of_device_id aic32x4_of_id[] = { | 56 | static const struct of_device_id aic32x4_of_id[] = { |
| 56 | { .compatible = "ti,tlv320aic32x4", }, | 57 | { .compatible = "ti,tlv320aic32x4", }, |
| 58 | { .compatible = "ti,tlv320aic32x6", }, | ||
| 57 | { /* senitel */ } | 59 | { /* senitel */ } |
| 58 | }; | 60 | }; |
| 59 | MODULE_DEVICE_TABLE(of, aic32x4_of_id); | 61 | MODULE_DEVICE_TABLE(of, aic32x4_of_id); |
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c index ccfc955321ae..e694f5f04eb9 100644 --- a/sound/soc/codecs/tlv320aic32x4.c +++ b/sound/soc/codecs/tlv320aic32x4.c | |||
| @@ -74,6 +74,152 @@ struct aic32x4_priv { | |||
| 74 | struct regulator *supply_iov; | 74 | struct regulator *supply_iov; |
| 75 | struct regulator *supply_dv; | 75 | struct regulator *supply_dv; |
| 76 | struct regulator *supply_av; | 76 | struct regulator *supply_av; |
| 77 | |||
| 78 | struct aic32x4_setup_data *setup; | ||
| 79 | struct device *dev; | ||
| 80 | }; | ||
| 81 | |||
| 82 | static int aic32x4_get_mfp1_gpio(struct snd_kcontrol *kcontrol, | ||
| 83 | struct snd_ctl_elem_value *ucontrol) | ||
| 84 | { | ||
| 85 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | ||
| 86 | u8 val; | ||
| 87 | |||
| 88 | val = snd_soc_read(codec, AIC32X4_DINCTL); | ||
| 89 | |||
| 90 | ucontrol->value.integer.value[0] = (val & 0x01); | ||
| 91 | |||
| 92 | return 0; | ||
| 93 | }; | ||
| 94 | |||
| 95 | static int aic32x4_set_mfp2_gpio(struct snd_kcontrol *kcontrol, | ||
| 96 | struct snd_ctl_elem_value *ucontrol) | ||
| 97 | { | ||
| 98 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | ||
| 99 | u8 val; | ||
| 100 | u8 gpio_check; | ||
| 101 | |||
| 102 | val = snd_soc_read(codec, AIC32X4_DOUTCTL); | ||
| 103 | gpio_check = (val & AIC32X4_MFP_GPIO_ENABLED); | ||
| 104 | if (gpio_check != AIC32X4_MFP_GPIO_ENABLED) { | ||
| 105 | printk(KERN_ERR "%s: MFP2 is not configure as a GPIO output\n", | ||
| 106 | __func__); | ||
| 107 | return -EINVAL; | ||
| 108 | } | ||
| 109 | |||
| 110 | if (ucontrol->value.integer.value[0] == (val & AIC32X4_MFP2_GPIO_OUT_HIGH)) | ||
| 111 | return 0; | ||
| 112 | |||
| 113 | if (ucontrol->value.integer.value[0]) | ||
| 114 | val |= ucontrol->value.integer.value[0]; | ||
| 115 | else | ||
| 116 | val &= ~AIC32X4_MFP2_GPIO_OUT_HIGH; | ||
| 117 | |||
| 118 | snd_soc_write(codec, AIC32X4_DOUTCTL, val); | ||
| 119 | |||
| 120 | return 0; | ||
| 121 | }; | ||
| 122 | |||
| 123 | static int aic32x4_get_mfp3_gpio(struct snd_kcontrol *kcontrol, | ||
| 124 | struct snd_ctl_elem_value *ucontrol) | ||
| 125 | { | ||
| 126 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | ||
| 127 | u8 val; | ||
| 128 | |||
| 129 | val = snd_soc_read(codec, AIC32X4_SCLKCTL); | ||
| 130 | |||
| 131 | ucontrol->value.integer.value[0] = (val & 0x01); | ||
| 132 | |||
| 133 | return 0; | ||
| 134 | }; | ||
| 135 | |||
| 136 | static int aic32x4_set_mfp4_gpio(struct snd_kcontrol *kcontrol, | ||
| 137 | struct snd_ctl_elem_value *ucontrol) | ||
| 138 | { | ||
| 139 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | ||
| 140 | u8 val; | ||
| 141 | u8 gpio_check; | ||
| 142 | |||
| 143 | val = snd_soc_read(codec, AIC32X4_MISOCTL); | ||
| 144 | gpio_check = (val & AIC32X4_MFP_GPIO_ENABLED); | ||
| 145 | if (gpio_check != AIC32X4_MFP_GPIO_ENABLED) { | ||
| 146 | printk(KERN_ERR "%s: MFP4 is not configure as a GPIO output\n", | ||
| 147 | __func__); | ||
| 148 | return -EINVAL; | ||
| 149 | } | ||
| 150 | |||
| 151 | if (ucontrol->value.integer.value[0] == (val & AIC32X4_MFP5_GPIO_OUT_HIGH)) | ||
| 152 | return 0; | ||
| 153 | |||
| 154 | if (ucontrol->value.integer.value[0]) | ||
| 155 | val |= ucontrol->value.integer.value[0]; | ||
| 156 | else | ||
| 157 | val &= ~AIC32X4_MFP5_GPIO_OUT_HIGH; | ||
| 158 | |||
| 159 | snd_soc_write(codec, AIC32X4_MISOCTL, val); | ||
| 160 | |||
| 161 | return 0; | ||
| 162 | }; | ||
| 163 | |||
| 164 | static int aic32x4_get_mfp5_gpio(struct snd_kcontrol *kcontrol, | ||
| 165 | struct snd_ctl_elem_value *ucontrol) | ||
| 166 | { | ||
| 167 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | ||
| 168 | u8 val; | ||
| 169 | |||
| 170 | val = snd_soc_read(codec, AIC32X4_GPIOCTL); | ||
| 171 | ucontrol->value.integer.value[0] = ((val & 0x2) >> 1); | ||
| 172 | |||
| 173 | return 0; | ||
| 174 | }; | ||
| 175 | |||
| 176 | static int aic32x4_set_mfp5_gpio(struct snd_kcontrol *kcontrol, | ||
| 177 | struct snd_ctl_elem_value *ucontrol) | ||
| 178 | { | ||
| 179 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | ||
| 180 | u8 val; | ||
| 181 | u8 gpio_check; | ||
| 182 | |||
| 183 | val = snd_soc_read(codec, AIC32X4_GPIOCTL); | ||
| 184 | gpio_check = (val & AIC32X4_MFP5_GPIO_OUTPUT); | ||
| 185 | if (gpio_check != AIC32X4_MFP5_GPIO_OUTPUT) { | ||
| 186 | printk(KERN_ERR "%s: MFP5 is not configure as a GPIO output\n", | ||
| 187 | __func__); | ||
| 188 | return -EINVAL; | ||
| 189 | } | ||
| 190 | |||
| 191 | if (ucontrol->value.integer.value[0] == (val & 0x1)) | ||
| 192 | return 0; | ||
| 193 | |||
| 194 | if (ucontrol->value.integer.value[0]) | ||
| 195 | val |= ucontrol->value.integer.value[0]; | ||
| 196 | else | ||
| 197 | val &= 0xfe; | ||
| 198 | |||
| 199 | snd_soc_write(codec, AIC32X4_GPIOCTL, val); | ||
| 200 | |||
| 201 | return 0; | ||
| 202 | }; | ||
| 203 | |||
| 204 | static const struct snd_kcontrol_new aic32x4_mfp1[] = { | ||
| 205 | SOC_SINGLE_BOOL_EXT("MFP1 GPIO", 0, aic32x4_get_mfp1_gpio, NULL), | ||
| 206 | }; | ||
| 207 | |||
| 208 | static const struct snd_kcontrol_new aic32x4_mfp2[] = { | ||
| 209 | SOC_SINGLE_BOOL_EXT("MFP2 GPIO", 0, NULL, aic32x4_set_mfp2_gpio), | ||
| 210 | }; | ||
| 211 | |||
| 212 | static const struct snd_kcontrol_new aic32x4_mfp3[] = { | ||
| 213 | SOC_SINGLE_BOOL_EXT("MFP3 GPIO", 0, aic32x4_get_mfp3_gpio, NULL), | ||
| 214 | }; | ||
| 215 | |||
| 216 | static const struct snd_kcontrol_new aic32x4_mfp4[] = { | ||
| 217 | SOC_SINGLE_BOOL_EXT("MFP4 GPIO", 0, NULL, aic32x4_set_mfp4_gpio), | ||
| 218 | }; | ||
| 219 | |||
| 220 | static const struct snd_kcontrol_new aic32x4_mfp5[] = { | ||
| 221 | SOC_SINGLE_BOOL_EXT("MFP5 GPIO", 0, aic32x4_get_mfp5_gpio, | ||
| 222 | aic32x4_set_mfp5_gpio), | ||
| 77 | }; | 223 | }; |
| 78 | 224 | ||
| 79 | /* 0dB min, 0.5dB steps */ | 225 | /* 0dB min, 0.5dB steps */ |
| @@ -734,6 +880,52 @@ static struct snd_soc_dai_driver aic32x4_dai = { | |||
| 734 | .symmetric_rates = 1, | 880 | .symmetric_rates = 1, |
| 735 | }; | 881 | }; |
| 736 | 882 | ||
| 883 | static void aic32x4_setup_gpios(struct snd_soc_codec *codec) | ||
| 884 | { | ||
| 885 | struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec); | ||
| 886 | |||
| 887 | /* setup GPIO functions */ | ||
| 888 | /* MFP1 */ | ||
| 889 | if (aic32x4->setup->gpio_func[0] != AIC32X4_MFPX_DEFAULT_VALUE) { | ||
| 890 | snd_soc_write(codec, AIC32X4_DINCTL, | ||
| 891 | aic32x4->setup->gpio_func[0]); | ||
| 892 | snd_soc_add_codec_controls(codec, aic32x4_mfp1, | ||
| 893 | ARRAY_SIZE(aic32x4_mfp1)); | ||
| 894 | } | ||
| 895 | |||
| 896 | /* MFP2 */ | ||
| 897 | if (aic32x4->setup->gpio_func[1] != AIC32X4_MFPX_DEFAULT_VALUE) { | ||
| 898 | snd_soc_write(codec, AIC32X4_DOUTCTL, | ||
| 899 | aic32x4->setup->gpio_func[1]); | ||
| 900 | snd_soc_add_codec_controls(codec, aic32x4_mfp2, | ||
| 901 | ARRAY_SIZE(aic32x4_mfp2)); | ||
| 902 | } | ||
| 903 | |||
| 904 | /* MFP3 */ | ||
| 905 | if (aic32x4->setup->gpio_func[2] != AIC32X4_MFPX_DEFAULT_VALUE) { | ||
| 906 | snd_soc_write(codec, AIC32X4_SCLKCTL, | ||
| 907 | aic32x4->setup->gpio_func[2]); | ||
| 908 | snd_soc_add_codec_controls(codec, aic32x4_mfp3, | ||
| 909 | ARRAY_SIZE(aic32x4_mfp3)); | ||
| 910 | } | ||
| 911 | |||
| 912 | /* MFP4 */ | ||
| 913 | if (aic32x4->setup->gpio_func[3] != AIC32X4_MFPX_DEFAULT_VALUE) { | ||
| 914 | snd_soc_write(codec, AIC32X4_MISOCTL, | ||
| 915 | aic32x4->setup->gpio_func[3]); | ||
| 916 | snd_soc_add_codec_controls(codec, aic32x4_mfp4, | ||
| 917 | ARRAY_SIZE(aic32x4_mfp4)); | ||
| 918 | } | ||
| 919 | |||
| 920 | /* MFP5 */ | ||
| 921 | if (aic32x4->setup->gpio_func[4] != AIC32X4_MFPX_DEFAULT_VALUE) { | ||
| 922 | snd_soc_write(codec, AIC32X4_GPIOCTL, | ||
| 923 | aic32x4->setup->gpio_func[4]); | ||
| 924 | snd_soc_add_codec_controls(codec, aic32x4_mfp5, | ||
| 925 | ARRAY_SIZE(aic32x4_mfp5)); | ||
| 926 | } | ||
| 927 | } | ||
| 928 | |||
| 737 | static int aic32x4_codec_probe(struct snd_soc_codec *codec) | 929 | static int aic32x4_codec_probe(struct snd_soc_codec *codec) |
| 738 | { | 930 | { |
| 739 | struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec); | 931 | struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec); |
| @@ -746,6 +938,9 @@ static int aic32x4_codec_probe(struct snd_soc_codec *codec) | |||
| 746 | 938 | ||
| 747 | snd_soc_write(codec, AIC32X4_RESET, 0x01); | 939 | snd_soc_write(codec, AIC32X4_RESET, 0x01); |
| 748 | 940 | ||
| 941 | if (aic32x4->setup) | ||
| 942 | aic32x4_setup_gpios(codec); | ||
| 943 | |||
| 749 | /* Power platform configuration */ | 944 | /* Power platform configuration */ |
| 750 | if (aic32x4->power_cfg & AIC32X4_PWR_MICBIAS_2075_LDOIN) { | 945 | if (aic32x4->power_cfg & AIC32X4_PWR_MICBIAS_2075_LDOIN) { |
| 751 | snd_soc_write(codec, AIC32X4_MICBIAS, AIC32X4_MICBIAS_LDOIN | | 946 | snd_soc_write(codec, AIC32X4_MICBIAS, AIC32X4_MICBIAS_LDOIN | |
| @@ -810,10 +1005,20 @@ static const struct snd_soc_codec_driver soc_codec_dev_aic32x4 = { | |||
| 810 | static int aic32x4_parse_dt(struct aic32x4_priv *aic32x4, | 1005 | static int aic32x4_parse_dt(struct aic32x4_priv *aic32x4, |
| 811 | struct device_node *np) | 1006 | struct device_node *np) |
| 812 | { | 1007 | { |
| 1008 | struct aic32x4_setup_data *aic32x4_setup; | ||
| 1009 | |||
| 1010 | aic32x4_setup = devm_kzalloc(aic32x4->dev, sizeof(*aic32x4_setup), | ||
| 1011 | GFP_KERNEL); | ||
| 1012 | if (!aic32x4_setup) | ||
| 1013 | return -ENOMEM; | ||
| 1014 | |||
| 813 | aic32x4->swapdacs = false; | 1015 | aic32x4->swapdacs = false; |
| 814 | aic32x4->micpga_routing = 0; | 1016 | aic32x4->micpga_routing = 0; |
| 815 | aic32x4->rstn_gpio = of_get_named_gpio(np, "reset-gpios", 0); | 1017 | aic32x4->rstn_gpio = of_get_named_gpio(np, "reset-gpios", 0); |
| 816 | 1018 | ||
| 1019 | if (of_property_read_u32_array(np, "aic32x4-gpio-func", | ||
| 1020 | aic32x4_setup->gpio_func, 5) >= 0) | ||
| 1021 | aic32x4->setup = aic32x4_setup; | ||
| 817 | return 0; | 1022 | return 0; |
| 818 | } | 1023 | } |
| 819 | 1024 | ||
| @@ -932,6 +1137,7 @@ int aic32x4_probe(struct device *dev, struct regmap *regmap) | |||
| 932 | if (aic32x4 == NULL) | 1137 | if (aic32x4 == NULL) |
| 933 | return -ENOMEM; | 1138 | return -ENOMEM; |
| 934 | 1139 | ||
| 1140 | aic32x4->dev = dev; | ||
| 935 | dev_set_drvdata(dev, aic32x4); | 1141 | dev_set_drvdata(dev, aic32x4); |
| 936 | 1142 | ||
| 937 | if (pdata) { | 1143 | if (pdata) { |
diff --git a/sound/soc/codecs/tlv320aic32x4.h b/sound/soc/codecs/tlv320aic32x4.h index a197dd51addc..da7cec482bcb 100644 --- a/sound/soc/codecs/tlv320aic32x4.h +++ b/sound/soc/codecs/tlv320aic32x4.h | |||
| @@ -44,8 +44,11 @@ int aic32x4_remove(struct device *dev); | |||
| 44 | #define AIC32X4_IFACE4 31 | 44 | #define AIC32X4_IFACE4 31 |
| 45 | #define AIC32X4_IFACE5 32 | 45 | #define AIC32X4_IFACE5 32 |
| 46 | #define AIC32X4_IFACE6 33 | 46 | #define AIC32X4_IFACE6 33 |
| 47 | #define AIC32X4_GPIOCTL 52 | ||
| 47 | #define AIC32X4_DOUTCTL 53 | 48 | #define AIC32X4_DOUTCTL 53 |
| 48 | #define AIC32X4_DINCTL 54 | 49 | #define AIC32X4_DINCTL 54 |
| 50 | #define AIC32X4_MISOCTL 55 | ||
| 51 | #define AIC32X4_SCLKCTL 56 | ||
| 49 | #define AIC32X4_DACSPB 60 | 52 | #define AIC32X4_DACSPB 60 |
| 50 | #define AIC32X4_ADCSPB 61 | 53 | #define AIC32X4_ADCSPB 61 |
| 51 | #define AIC32X4_DACSETUP 63 | 54 | #define AIC32X4_DACSETUP 63 |
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index 405f4602888a..06f92571eba4 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c | |||
| @@ -93,6 +93,8 @@ struct aic3x_priv { | |||
| 93 | 93 | ||
| 94 | /* Selects the micbias voltage */ | 94 | /* Selects the micbias voltage */ |
| 95 | enum aic3x_micbias_voltage micbias_vg; | 95 | enum aic3x_micbias_voltage micbias_vg; |
| 96 | /* Output Common-Mode Voltage */ | ||
| 97 | u8 ocmv; | ||
| 96 | }; | 98 | }; |
| 97 | 99 | ||
| 98 | static const struct reg_default aic3x_reg[] = { | 100 | static const struct reg_default aic3x_reg[] = { |
| @@ -1572,6 +1574,10 @@ static int aic3x_init(struct snd_soc_codec *codec) | |||
| 1572 | break; | 1574 | break; |
| 1573 | } | 1575 | } |
| 1574 | 1576 | ||
| 1577 | /* Output common-mode voltage = 1.5 V */ | ||
| 1578 | snd_soc_update_bits(codec, HPOUT_SC, HPOUT_SC_OCMV_MASK, | ||
| 1579 | aic3x->ocmv << HPOUT_SC_OCMV_SHIFT); | ||
| 1580 | |||
| 1575 | return 0; | 1581 | return 0; |
| 1576 | } | 1582 | } |
| 1577 | 1583 | ||
| @@ -1699,6 +1705,43 @@ static const struct snd_soc_codec_driver soc_codec_dev_aic3x = { | |||
| 1699 | }, | 1705 | }, |
| 1700 | }; | 1706 | }; |
| 1701 | 1707 | ||
| 1708 | static void aic3x_configure_ocmv(struct i2c_client *client) | ||
| 1709 | { | ||
| 1710 | struct device_node *np = client->dev.of_node; | ||
| 1711 | struct aic3x_priv *aic3x = i2c_get_clientdata(client); | ||
| 1712 | u32 value; | ||
| 1713 | int dvdd, avdd; | ||
| 1714 | |||
| 1715 | if (np && !of_property_read_u32(np, "ai3x-ocmv", &value)) { | ||
| 1716 | /* OCMV setting is forced by DT */ | ||
| 1717 | if (value <= 3) { | ||
| 1718 | aic3x->ocmv = value; | ||
| 1719 | return; | ||
| 1720 | } | ||
| 1721 | } | ||
| 1722 | |||
| 1723 | dvdd = regulator_get_voltage(aic3x->supplies[1].consumer); | ||
| 1724 | avdd = regulator_get_voltage(aic3x->supplies[2].consumer); | ||
| 1725 | |||
| 1726 | if (avdd > 3600000 || dvdd > 1950000) { | ||
| 1727 | dev_warn(&client->dev, | ||
| 1728 | "Too high supply voltage(s) AVDD: %d, DVDD: %d\n", | ||
| 1729 | avdd, dvdd); | ||
| 1730 | } else if (avdd == 3600000 && dvdd == 1950000) { | ||
| 1731 | aic3x->ocmv = HPOUT_SC_OCMV_1_8V; | ||
| 1732 | } else if (avdd > 3300000 && dvdd > 1800000) { | ||
| 1733 | aic3x->ocmv = HPOUT_SC_OCMV_1_65V; | ||
| 1734 | } else if (avdd > 3000000 && dvdd > 1650000) { | ||
| 1735 | aic3x->ocmv = HPOUT_SC_OCMV_1_5V; | ||
| 1736 | } else if (avdd >= 2700000 && dvdd >= 1525000) { | ||
| 1737 | aic3x->ocmv = HPOUT_SC_OCMV_1_35V; | ||
| 1738 | } else { | ||
| 1739 | dev_warn(&client->dev, | ||
| 1740 | "Invalid supply voltage(s) AVDD: %d, DVDD: %d\n", | ||
| 1741 | avdd, dvdd); | ||
| 1742 | } | ||
| 1743 | } | ||
| 1744 | |||
| 1702 | /* | 1745 | /* |
| 1703 | * AIC3X 2 wire address can be up to 4 devices with device addresses | 1746 | * AIC3X 2 wire address can be up to 4 devices with device addresses |
| 1704 | * 0x18, 0x19, 0x1A, 0x1B | 1747 | * 0x18, 0x19, 0x1A, 0x1B |
| @@ -1816,6 +1859,8 @@ static int aic3x_i2c_probe(struct i2c_client *i2c, | |||
| 1816 | goto err_gpio; | 1859 | goto err_gpio; |
| 1817 | } | 1860 | } |
| 1818 | 1861 | ||
| 1862 | aic3x_configure_ocmv(i2c); | ||
| 1863 | |||
| 1819 | if (aic3x->model == AIC3X_MODEL_3007) { | 1864 | if (aic3x->model == AIC3X_MODEL_3007) { |
| 1820 | ret = regmap_register_patch(aic3x->regmap, aic3007_class_d, | 1865 | ret = regmap_register_patch(aic3x->regmap, aic3007_class_d, |
| 1821 | ARRAY_SIZE(aic3007_class_d)); | 1866 | ARRAY_SIZE(aic3007_class_d)); |
diff --git a/sound/soc/codecs/tlv320aic3x.h b/sound/soc/codecs/tlv320aic3x.h index 89fa692df206..34c35196aa0d 100644 --- a/sound/soc/codecs/tlv320aic3x.h +++ b/sound/soc/codecs/tlv320aic3x.h | |||
| @@ -243,6 +243,14 @@ | |||
| 243 | #define MICBIAS_LEVEL_SHIFT (6) | 243 | #define MICBIAS_LEVEL_SHIFT (6) |
| 244 | #define MICBIAS_LEVEL_MASK (3 << 6) | 244 | #define MICBIAS_LEVEL_MASK (3 << 6) |
| 245 | 245 | ||
| 246 | /* HPOUT_SC */ | ||
| 247 | #define HPOUT_SC_OCMV_MASK (3 << 6) | ||
| 248 | #define HPOUT_SC_OCMV_SHIFT (6) | ||
| 249 | #define HPOUT_SC_OCMV_1_35V 0 | ||
| 250 | #define HPOUT_SC_OCMV_1_5V 1 | ||
| 251 | #define HPOUT_SC_OCMV_1_65V 2 | ||
| 252 | #define HPOUT_SC_OCMV_1_8V 3 | ||
| 253 | |||
| 246 | /* headset detection / button API */ | 254 | /* headset detection / button API */ |
| 247 | 255 | ||
| 248 | /* The AIC3x supports detection of stereo headsets (GND + left + right signal) | 256 | /* The AIC3x supports detection of stereo headsets (GND + left + right signal) |
diff --git a/sound/soc/tegra/Kconfig b/sound/soc/tegra/Kconfig index efbe8d4c019e..6875fc39a575 100644 --- a/sound/soc/tegra/Kconfig +++ b/sound/soc/tegra/Kconfig | |||
| @@ -9,8 +9,8 @@ config SND_SOC_TEGRA | |||
| 9 | Say Y or M here if you want support for SoC audio on Tegra. | 9 | Say Y or M here if you want support for SoC audio on Tegra. |
| 10 | 10 | ||
| 11 | config SND_SOC_TEGRA20_AC97 | 11 | config SND_SOC_TEGRA20_AC97 |
| 12 | tristate | 12 | tristate "Tegra20 AC97 interface" |
| 13 | depends on SND_SOC_TEGRA && ARCH_TEGRA_2x_SOC | 13 | depends on SND_SOC_TEGRA |
| 14 | select SND_SOC_AC97_BUS | 14 | select SND_SOC_AC97_BUS |
| 15 | select SND_SOC_TEGRA20_DAS | 15 | select SND_SOC_TEGRA20_DAS |
| 16 | help | 16 | help |
| @@ -19,16 +19,16 @@ config SND_SOC_TEGRA20_AC97 | |||
| 19 | machine drivers to support below. | 19 | machine drivers to support below. |
| 20 | 20 | ||
| 21 | config SND_SOC_TEGRA20_DAS | 21 | config SND_SOC_TEGRA20_DAS |
| 22 | tristate | 22 | tristate "Tegra20 DAS module" |
| 23 | depends on SND_SOC_TEGRA && ARCH_TEGRA_2x_SOC | 23 | depends on SND_SOC_TEGRA |
| 24 | help | 24 | help |
| 25 | Say Y or M if you want to add support for the Tegra20 DAS module. | 25 | Say Y or M if you want to add support for the Tegra20 DAS module. |
| 26 | You will also need to select the individual machine drivers to | 26 | You will also need to select the individual machine drivers to |
| 27 | support below. | 27 | support below. |
| 28 | 28 | ||
| 29 | config SND_SOC_TEGRA20_I2S | 29 | config SND_SOC_TEGRA20_I2S |
| 30 | tristate | 30 | tristate "Tegra20 I2S interface" |
| 31 | depends on SND_SOC_TEGRA && ARCH_TEGRA_2x_SOC | 31 | depends on SND_SOC_TEGRA |
| 32 | select SND_SOC_TEGRA20_DAS | 32 | select SND_SOC_TEGRA20_DAS |
| 33 | help | 33 | help |
| 34 | Say Y or M if you want to add support for codecs attached to the | 34 | Say Y or M if you want to add support for codecs attached to the |
| @@ -36,8 +36,8 @@ config SND_SOC_TEGRA20_I2S | |||
| 36 | machine drivers to support below. | 36 | machine drivers to support below. |
| 37 | 37 | ||
| 38 | config SND_SOC_TEGRA20_SPDIF | 38 | config SND_SOC_TEGRA20_SPDIF |
| 39 | tristate | 39 | tristate "Tegra20 SPDIF interface" |
| 40 | depends on SND_SOC_TEGRA && ARCH_TEGRA_2x_SOC | 40 | depends on SND_SOC_TEGRA |
| 41 | default m | 41 | default m |
| 42 | help | 42 | help |
| 43 | Say Y or M if you want to add support for the Tegra20 SPDIF interface. | 43 | Say Y or M if you want to add support for the Tegra20 SPDIF interface. |
| @@ -45,16 +45,16 @@ config SND_SOC_TEGRA20_SPDIF | |||
| 45 | below. | 45 | below. |
| 46 | 46 | ||
| 47 | config SND_SOC_TEGRA30_AHUB | 47 | config SND_SOC_TEGRA30_AHUB |
| 48 | tristate | 48 | tristate "Tegra30 AHUB module" |
| 49 | depends on SND_SOC_TEGRA && ARCH_TEGRA_3x_SOC | 49 | depends on SND_SOC_TEGRA |
| 50 | help | 50 | help |
| 51 | Say Y or M if you want to add support for the Tegra20 AHUB module. | 51 | Say Y or M if you want to add support for the Tegra30 AHUB module. |
| 52 | You will also need to select the individual machine drivers to | 52 | You will also need to select the individual machine drivers to |
| 53 | support below. | 53 | support below. |
| 54 | 54 | ||
| 55 | config SND_SOC_TEGRA30_I2S | 55 | config SND_SOC_TEGRA30_I2S |
| 56 | tristate | 56 | tristate "Tegra30 I2S interface" |
| 57 | depends on SND_SOC_TEGRA && ARCH_TEGRA_3x_SOC | 57 | depends on SND_SOC_TEGRA |
| 58 | select SND_SOC_TEGRA30_AHUB | 58 | select SND_SOC_TEGRA30_AHUB |
| 59 | help | 59 | help |
| 60 | Say Y or M if you want to add support for codecs attached to the | 60 | Say Y or M if you want to add support for codecs attached to the |
| @@ -64,8 +64,6 @@ config SND_SOC_TEGRA30_I2S | |||
| 64 | config SND_SOC_TEGRA_RT5640 | 64 | config SND_SOC_TEGRA_RT5640 |
| 65 | tristate "SoC Audio support for Tegra boards using an RT5640 codec" | 65 | tristate "SoC Audio support for Tegra boards using an RT5640 codec" |
| 66 | depends on SND_SOC_TEGRA && I2C && GPIOLIB | 66 | depends on SND_SOC_TEGRA && I2C && GPIOLIB |
| 67 | select SND_SOC_TEGRA20_I2S if ARCH_TEGRA_2x_SOC | ||
| 68 | select SND_SOC_TEGRA30_I2S if ARCH_TEGRA_3x_SOC | ||
| 69 | select SND_SOC_RT5640 | 67 | select SND_SOC_RT5640 |
| 70 | help | 68 | help |
| 71 | Say Y or M here if you want to add support for SoC audio on Tegra | 69 | Say Y or M here if you want to add support for SoC audio on Tegra |
| @@ -74,8 +72,6 @@ config SND_SOC_TEGRA_RT5640 | |||
| 74 | config SND_SOC_TEGRA_WM8753 | 72 | config SND_SOC_TEGRA_WM8753 |
| 75 | tristate "SoC Audio support for Tegra boards using a WM8753 codec" | 73 | tristate "SoC Audio support for Tegra boards using a WM8753 codec" |
| 76 | depends on SND_SOC_TEGRA && I2C && GPIOLIB | 74 | depends on SND_SOC_TEGRA && I2C && GPIOLIB |
| 77 | select SND_SOC_TEGRA20_I2S if ARCH_TEGRA_2x_SOC | ||
| 78 | select SND_SOC_TEGRA30_I2S if ARCH_TEGRA_3x_SOC | ||
| 79 | select SND_SOC_WM8753 | 75 | select SND_SOC_WM8753 |
| 80 | help | 76 | help |
| 81 | Say Y or M here if you want to add support for SoC audio on Tegra | 77 | Say Y or M here if you want to add support for SoC audio on Tegra |
| @@ -84,8 +80,6 @@ config SND_SOC_TEGRA_WM8753 | |||
| 84 | config SND_SOC_TEGRA_WM8903 | 80 | config SND_SOC_TEGRA_WM8903 |
| 85 | tristate "SoC Audio support for Tegra boards using a WM8903 codec" | 81 | tristate "SoC Audio support for Tegra boards using a WM8903 codec" |
| 86 | depends on SND_SOC_TEGRA && I2C && GPIOLIB | 82 | depends on SND_SOC_TEGRA && I2C && GPIOLIB |
| 87 | select SND_SOC_TEGRA20_I2S if ARCH_TEGRA_2x_SOC | ||
| 88 | select SND_SOC_TEGRA30_I2S if ARCH_TEGRA_3x_SOC | ||
| 89 | select SND_SOC_WM8903 | 83 | select SND_SOC_WM8903 |
| 90 | help | 84 | help |
| 91 | Say Y or M here if you want to add support for SoC audio on Tegra | 85 | Say Y or M here if you want to add support for SoC audio on Tegra |
| @@ -94,7 +88,7 @@ config SND_SOC_TEGRA_WM8903 | |||
| 94 | 88 | ||
| 95 | config SND_SOC_TEGRA_WM9712 | 89 | config SND_SOC_TEGRA_WM9712 |
| 96 | tristate "SoC Audio support for Tegra boards using a WM9712 codec" | 90 | tristate "SoC Audio support for Tegra boards using a WM9712 codec" |
| 97 | depends on SND_SOC_TEGRA && ARCH_TEGRA_2x_SOC && GPIOLIB | 91 | depends on SND_SOC_TEGRA && GPIOLIB |
| 98 | select SND_SOC_TEGRA20_AC97 | 92 | select SND_SOC_TEGRA20_AC97 |
| 99 | select SND_SOC_WM9712 | 93 | select SND_SOC_WM9712 |
| 100 | help | 94 | help |
| @@ -104,7 +98,6 @@ config SND_SOC_TEGRA_WM9712 | |||
| 104 | config SND_SOC_TEGRA_TRIMSLICE | 98 | config SND_SOC_TEGRA_TRIMSLICE |
| 105 | tristate "SoC Audio support for TrimSlice board" | 99 | tristate "SoC Audio support for TrimSlice board" |
| 106 | depends on SND_SOC_TEGRA && I2C | 100 | depends on SND_SOC_TEGRA && I2C |
| 107 | select SND_SOC_TEGRA20_I2S if ARCH_TEGRA_2x_SOC | ||
| 108 | select SND_SOC_TLV320AIC23_I2C | 101 | select SND_SOC_TLV320AIC23_I2C |
| 109 | help | 102 | help |
| 110 | Say Y or M here if you want to add support for SoC audio on the | 103 | Say Y or M here if you want to add support for SoC audio on the |
| @@ -113,7 +106,6 @@ config SND_SOC_TEGRA_TRIMSLICE | |||
| 113 | config SND_SOC_TEGRA_ALC5632 | 106 | config SND_SOC_TEGRA_ALC5632 |
| 114 | tristate "SoC Audio support for Tegra boards using an ALC5632 codec" | 107 | tristate "SoC Audio support for Tegra boards using an ALC5632 codec" |
| 115 | depends on SND_SOC_TEGRA && I2C && GPIOLIB | 108 | depends on SND_SOC_TEGRA && I2C && GPIOLIB |
| 116 | select SND_SOC_TEGRA20_I2S if ARCH_TEGRA_2x_SOC | ||
| 117 | select SND_SOC_ALC5632 | 109 | select SND_SOC_ALC5632 |
| 118 | help | 110 | help |
| 119 | Say Y or M here if you want to add support for SoC audio on the | 111 | Say Y or M here if you want to add support for SoC audio on the |
| @@ -122,8 +114,6 @@ config SND_SOC_TEGRA_ALC5632 | |||
| 122 | config SND_SOC_TEGRA_MAX98090 | 114 | config SND_SOC_TEGRA_MAX98090 |
| 123 | tristate "SoC Audio support for Tegra boards using a MAX98090 codec" | 115 | tristate "SoC Audio support for Tegra boards using a MAX98090 codec" |
| 124 | depends on SND_SOC_TEGRA && I2C && GPIOLIB | 116 | depends on SND_SOC_TEGRA && I2C && GPIOLIB |
| 125 | select SND_SOC_TEGRA20_I2S if ARCH_TEGRA_2x_SOC | ||
| 126 | select SND_SOC_TEGRA30_I2S if ARCH_TEGRA_3x_SOC | ||
| 127 | select SND_SOC_MAX98090 | 117 | select SND_SOC_MAX98090 |
| 128 | help | 118 | help |
| 129 | Say Y or M here if you want to add support for SoC audio on Tegra | 119 | Say Y or M here if you want to add support for SoC audio on Tegra |
| @@ -132,8 +122,6 @@ config SND_SOC_TEGRA_MAX98090 | |||
| 132 | config SND_SOC_TEGRA_RT5677 | 122 | config SND_SOC_TEGRA_RT5677 |
| 133 | tristate "SoC Audio support for Tegra boards using a RT5677 codec" | 123 | tristate "SoC Audio support for Tegra boards using a RT5677 codec" |
| 134 | depends on SND_SOC_TEGRA && I2C && GPIOLIB | 124 | depends on SND_SOC_TEGRA && I2C && GPIOLIB |
| 135 | select SND_SOC_TEGRA20_I2S if ARCH_TEGRA_2x_SOC | ||
| 136 | select SND_SOC_TEGRA30_I2S if ARCH_TEGRA_3x_SOC | ||
| 137 | select SND_SOC_RT5677 | 125 | select SND_SOC_RT5677 |
| 138 | help | 126 | help |
| 139 | Say Y or M here if you want to add support for SoC audio on Tegra | 127 | Say Y or M here if you want to add support for SoC audio on Tegra |
| @@ -142,8 +130,6 @@ config SND_SOC_TEGRA_RT5677 | |||
| 142 | config SND_SOC_TEGRA_SGTL5000 | 130 | config SND_SOC_TEGRA_SGTL5000 |
| 143 | tristate "SoC Audio support for Tegra boards using a SGTL5000 codec" | 131 | tristate "SoC Audio support for Tegra boards using a SGTL5000 codec" |
| 144 | depends on SND_SOC_TEGRA && I2C && GPIOLIB | 132 | depends on SND_SOC_TEGRA && I2C && GPIOLIB |
| 145 | select SND_SOC_TEGRA20_I2S if ARCH_TEGRA_2x_SOC | ||
| 146 | select SND_SOC_TEGRA30_I2S if ARCH_TEGRA_3x_SOC | ||
| 147 | select SND_SOC_SGTL5000 | 133 | select SND_SOC_SGTL5000 |
| 148 | help | 134 | help |
| 149 | Say Y or M here if you want to add support for SoC audio on Tegra | 135 | Say Y or M here if you want to add support for SoC audio on Tegra |
diff --git a/sound/soc/tegra/tegra30_ahub.c b/sound/soc/tegra/tegra30_ahub.c index 8c10ae7982ba..43679aeeb12b 100644 --- a/sound/soc/tegra/tegra30_ahub.c +++ b/sound/soc/tegra/tegra30_ahub.c | |||
| @@ -544,8 +544,8 @@ static int tegra30_ahub_probe(struct platform_device *pdev) | |||
| 544 | soc_data->mod_list_mask)) | 544 | soc_data->mod_list_mask)) |
| 545 | continue; | 545 | continue; |
| 546 | 546 | ||
| 547 | rst = reset_control_get(&pdev->dev, | 547 | rst = reset_control_get_exclusive(&pdev->dev, |
| 548 | configlink_mods[i].rst_name); | 548 | configlink_mods[i].rst_name); |
| 549 | if (IS_ERR(rst)) { | 549 | if (IS_ERR(rst)) { |
| 550 | dev_err(&pdev->dev, "Can't get reset %s\n", | 550 | dev_err(&pdev->dev, "Can't get reset %s\n", |
| 551 | configlink_mods[i].rst_name); | 551 | configlink_mods[i].rst_name); |
diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c index b2b279c96029..0b176ea24914 100644 --- a/sound/soc/tegra/tegra30_i2s.c +++ b/sound/soc/tegra/tegra30_i2s.c | |||
| @@ -275,7 +275,7 @@ static int tegra30_i2s_probe(struct snd_soc_dai *dai) | |||
| 275 | return 0; | 275 | return 0; |
| 276 | } | 276 | } |
| 277 | 277 | ||
| 278 | static struct snd_soc_dai_ops tegra30_i2s_dai_ops = { | 278 | static const struct snd_soc_dai_ops tegra30_i2s_dai_ops = { |
| 279 | .set_fmt = tegra30_i2s_set_fmt, | 279 | .set_fmt = tegra30_i2s_set_fmt, |
| 280 | .hw_params = tegra30_i2s_hw_params, | 280 | .hw_params = tegra30_i2s_hw_params, |
| 281 | .trigger = tegra30_i2s_trigger, | 281 | .trigger = tegra30_i2s_trigger, |
diff --git a/sound/soc/tegra/tegra_alc5632.c b/sound/soc/tegra/tegra_alc5632.c index 00383155d5f8..5197d6b18cb6 100644 --- a/sound/soc/tegra/tegra_alc5632.c +++ b/sound/soc/tegra/tegra_alc5632.c | |||
| @@ -160,7 +160,6 @@ static int tegra_alc5632_probe(struct platform_device *pdev) | |||
| 160 | return -ENOMEM; | 160 | return -ENOMEM; |
| 161 | 161 | ||
| 162 | card->dev = &pdev->dev; | 162 | card->dev = &pdev->dev; |
| 163 | platform_set_drvdata(pdev, card); | ||
| 164 | snd_soc_card_set_drvdata(card, alc5632); | 163 | snd_soc_card_set_drvdata(card, alc5632); |
| 165 | 164 | ||
| 166 | alc5632->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0); | 165 | alc5632->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0); |
diff --git a/sound/soc/tegra/tegra_max98090.c b/sound/soc/tegra/tegra_max98090.c index 955067adf2d9..cf142e2c7bd7 100644 --- a/sound/soc/tegra/tegra_max98090.c +++ b/sound/soc/tegra/tegra_max98090.c | |||
| @@ -211,7 +211,6 @@ static int tegra_max98090_probe(struct platform_device *pdev) | |||
| 211 | return -ENOMEM; | 211 | return -ENOMEM; |
| 212 | 212 | ||
| 213 | card->dev = &pdev->dev; | 213 | card->dev = &pdev->dev; |
| 214 | platform_set_drvdata(pdev, card); | ||
| 215 | snd_soc_card_set_drvdata(card, machine); | 214 | snd_soc_card_set_drvdata(card, machine); |
| 216 | 215 | ||
| 217 | machine->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0); | 216 | machine->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0); |
diff --git a/sound/soc/tegra/tegra_rt5640.c b/sound/soc/tegra/tegra_rt5640.c index 76ed6042d84d..fc81b48aa9d6 100644 --- a/sound/soc/tegra/tegra_rt5640.c +++ b/sound/soc/tegra/tegra_rt5640.c | |||
| @@ -161,7 +161,6 @@ static int tegra_rt5640_probe(struct platform_device *pdev) | |||
| 161 | return -ENOMEM; | 161 | return -ENOMEM; |
| 162 | 162 | ||
| 163 | card->dev = &pdev->dev; | 163 | card->dev = &pdev->dev; |
| 164 | platform_set_drvdata(pdev, card); | ||
| 165 | snd_soc_card_set_drvdata(card, machine); | 164 | snd_soc_card_set_drvdata(card, machine); |
| 166 | 165 | ||
| 167 | machine->gpio_hp_det = of_get_named_gpio_flags( | 166 | machine->gpio_hp_det = of_get_named_gpio_flags( |
diff --git a/sound/soc/tegra/tegra_rt5677.c b/sound/soc/tegra/tegra_rt5677.c index dc5a295d61e5..0e4805c7b4ca 100644 --- a/sound/soc/tegra/tegra_rt5677.c +++ b/sound/soc/tegra/tegra_rt5677.c | |||
| @@ -204,7 +204,6 @@ static int tegra_rt5677_probe(struct platform_device *pdev) | |||
| 204 | return -ENOMEM; | 204 | return -ENOMEM; |
| 205 | 205 | ||
| 206 | card->dev = &pdev->dev; | 206 | card->dev = &pdev->dev; |
| 207 | platform_set_drvdata(pdev, card); | ||
| 208 | snd_soc_card_set_drvdata(card, machine); | 207 | snd_soc_card_set_drvdata(card, machine); |
| 209 | 208 | ||
| 210 | machine->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0); | 209 | machine->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0); |
diff --git a/sound/soc/tegra/tegra_sgtl5000.c b/sound/soc/tegra/tegra_sgtl5000.c index 6dda01f69983..45a4aa9d2a47 100644 --- a/sound/soc/tegra/tegra_sgtl5000.c +++ b/sound/soc/tegra/tegra_sgtl5000.c | |||
| @@ -124,7 +124,6 @@ static int tegra_sgtl5000_driver_probe(struct platform_device *pdev) | |||
| 124 | return -ENOMEM; | 124 | return -ENOMEM; |
| 125 | 125 | ||
| 126 | card->dev = &pdev->dev; | 126 | card->dev = &pdev->dev; |
| 127 | platform_set_drvdata(pdev, card); | ||
| 128 | snd_soc_card_set_drvdata(card, machine); | 127 | snd_soc_card_set_drvdata(card, machine); |
| 129 | 128 | ||
| 130 | ret = snd_soc_of_parse_card_name(card, "nvidia,model"); | 129 | ret = snd_soc_of_parse_card_name(card, "nvidia,model"); |
diff --git a/sound/soc/tegra/tegra_wm8753.c b/sound/soc/tegra/tegra_wm8753.c index d0ab0026a4cd..23a810e3bacc 100644 --- a/sound/soc/tegra/tegra_wm8753.c +++ b/sound/soc/tegra/tegra_wm8753.c | |||
| @@ -132,7 +132,6 @@ static int tegra_wm8753_driver_probe(struct platform_device *pdev) | |||
| 132 | return -ENOMEM; | 132 | return -ENOMEM; |
| 133 | 133 | ||
| 134 | card->dev = &pdev->dev; | 134 | card->dev = &pdev->dev; |
| 135 | platform_set_drvdata(pdev, card); | ||
| 136 | snd_soc_card_set_drvdata(card, machine); | 135 | snd_soc_card_set_drvdata(card, machine); |
| 137 | 136 | ||
| 138 | ret = snd_soc_of_parse_card_name(card, "nvidia,model"); | 137 | ret = snd_soc_of_parse_card_name(card, "nvidia,model"); |
diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c index 05f95944669a..18bdae59a4df 100644 --- a/sound/soc/tegra/tegra_wm8903.c +++ b/sound/soc/tegra/tegra_wm8903.c | |||
| @@ -246,7 +246,6 @@ static int tegra_wm8903_driver_probe(struct platform_device *pdev) | |||
| 246 | return -ENOMEM; | 246 | return -ENOMEM; |
| 247 | 247 | ||
| 248 | card->dev = &pdev->dev; | 248 | card->dev = &pdev->dev; |
| 249 | platform_set_drvdata(pdev, card); | ||
| 250 | snd_soc_card_set_drvdata(card, machine); | 249 | snd_soc_card_set_drvdata(card, machine); |
| 251 | 250 | ||
| 252 | machine->gpio_spkr_en = of_get_named_gpio(np, "nvidia,spkr-en-gpios", | 251 | machine->gpio_spkr_en = of_get_named_gpio(np, "nvidia,spkr-en-gpios", |
diff --git a/sound/soc/tegra/tegra_wm9712.c b/sound/soc/tegra/tegra_wm9712.c index c9cd22432627..864a3345972e 100644 --- a/sound/soc/tegra/tegra_wm9712.c +++ b/sound/soc/tegra/tegra_wm9712.c | |||
| @@ -81,7 +81,6 @@ static int tegra_wm9712_driver_probe(struct platform_device *pdev) | |||
| 81 | return -ENOMEM; | 81 | return -ENOMEM; |
| 82 | 82 | ||
| 83 | card->dev = &pdev->dev; | 83 | card->dev = &pdev->dev; |
| 84 | platform_set_drvdata(pdev, card); | ||
| 85 | snd_soc_card_set_drvdata(card, machine); | 84 | snd_soc_card_set_drvdata(card, machine); |
| 86 | 85 | ||
| 87 | machine->codec = platform_device_alloc("wm9712-codec", -1); | 86 | machine->codec = platform_device_alloc("wm9712-codec", -1); |
diff --git a/sound/soc/tegra/trimslice.c b/sound/soc/tegra/trimslice.c index c9dcad9bb931..99bcdd979eb2 100644 --- a/sound/soc/tegra/trimslice.c +++ b/sound/soc/tegra/trimslice.c | |||
| @@ -127,7 +127,6 @@ static int tegra_snd_trimslice_probe(struct platform_device *pdev) | |||
| 127 | return -ENOMEM; | 127 | return -ENOMEM; |
| 128 | 128 | ||
| 129 | card->dev = &pdev->dev; | 129 | card->dev = &pdev->dev; |
| 130 | platform_set_drvdata(pdev, card); | ||
| 131 | snd_soc_card_set_drvdata(card, trimslice); | 130 | snd_soc_card_set_drvdata(card, trimslice); |
| 132 | 131 | ||
| 133 | trimslice_tlv320aic23_dai.codec_of_node = of_parse_phandle(np, | 132 | trimslice_tlv320aic23_dai.codec_of_node = of_parse_phandle(np, |
