Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge remote-tracking branches 'asoc/topic/rt5665', 'asoc/topic/rt5670', 'asoc/topic/rt5677' and 'asoc/topic/samsung' into asoc-next

+287 -177
-6
Documentation/devicetree/bindings/sound/samsung,odroid.txt
··· 7 7 - model - the user-visible name of this sound complex 8 8 - clocks - should contain entries matching clock names in the clock-names 9 9 property 10 - - clock-names - should contain following entries: 11 - - "epll" - indicating the EPLL output clock 12 - - "i2s_rclk" - indicating the RCLK (root) clock of the I2S0 controller 13 10 - samsung,audio-widgets - this property specifies off-codec audio elements 14 11 like headphones or speakers, for details see widgets.txt 15 12 - samsung,audio-routing - a list of the connections between audio ··· 42 45 "Headphone Jack", "HPR", 43 46 "IN1", "Mic Jack", 44 47 "Mic Jack", "MICBIAS"; 45 - 46 - clocks = <&clock CLK_FOUT_EPLL>, <&i2s0 CLK_I2S_RCLK_SRC>; 47 - clock-names = "epll", "sclk_i2s"; 48 48 49 49 cpu { 50 50 sound-dai = <&i2s0 0>;
-45
include/sound/rt5677.h
··· 1 - /* 2 - * linux/sound/rt5677.h -- Platform data for RT5677 3 - * 4 - * Copyright 2013 Realtek Semiconductor Corp. 5 - * Author: Oder Chiou <oder_chiou@realtek.com> 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License version 2 as 9 - * published by the Free Software Foundation. 10 - */ 11 - 12 - #ifndef __LINUX_SND_RT5677_H 13 - #define __LINUX_SND_RT5677_H 14 - 15 - enum rt5677_dmic2_clk { 16 - RT5677_DMIC_CLK1 = 0, 17 - RT5677_DMIC_CLK2 = 1, 18 - }; 19 - 20 - 21 - struct rt5677_platform_data { 22 - /* IN1/IN2/LOUT1/LOUT2/LOUT3 can optionally be differential */ 23 - bool in1_diff; 24 - bool in2_diff; 25 - bool lout1_diff; 26 - bool lout2_diff; 27 - bool lout3_diff; 28 - /* DMIC2 clock source selection */ 29 - enum rt5677_dmic2_clk dmic2_clk_pin; 30 - 31 - /* configures GPIO, 0 - floating, 1 - pulldown, 2 - pullup */ 32 - u8 gpio_config[6]; 33 - 34 - /* jd1 can select 0 ~ 3 as OFF, GPIO1, GPIO2 and GPIO3 respectively */ 35 - unsigned int jd1_gpio; 36 - /* jd2 and jd3 can select 0 ~ 3 as 37 - OFF, GPIO4, GPIO5 and GPIO6 respectively */ 38 - unsigned int jd2_gpio; 39 - unsigned int jd3_gpio; 40 - 41 - /* Set MICBIAS1 VDD 1v8 or 3v3 */ 42 - bool micbias1_vdd_3v3; 43 - }; 44 - 45 - #endif
+48 -5
sound/soc/codecs/rt5665.c
··· 1381 1381 mutex_unlock(&rt5665->calibrate_mutex); 1382 1382 } 1383 1383 1384 + static const char * const rt5665_clk_sync[] = { 1385 + "I2S1_1", "I2S1_2", "I2S2", "I2S3", "IF2 Slave", "IF3 Slave" 1386 + }; 1387 + 1388 + static const struct soc_enum rt5665_enum[] = { 1389 + SOC_ENUM_SINGLE(RT5665_I2S1_SDP, 11, 5, rt5665_clk_sync), 1390 + SOC_ENUM_SINGLE(RT5665_I2S2_SDP, 11, 5, rt5665_clk_sync), 1391 + SOC_ENUM_SINGLE(RT5665_I2S3_SDP, 11, 5, rt5665_clk_sync), 1392 + }; 1393 + 1384 1394 static const struct snd_kcontrol_new rt5665_snd_controls[] = { 1385 1395 /* Headphone Output Volume */ 1386 1396 SOC_DOUBLE_R_EXT_TLV("Headphone Playback Volume", RT5665_HPL_GAIN, ··· 1401 1391 SOC_SINGLE_EXT_TLV("Mono Playback Volume", RT5665_MONO_GAIN, 1402 1392 RT5665_L_VOL_SFT, 15, 1, snd_soc_get_volsw, 1403 1393 rt5665_mono_vol_put, mono_vol_tlv), 1394 + 1395 + SOC_SINGLE_TLV("MONOVOL Playback Volume", RT5665_MONO_OUT, 1396 + RT5665_L_VOL_SFT, 39, 1, out_vol_tlv), 1404 1397 1405 1398 /* Output Volume */ 1406 1399 SOC_DOUBLE_TLV("OUT Playback Volume", RT5665_LOUT, RT5665_L_VOL_SFT, ··· 1459 1446 SOC_DOUBLE_TLV("STO2 ADC Boost Gain Volume", RT5665_STO2_ADC_BOOST, 1460 1447 RT5665_STO2_ADC_L_BST_SFT, RT5665_STO2_ADC_R_BST_SFT, 1461 1448 3, 0, adc_bst_tlv), 1449 + 1450 + /* I2S3 CLK Source */ 1451 + SOC_ENUM("I2S1 Master Clk Sel", rt5665_enum[0]), 1452 + SOC_ENUM("I2S2 Master Clk Sel", rt5665_enum[1]), 1453 + SOC_ENUM("I2S3 Master Clk Sel", rt5665_enum[2]), 1462 1454 }; 1463 1455 1464 1456 /** ··· 4116 4098 rt5665->lrck[dai->id] = params_rate(params); 4117 4099 pre_div = rl6231_get_clk_info(rt5665->sysclk, rt5665->lrck[dai->id]); 4118 4100 if (pre_div < 0) { 4119 - dev_err(codec->dev, "Unsupported clock setting %d for DAI %d\n", 4120 - rt5665->lrck[dai->id], dai->id); 4121 - return -EINVAL; 4101 + dev_warn(codec->dev, "Force using PLL"); 4102 + snd_soc_codec_set_pll(codec, 0, RT5665_PLL1_S_MCLK, 4103 + rt5665->sysclk, rt5665->lrck[dai->id] * 512); 4104 + snd_soc_codec_set_sysclk(codec, RT5665_SCLK_S_PLL1, 0, 4105 + rt5665->lrck[dai->id] * 512, 0); 4106 + pre_div = 1; 4122 4107 } 4123 4108 frame_size = snd_soc_params_to_frame_size(params); 4124 4109 if (frame_size < 0) { ··· 4204 4183 break; 4205 4184 } 4206 4185 4186 + if (rt5665->master[RT5665_AIF2_1] || rt5665->master[RT5665_AIF2_2]) { 4187 + snd_soc_update_bits(codec, RT5665_I2S_M_CLK_CTRL_1, 4188 + RT5665_I2S2_M_PD_MASK, pre_div << RT5665_I2S2_M_PD_SFT); 4189 + } 4190 + if (rt5665->master[RT5665_AIF3]) { 4191 + snd_soc_update_bits(codec, RT5665_I2S_M_CLK_CTRL_1, 4192 + RT5665_I2S3_M_PD_MASK, pre_div << RT5665_I2S3_M_PD_SFT); 4193 + } 4194 + 4207 4195 return 0; 4208 4196 } 4209 4197 ··· 4289 4259 int source, unsigned int freq, int dir) 4290 4260 { 4291 4261 struct rt5665_priv *rt5665 = snd_soc_codec_get_drvdata(codec); 4292 - unsigned int reg_val = 0; 4262 + unsigned int reg_val = 0, src = 0; 4293 4263 4294 4264 if (freq == rt5665->sysclk && clk_id == rt5665->sysclk_src) 4295 4265 return 0; ··· 4297 4267 switch (clk_id) { 4298 4268 case RT5665_SCLK_S_MCLK: 4299 4269 reg_val |= RT5665_SCLK_SRC_MCLK; 4270 + src = RT5665_CLK_SRC_MCLK; 4300 4271 break; 4301 4272 case RT5665_SCLK_S_PLL1: 4302 4273 reg_val |= RT5665_SCLK_SRC_PLL1; 4274 + src = RT5665_CLK_SRC_PLL1; 4303 4275 break; 4304 4276 case RT5665_SCLK_S_RCCLK: 4305 4277 reg_val |= RT5665_SCLK_SRC_RCCLK; 4278 + src = RT5665_CLK_SRC_RCCLK; 4306 4279 break; 4307 4280 default: 4308 4281 dev_err(codec->dev, "Invalid clock id (%d)\n", clk_id); ··· 4313 4280 } 4314 4281 snd_soc_update_bits(codec, RT5665_GLB_CLK, 4315 4282 RT5665_SCLK_SRC_MASK, reg_val); 4283 + 4284 + if (rt5665->master[RT5665_AIF2_1] || rt5665->master[RT5665_AIF2_2]) { 4285 + snd_soc_update_bits(codec, RT5665_I2S_M_CLK_CTRL_1, 4286 + RT5665_I2S2_SRC_MASK, src << RT5665_I2S2_SRC_SFT); 4287 + } 4288 + if (rt5665->master[RT5665_AIF3]) { 4289 + snd_soc_update_bits(codec, RT5665_I2S_M_CLK_CTRL_1, 4290 + RT5665_I2S3_SRC_MASK, src << RT5665_I2S3_SRC_SFT); 4291 + } 4292 + 4316 4293 rt5665->sysclk = freq; 4317 4294 rt5665->sysclk_src = clk_id; 4318 4295 ··· 4970 4927 #endif 4971 4928 4972 4929 #ifdef CONFIG_ACPI 4973 - static struct acpi_device_id rt5665_acpi_match[] = { 4930 + static const struct acpi_device_id rt5665_acpi_match[] = { 4974 4931 {"10EC5665", 0,}, 4975 4932 {"10EC5666", 0,}, 4976 4933 {"10EC5668", 0,},
+21
sound/soc/codecs/rt5665.h
··· 1628 1628 #define RT5665_PWR_CLK1M_PD (0x0 << 8) 1629 1629 #define RT5665_PWR_CLK1M_PU (0x1 << 8) 1630 1630 1631 + /* I2S Master Mode Clock Control 1 (0x00a0) */ 1632 + #define RT5665_CLK_SRC_MCLK (0x0) 1633 + #define RT5665_CLK_SRC_PLL1 (0x1) 1634 + #define RT5665_CLK_SRC_RCCLK (0x2) 1635 + #define RT5665_I2S_PD_1 (0x0) 1636 + #define RT5665_I2S_PD_2 (0x1) 1637 + #define RT5665_I2S_PD_3 (0x2) 1638 + #define RT5665_I2S_PD_4 (0x3) 1639 + #define RT5665_I2S_PD_6 (0x4) 1640 + #define RT5665_I2S_PD_8 (0x5) 1641 + #define RT5665_I2S_PD_12 (0x6) 1642 + #define RT5665_I2S_PD_16 (0x7) 1643 + #define RT5665_I2S2_SRC_MASK (0x3 << 12) 1644 + #define RT5665_I2S2_SRC_SFT 12 1645 + #define RT5665_I2S2_M_PD_MASK (0x7 << 8) 1646 + #define RT5665_I2S2_M_PD_SFT 8 1647 + #define RT5665_I2S3_SRC_MASK (0x3 << 4) 1648 + #define RT5665_I2S3_SRC_SFT 4 1649 + #define RT5665_I2S3_M_PD_MASK (0x7 << 0) 1650 + #define RT5665_I2S3_M_PD_SFT 0 1651 + 1631 1652 1632 1653 /* EQ Control 1 (0x00b0) */ 1633 1654 #define RT5665_EQ_SRC_DAC (0x0 << 15)
+34 -26
sound/soc/codecs/rt5670.c
··· 1151 1151 static SOC_ENUM_SINGLE_DECL(rt5670_stereo1_adc1_enum, RT5670_STO1_ADC_MIXER, 1152 1152 RT5670_ADC_1_SRC_SFT, rt5670_stereo_adc1_src); 1153 1153 1154 - static const struct snd_kcontrol_new rt5670_sto_adc_l1_mux = 1155 - SOC_DAPM_ENUM("Stereo1 ADC L1 source", rt5670_stereo1_adc1_enum); 1156 - 1157 - static const struct snd_kcontrol_new rt5670_sto_adc_r1_mux = 1158 - SOC_DAPM_ENUM("Stereo1 ADC R1 source", rt5670_stereo1_adc1_enum); 1154 + static const struct snd_kcontrol_new rt5670_sto_adc_1_mux = 1155 + SOC_DAPM_ENUM("Stereo1 ADC 1 Mux", rt5670_stereo1_adc1_enum); 1159 1156 1160 1157 static SOC_ENUM_SINGLE_DECL(rt5670_stereo2_adc1_enum, RT5670_STO2_ADC_MIXER, 1161 1158 RT5670_ADC_1_SRC_SFT, rt5670_stereo_adc1_src); 1162 1159 1163 - static const struct snd_kcontrol_new rt5670_sto2_adc_l1_mux = 1164 - SOC_DAPM_ENUM("Stereo2 ADC L1 source", rt5670_stereo2_adc1_enum); 1160 + static const struct snd_kcontrol_new rt5670_sto2_adc_1_mux = 1161 + SOC_DAPM_ENUM("Stereo2 ADC 1 Mux", rt5670_stereo2_adc1_enum); 1165 1162 1166 - static const struct snd_kcontrol_new rt5670_sto2_adc_r1_mux = 1167 - SOC_DAPM_ENUM("Stereo2 ADC R1 source", rt5670_stereo2_adc1_enum); 1168 1163 1169 1164 /* MX-27 MX-26 [11] */ 1170 1165 static const char * const rt5670_stereo_adc2_src[] = { ··· 1169 1174 static SOC_ENUM_SINGLE_DECL(rt5670_stereo1_adc2_enum, RT5670_STO1_ADC_MIXER, 1170 1175 RT5670_ADC_2_SRC_SFT, rt5670_stereo_adc2_src); 1171 1176 1172 - static const struct snd_kcontrol_new rt5670_sto_adc_l2_mux = 1173 - SOC_DAPM_ENUM("Stereo1 ADC L2 source", rt5670_stereo1_adc2_enum); 1174 - 1175 - static const struct snd_kcontrol_new rt5670_sto_adc_r2_mux = 1176 - SOC_DAPM_ENUM("Stereo1 ADC R2 source", rt5670_stereo1_adc2_enum); 1177 + static const struct snd_kcontrol_new rt5670_sto_adc_2_mux = 1178 + SOC_DAPM_ENUM("Stereo1 ADC 2 Mux", rt5670_stereo1_adc2_enum); 1177 1179 1178 1180 static SOC_ENUM_SINGLE_DECL(rt5670_stereo2_adc2_enum, RT5670_STO2_ADC_MIXER, 1179 1181 RT5670_ADC_2_SRC_SFT, rt5670_stereo_adc2_src); 1180 1182 1181 - static const struct snd_kcontrol_new rt5670_sto2_adc_l2_mux = 1182 - SOC_DAPM_ENUM("Stereo2 ADC L2 source", rt5670_stereo2_adc2_enum); 1183 + static const struct snd_kcontrol_new rt5670_sto2_adc_2_mux = 1184 + SOC_DAPM_ENUM("Stereo2 ADC 2 Mux", rt5670_stereo2_adc2_enum); 1183 1185 1184 - static const struct snd_kcontrol_new rt5670_sto2_adc_r2_mux = 1185 - SOC_DAPM_ENUM("Stereo2 ADC R2 source", rt5670_stereo2_adc2_enum); 1186 1186 1187 1187 /* MX-27 MX26 [10] */ 1188 1188 static const char * const rt5670_stereo_adc_src[] = { ··· 1632 1642 SND_SOC_DAPM_MUX("Stereo1 DMIC Mux", SND_SOC_NOPM, 0, 0, 1633 1643 &rt5670_sto1_dmic_mux), 1634 1644 SND_SOC_DAPM_MUX("Stereo1 ADC L2 Mux", SND_SOC_NOPM, 0, 0, 1635 - &rt5670_sto_adc_l2_mux), 1645 + &rt5670_sto_adc_2_mux), 1636 1646 SND_SOC_DAPM_MUX("Stereo1 ADC R2 Mux", SND_SOC_NOPM, 0, 0, 1637 - &rt5670_sto_adc_r2_mux), 1647 + &rt5670_sto_adc_2_mux), 1638 1648 SND_SOC_DAPM_MUX("Stereo1 ADC L1 Mux", SND_SOC_NOPM, 0, 0, 1639 - &rt5670_sto_adc_l1_mux), 1649 + &rt5670_sto_adc_1_mux), 1640 1650 SND_SOC_DAPM_MUX("Stereo1 ADC R1 Mux", SND_SOC_NOPM, 0, 0, 1641 - &rt5670_sto_adc_r1_mux), 1651 + &rt5670_sto_adc_1_mux), 1642 1652 SND_SOC_DAPM_MUX("Stereo2 DMIC Mux", SND_SOC_NOPM, 0, 0, 1643 1653 &rt5670_sto2_dmic_mux), 1644 1654 SND_SOC_DAPM_MUX("Stereo2 ADC L2 Mux", SND_SOC_NOPM, 0, 0, 1645 - &rt5670_sto2_adc_l2_mux), 1655 + &rt5670_sto2_adc_2_mux), 1646 1656 SND_SOC_DAPM_MUX("Stereo2 ADC R2 Mux", SND_SOC_NOPM, 0, 0, 1647 - &rt5670_sto2_adc_r2_mux), 1657 + &rt5670_sto2_adc_2_mux), 1648 1658 SND_SOC_DAPM_MUX("Stereo2 ADC L1 Mux", SND_SOC_NOPM, 0, 0, 1649 - &rt5670_sto2_adc_l1_mux), 1659 + &rt5670_sto2_adc_1_mux), 1650 1660 SND_SOC_DAPM_MUX("Stereo2 ADC R1 Mux", SND_SOC_NOPM, 0, 0, 1651 - &rt5670_sto2_adc_r1_mux), 1661 + &rt5670_sto2_adc_1_mux), 1652 1662 SND_SOC_DAPM_MUX("Stereo2 ADC LR Mux", SND_SOC_NOPM, 0, 0, 1653 1663 &rt5670_sto2_adc_lr_mux), 1654 1664 SND_SOC_DAPM_MUX("Mono DMIC L Mux", SND_SOC_NOPM, 0, 0, ··· 2733 2743 .formats = RT5670_FORMATS, 2734 2744 }, 2735 2745 .ops = &rt5670_aif_dai_ops, 2746 + .symmetric_rates = 1, 2736 2747 }, 2737 2748 { 2738 2749 .name = "rt5670-aif2", ··· 2753 2762 .formats = RT5670_FORMATS, 2754 2763 }, 2755 2764 .ops = &rt5670_aif_dai_ops, 2765 + .symmetric_rates = 1, 2756 2766 }, 2757 2767 }; 2758 2768 ··· 2851 2859 {} 2852 2860 }; 2853 2861 2862 + static const struct dmi_system_id dmi_platform_intel_bytcht_jdmode3[] = { 2863 + { 2864 + .ident = "Dell Venue 8 Pro 5855", 2865 + .matches = { 2866 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 2867 + DMI_MATCH(DMI_PRODUCT_NAME, "Venue 8 Pro 5855"), 2868 + }, 2869 + }, 2870 + {} 2871 + }; 2872 + 2854 2873 static int rt5670_i2c_probe(struct i2c_client *i2c, 2855 2874 const struct i2c_device_id *id) 2856 2875 { ··· 2891 2888 rt5670->pdata.dmic1_data_pin = RT5670_DMIC_DATA_IN2P; 2892 2889 rt5670->pdata.dev_gpio = true; 2893 2890 rt5670->pdata.jd_mode = 2; 2891 + } else if (dmi_check_system(dmi_platform_intel_bytcht_jdmode3)) { 2892 + rt5670->pdata.dmic_en = true; 2893 + rt5670->pdata.dmic1_data_pin = RT5670_DMIC_DATA_IN2P; 2894 + rt5670->pdata.dev_gpio = true; 2895 + rt5670->pdata.jd_mode = 3; 2894 2896 } 2895 2897 2896 2898 rt5670->regmap = devm_regmap_init_i2c(i2c, &rt5670_regmap);
+38 -42
sound/soc/codecs/rt5677.c
··· 21 21 #include <linux/platform_device.h> 22 22 #include <linux/spi/spi.h> 23 23 #include <linux/firmware.h> 24 + #include <linux/of_device.h> 24 25 #include <linux/property.h> 25 26 #include <sound/core.h> 26 27 #include <sound/pcm.h> ··· 780 779 return 0; 781 780 } 782 781 783 - static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -4650, 150, 0); 784 782 static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -6525, 75, 0); 785 - static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0); 786 783 static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -1725, 75, 0); 787 784 static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0); 788 785 static const DECLARE_TLV_DB_SCALE(st_vol_tlv, -4650, 150, 0); ··· 4623 4624 struct regmap_irq_chip_data *data = rt5677->irq_data; 4624 4625 int irq; 4625 4626 4626 - if (offset >= RT5677_GPIO1 && offset <= RT5677_GPIO3) { 4627 - if ((rt5677->pdata.jd1_gpio == 1 && offset == RT5677_GPIO1) || 4628 - (rt5677->pdata.jd1_gpio == 2 && 4629 - offset == RT5677_GPIO2) || 4630 - (rt5677->pdata.jd1_gpio == 3 && 4631 - offset == RT5677_GPIO3)) { 4632 - irq = RT5677_IRQ_JD1; 4633 - } else { 4634 - return -ENXIO; 4635 - } 4636 - } 4637 - 4638 - if (offset >= RT5677_GPIO4 && offset <= RT5677_GPIO6) { 4639 - if ((rt5677->pdata.jd2_gpio == 1 && offset == RT5677_GPIO4) || 4640 - (rt5677->pdata.jd2_gpio == 2 && 4641 - offset == RT5677_GPIO5) || 4642 - (rt5677->pdata.jd2_gpio == 3 && 4643 - offset == RT5677_GPIO6)) { 4644 - irq = RT5677_IRQ_JD2; 4645 - } else if ((rt5677->pdata.jd3_gpio == 1 && 4646 - offset == RT5677_GPIO4) || 4647 - (rt5677->pdata.jd3_gpio == 2 && 4648 - offset == RT5677_GPIO5) || 4649 - (rt5677->pdata.jd3_gpio == 3 && 4650 - offset == RT5677_GPIO6)) { 4651 - irq = RT5677_IRQ_JD3; 4652 - } else { 4653 - return -ENXIO; 4654 - } 4627 + if ((rt5677->pdata.jd1_gpio == 1 && offset == RT5677_GPIO1) || 4628 + (rt5677->pdata.jd1_gpio == 2 && 4629 + offset == RT5677_GPIO2) || 4630 + (rt5677->pdata.jd1_gpio == 3 && 4631 + offset == RT5677_GPIO3)) { 4632 + irq = RT5677_IRQ_JD1; 4633 + } else if ((rt5677->pdata.jd2_gpio == 1 && offset == RT5677_GPIO4) || 4634 + (rt5677->pdata.jd2_gpio == 2 && 4635 + offset == RT5677_GPIO5) || 4636 + (rt5677->pdata.jd2_gpio == 3 && 4637 + offset == RT5677_GPIO6)) { 4638 + irq = RT5677_IRQ_JD2; 4639 + } else if ((rt5677->pdata.jd3_gpio == 1 && 4640 + offset == RT5677_GPIO4) || 4641 + (rt5677->pdata.jd3_gpio == 2 && 4642 + offset == RT5677_GPIO5) || 4643 + (rt5677->pdata.jd3_gpio == 3 && 4644 + offset == RT5677_GPIO6)) { 4645 + irq = RT5677_IRQ_JD3; 4646 + } else { 4647 + return -ENXIO; 4655 4648 } 4656 4649 4657 4650 return regmap_irq_get_virq(data, irq); ··· 5012 5021 static const struct i2c_device_id rt5677_i2c_id[] = { 5013 5022 { "rt5677", RT5677 }, 5014 5023 { "rt5676", RT5676 }, 5015 - { "RT5677CE:00", RT5677 }, 5016 5024 { } 5017 5025 }; 5018 5026 MODULE_DEVICE_TABLE(i2c, rt5677_i2c_id); 5019 5027 5020 5028 static const struct of_device_id rt5677_of_match[] = { 5021 - { .compatible = "realtek,rt5677", }, 5029 + { .compatible = "realtek,rt5677", RT5677 }, 5022 5030 { } 5023 5031 }; 5024 5032 MODULE_DEVICE_TABLE(of, rt5677_of_match); 5025 5033 5026 - #ifdef CONFIG_ACPI 5027 5034 static const struct acpi_device_id rt5677_acpi_match[] = { 5028 5035 { "RT5677CE", RT5677 }, 5029 5036 { } 5030 5037 }; 5031 5038 MODULE_DEVICE_TABLE(acpi, rt5677_acpi_match); 5032 - #endif 5033 5039 5034 5040 static void rt5677_read_acpi_properties(struct rt5677_priv *rt5677, 5035 5041 struct device *dev) ··· 5136 5148 static int rt5677_i2c_probe(struct i2c_client *i2c, 5137 5149 const struct i2c_device_id *id) 5138 5150 { 5139 - struct rt5677_platform_data *pdata = dev_get_platdata(&i2c->dev); 5140 5151 struct rt5677_priv *rt5677; 5141 5152 int ret; 5142 5153 unsigned int val; ··· 5147 5160 5148 5161 i2c_set_clientdata(i2c, rt5677); 5149 5162 5150 - rt5677->type = id->driver_data; 5163 + if (i2c->dev.of_node) { 5164 + const struct of_device_id *match_id; 5151 5165 5152 - if (pdata) 5153 - rt5677->pdata = *pdata; 5154 - else if (i2c->dev.of_node) 5166 + match_id = of_match_device(rt5677_of_match, &i2c->dev); 5167 + if (match_id) 5168 + rt5677->type = (enum rt5677_type)match_id->data; 5169 + 5155 5170 rt5677_read_device_properties(rt5677, &i2c->dev); 5156 - else if (ACPI_HANDLE(&i2c->dev)) 5171 + } else if (ACPI_HANDLE(&i2c->dev)) { 5172 + const struct acpi_device_id *acpi_id; 5173 + 5174 + acpi_id = acpi_match_device(rt5677_acpi_match, &i2c->dev); 5175 + if (acpi_id) 5176 + rt5677->type = (enum rt5677_type)acpi_id->driver_data; 5177 + 5157 5178 rt5677_read_acpi_properties(rt5677, &i2c->dev); 5158 - else 5179 + } else { 5159 5180 return -EINVAL; 5181 + } 5160 5182 5161 5183 /* pow-ldo2 and reset are optional. The codec pins may be statically 5162 5184 * connected on the board without gpios. If the gpio device property
+29 -1
sound/soc/codecs/rt5677.h
··· 12 12 #ifndef __RT5677_H__ 13 13 #define __RT5677_H__ 14 14 15 - #include <sound/rt5677.h> 16 15 #include <linux/gpio/driver.h> 17 16 #include <linux/gpio/consumer.h> 18 17 ··· 1758 1759 RT5677_I2S2_SOURCE = (0x1 << 16), 1759 1760 RT5677_I2S3_SOURCE = (0x1 << 17), 1760 1761 RT5677_I2S4_SOURCE = (0x1 << 18), 1762 + }; 1763 + 1764 + enum rt5677_dmic2_clk { 1765 + RT5677_DMIC_CLK1 = 0, 1766 + RT5677_DMIC_CLK2 = 1, 1767 + }; 1768 + 1769 + struct rt5677_platform_data { 1770 + /* IN1/IN2/LOUT1/LOUT2/LOUT3 can optionally be differential */ 1771 + bool in1_diff; 1772 + bool in2_diff; 1773 + bool lout1_diff; 1774 + bool lout2_diff; 1775 + bool lout3_diff; 1776 + /* DMIC2 clock source selection */ 1777 + enum rt5677_dmic2_clk dmic2_clk_pin; 1778 + 1779 + /* configures GPIO, 0 - floating, 1 - pulldown, 2 - pullup */ 1780 + u8 gpio_config[6]; 1781 + 1782 + /* jd1 can select 0 ~ 3 as OFF, GPIO1, GPIO2 and GPIO3 respectively */ 1783 + unsigned int jd1_gpio; 1784 + /* jd2 and jd3 can select 0 ~ 3 as 1785 + OFF, GPIO4, GPIO5 and GPIO6 respectively */ 1786 + unsigned int jd2_gpio; 1787 + unsigned int jd3_gpio; 1788 + 1789 + /* Set MICBIAS1 VDD 1v8 or 3v3 */ 1790 + bool micbias1_vdd_3v3; 1761 1791 }; 1762 1792 1763 1793 struct rt5677_priv {
+29 -16
sound/soc/samsung/i2s.c
··· 50 50 51 51 struct samsung_i2s_dai_data { 52 52 u32 quirks; 53 + unsigned int pcm_rates; 53 54 const struct samsung_i2s_variant_regs *i2s_variant_regs; 54 55 }; 55 56 ··· 551 550 goto err; 552 551 } 553 552 554 - clk_prepare_enable(i2s->op_clk); 553 + ret = clk_prepare_enable(i2s->op_clk); 554 + if (ret) 555 + goto err; 555 556 i2s->rclk_srcrate = clk_get_rate(i2s->op_clk); 556 557 557 558 /* Over-ride the other's */ ··· 1079 1076 .name = "samsung-i2s", 1080 1077 }; 1081 1078 1082 - #define SAMSUNG_I2S_RATES SNDRV_PCM_RATE_8000_96000 1083 - 1084 1079 #define SAMSUNG_I2S_FMTS (SNDRV_PCM_FMTBIT_S8 | \ 1085 1080 SNDRV_PCM_FMTBIT_S16_LE | \ 1086 1081 SNDRV_PCM_FMTBIT_S24_LE) 1087 1082 1088 - static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec) 1083 + static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, 1084 + const struct samsung_i2s_dai_data *i2s_dai_data, 1085 + bool sec) 1089 1086 { 1090 1087 struct i2s_dai *i2s; 1091 1088 ··· 1104 1101 i2s->i2s_dai_drv.resume = i2s_resume; 1105 1102 i2s->i2s_dai_drv.playback.channels_min = 1; 1106 1103 i2s->i2s_dai_drv.playback.channels_max = 2; 1107 - i2s->i2s_dai_drv.playback.rates = SAMSUNG_I2S_RATES; 1104 + i2s->i2s_dai_drv.playback.rates = i2s_dai_data->pcm_rates; 1108 1105 i2s->i2s_dai_drv.playback.formats = SAMSUNG_I2S_FMTS; 1109 1106 1110 1107 if (!sec) { 1111 1108 i2s->i2s_dai_drv.capture.channels_min = 1; 1112 1109 i2s->i2s_dai_drv.capture.channels_max = 2; 1113 - i2s->i2s_dai_drv.capture.rates = SAMSUNG_I2S_RATES; 1110 + i2s->i2s_dai_drv.capture.rates = i2s_dai_data->pcm_rates; 1114 1111 i2s->i2s_dai_drv.capture.formats = SAMSUNG_I2S_FMTS; 1115 1112 } 1116 1113 return i2s; ··· 1135 1132 static int i2s_runtime_resume(struct device *dev) 1136 1133 { 1137 1134 struct i2s_dai *i2s = dev_get_drvdata(dev); 1135 + int ret; 1138 1136 1139 - clk_prepare_enable(i2s->clk); 1140 - if (i2s->op_clk) 1141 - clk_prepare_enable(i2s->op_clk); 1137 + ret = clk_prepare_enable(i2s->clk); 1138 + if (ret) 1139 + return ret; 1140 + 1141 + if (i2s->op_clk) { 1142 + ret = clk_prepare_enable(i2s->op_clk); 1143 + if (ret) { 1144 + clk_disable_unprepare(i2s->clk); 1145 + return ret; 1146 + } 1147 + } 1142 1148 1143 1149 writel(i2s->suspend_i2scon, i2s->addr + I2SCON); 1144 1150 writel(i2s->suspend_i2smod, i2s->addr + I2SMOD); ··· 1254 1242 i2s_dai_data = (struct samsung_i2s_dai_data *) 1255 1243 platform_get_device_id(pdev)->driver_data; 1256 1244 1257 - pri_dai = i2s_alloc_dai(pdev, false); 1245 + pri_dai = i2s_alloc_dai(pdev, i2s_dai_data, false); 1258 1246 if (!pri_dai) { 1259 1247 dev_err(&pdev->dev, "Unable to alloc I2S_pri\n"); 1260 1248 return -ENOMEM; ··· 1328 1316 goto err_disable_clk; 1329 1317 1330 1318 if (quirks & QUIRK_SEC_DAI) { 1331 - sec_dai = i2s_alloc_dai(pdev, true); 1319 + sec_dai = i2s_alloc_dai(pdev, i2s_dai_data, true); 1332 1320 if (!sec_dai) { 1333 1321 dev_err(&pdev->dev, "Unable to alloc I2S_sec\n"); 1334 1322 ret = -ENOMEM; ··· 1388 1376 1389 1377 static int samsung_i2s_remove(struct platform_device *pdev) 1390 1378 { 1391 - struct i2s_dai *pri_dai, *sec_dai; 1379 + struct i2s_dai *pri_dai; 1392 1380 1393 1381 pri_dai = dev_get_drvdata(&pdev->dev); 1394 - sec_dai = pri_dai->sec_dai; 1395 - 1396 - pri_dai->sec_dai = NULL; 1397 - sec_dai->pri_dai = NULL; 1398 1382 1399 1383 pm_runtime_get_sync(&pdev->dev); 1400 1384 pm_runtime_disable(&pdev->dev); ··· 1460 1452 1461 1453 static const struct samsung_i2s_dai_data i2sv3_dai_type = { 1462 1454 .quirks = QUIRK_NO_MUXPSR, 1455 + .pcm_rates = SNDRV_PCM_RATE_8000_96000, 1463 1456 .i2s_variant_regs = &i2sv3_regs, 1464 1457 }; 1465 1458 1466 1459 static const struct samsung_i2s_dai_data i2sv5_dai_type = { 1467 1460 .quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI | QUIRK_NEED_RSTCLR | 1468 1461 QUIRK_SUPPORTS_IDMA, 1462 + .pcm_rates = SNDRV_PCM_RATE_8000_96000, 1469 1463 .i2s_variant_regs = &i2sv3_regs, 1470 1464 }; 1471 1465 1472 1466 static const struct samsung_i2s_dai_data i2sv6_dai_type = { 1473 1467 .quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI | QUIRK_NEED_RSTCLR | 1474 1468 QUIRK_SUPPORTS_TDM | QUIRK_SUPPORTS_IDMA, 1469 + .pcm_rates = SNDRV_PCM_RATE_8000_96000, 1475 1470 .i2s_variant_regs = &i2sv6_regs, 1476 1471 }; 1477 1472 1478 1473 static const struct samsung_i2s_dai_data i2sv7_dai_type = { 1479 1474 .quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI | QUIRK_NEED_RSTCLR | 1480 1475 QUIRK_SUPPORTS_TDM, 1476 + .pcm_rates = SNDRV_PCM_RATE_8000_192000, 1481 1477 .i2s_variant_regs = &i2sv7_regs, 1482 1478 }; 1483 1479 1484 1480 static const struct samsung_i2s_dai_data i2sv5_dai_type_i2s1 = { 1485 1481 .quirks = QUIRK_PRI_6CHAN | QUIRK_NEED_RSTCLR, 1482 + .pcm_rates = SNDRV_PCM_RATE_8000_96000, 1486 1483 .i2s_variant_regs = &i2sv5_i2s1_regs, 1487 1484 }; 1488 1485
+2 -2
sound/soc/samsung/idma.c
··· 325 325 return 0; 326 326 } 327 327 328 - static struct snd_pcm_ops idma_ops = { 328 + static const struct snd_pcm_ops idma_ops = { 329 329 .open = idma_open, 330 330 .close = idma_close, 331 331 .ioctl = snd_pcm_lib_ioctl, ··· 399 399 } 400 400 EXPORT_SYMBOL_GPL(idma_reg_addr_init); 401 401 402 - static struct snd_soc_platform_driver asoc_idma_platform = { 402 + static const struct snd_soc_platform_driver asoc_idma_platform = { 403 403 .ops = &idma_ops, 404 404 .pcm_new = idma_new, 405 405 .pcm_free = idma_free,
+1 -1
sound/soc/samsung/jive_wm8750.c
··· 79 79 return 0; 80 80 } 81 81 82 - static struct snd_soc_ops jive_ops = { 82 + static const struct snd_soc_ops jive_ops = { 83 83 .hw_params = jive_hw_params, 84 84 }; 85 85
+30 -14
sound/soc/samsung/odroid.c
··· 19 19 struct snd_soc_card card; 20 20 struct snd_soc_dai_link dai_link; 21 21 22 - struct clk *pll; 23 - struct clk *rclk; 22 + struct clk *clk_i2s_bus; 23 + struct clk *sclk_i2s; 24 24 }; 25 25 26 26 static int odroid_card_startup(struct snd_pcm_substream *substream) ··· 58 58 return -EINVAL; 59 59 } 60 60 61 - ret = clk_set_rate(priv->pll, pll_freq + 1); 61 + ret = clk_set_rate(priv->clk_i2s_bus, pll_freq / 2 + 1); 62 62 if (ret < 0) 63 63 return ret; 64 64 65 - rclk_freq = params_rate(params) * 256 * 4; 65 + /* 66 + * We add 1 to the rclk_freq value in order to avoid too low clock 67 + * frequency values due to the EPLL output frequency not being exact 68 + * multiple of the audio sampling rate. 69 + */ 70 + rclk_freq = params_rate(params) * 256 + 1; 66 71 67 - ret = clk_set_rate(priv->rclk, rclk_freq); 72 + ret = clk_set_rate(priv->sclk_i2s, rclk_freq); 68 73 if (ret < 0) 69 74 return ret; 70 75 ··· 123 118 124 119 snd_soc_card_set_drvdata(card, priv); 125 120 126 - priv->pll = devm_clk_get(dev, "epll"); 127 - if (IS_ERR(priv->pll)) 128 - return PTR_ERR(priv->pll); 129 - 130 - priv->rclk = devm_clk_get(dev, "i2s_rclk"); 131 - if (IS_ERR(priv->rclk)) 132 - return PTR_ERR(priv->rclk); 133 - 134 121 ret = snd_soc_of_parse_card_name(card, "model"); 135 122 if (ret < 0) 136 123 return ret; ··· 168 171 link->name = "Primary"; 169 172 link->stream_name = link->name; 170 173 174 + 175 + priv->sclk_i2s = of_clk_get_by_name(link->cpu_of_node, "i2s_opclk1"); 176 + if (IS_ERR(priv->sclk_i2s)) { 177 + ret = PTR_ERR(priv->sclk_i2s); 178 + goto err_put_i2s_n; 179 + } 180 + 181 + priv->clk_i2s_bus = of_clk_get_by_name(link->cpu_of_node, "iis"); 182 + if (IS_ERR(priv->clk_i2s_bus)) { 183 + ret = PTR_ERR(priv->clk_i2s_bus); 184 + goto err_put_sclk; 185 + } 186 + 171 187 ret = devm_snd_soc_register_card(dev, card); 172 188 if (ret < 0) { 173 189 dev_err(dev, "snd_soc_register_card() failed: %d\n", ret); 174 - goto err_put_i2s_n; 190 + goto err_put_clk_i2s; 175 191 } 176 192 177 193 return 0; 178 194 195 + err_put_clk_i2s: 196 + clk_put(priv->clk_i2s_bus); 197 + err_put_sclk: 198 + clk_put(priv->sclk_i2s); 179 199 err_put_i2s_n: 180 200 of_node_put(link->cpu_of_node); 181 201 err_put_codec_n: ··· 206 192 207 193 of_node_put(priv->dai_link.cpu_of_node); 208 194 odroid_put_codec_of_nodes(&priv->dai_link); 195 + clk_put(priv->sclk_i2s); 196 + clk_put(priv->clk_i2s_bus); 209 197 210 198 return 0; 211 199 }
+6 -2
sound/soc/samsung/pcm.c
··· 522 522 dev_err(&pdev->dev, "failed to get audio-bus clock\n"); 523 523 return PTR_ERR(pcm->cclk); 524 524 } 525 - clk_prepare_enable(pcm->cclk); 525 + ret = clk_prepare_enable(pcm->cclk); 526 + if (ret) 527 + return ret; 526 528 527 529 /* record our pcm structure for later use in the callbacks */ 528 530 dev_set_drvdata(&pdev->dev, pcm); ··· 535 533 ret = PTR_ERR(pcm->pclk); 536 534 goto err_dis_cclk; 537 535 } 538 - clk_prepare_enable(pcm->pclk); 536 + ret = clk_prepare_enable(pcm->pclk); 537 + if (ret) 538 + goto err_dis_cclk; 539 539 540 540 s3c_pcm_stereo_in[pdev->id].addr = mem_res->start + S3C_PCM_RXFIFO; 541 541 s3c_pcm_stereo_out[pdev->id].addr = mem_res->start + S3C_PCM_TXFIFO;
+11 -3
sound/soc/samsung/s3c-i2s-v2.c
··· 27 27 28 28 #undef S3C_IIS_V2_SUPPORTED 29 29 30 - #if defined(CONFIG_CPU_S3C2412) || defined(CONFIG_CPU_S3C2413) \ 30 + #if defined(CONFIG_CPU_S3C2412) \ 31 31 || defined(CONFIG_ARCH_S3C64XX) || defined(CONFIG_CPU_S5PV210) 32 32 #define S3C_IIS_V2_SUPPORTED 33 33 #endif ··· 634 634 i2s->iis_pclk = clk_get(dev, "iis"); 635 635 if (IS_ERR(i2s->iis_pclk)) { 636 636 dev_err(dev, "failed to get iis_clock\n"); 637 - iounmap(i2s->regs); 638 637 return -ENOENT; 639 638 } 640 639 641 - clk_enable(i2s->iis_pclk); 640 + clk_prepare_enable(i2s->iis_pclk); 642 641 643 642 /* Mark ourselves as in TXRX mode so we can run through our cleanup 644 643 * process without warnings. */ ··· 650 651 return 0; 651 652 } 652 653 EXPORT_SYMBOL_GPL(s3c_i2sv2_probe); 654 + 655 + void s3c_i2sv2_cleanup(struct snd_soc_dai *dai, 656 + struct s3c_i2sv2_info *i2s) 657 + { 658 + clk_disable_unprepare(i2s->iis_pclk); 659 + clk_put(i2s->iis_pclk); 660 + i2s->iis_pclk = NULL; 661 + } 662 + EXPORT_SYMBOL_GPL(s3c_i2sv2_cleanup); 653 663 654 664 #ifdef CONFIG_PM 655 665 static int s3c2412_i2s_suspend(struct snd_soc_dai *dai)
+7
sound/soc/samsung/s3c-i2s-v2.h
··· 92 92 unsigned long base); 93 93 94 94 /** 95 + * s3c_i2sv2_cleanup - cleanup resources allocated in s3c_i2sv2_probe 96 + * @dai: The ASoC DAI structure supplied to the original probe. 97 + * @i2s: Our local i2s structure to fill in. 98 + */ 99 + extern void s3c_i2sv2_cleanup(struct snd_soc_dai *dai, 100 + struct s3c_i2sv2_info *i2s); 101 + /** 95 102 * s3c_i2sv2_register_component - register component and dai with soc core 96 103 * @dev: DAI device 97 104 * @id: DAI ID
+11 -4
sound/soc/samsung/s3c2412-i2s.c
··· 65 65 s3c2412_i2s.iis_cclk = devm_clk_get(dai->dev, "i2sclk"); 66 66 if (IS_ERR(s3c2412_i2s.iis_cclk)) { 67 67 pr_err("failed to get i2sclk clock\n"); 68 - return PTR_ERR(s3c2412_i2s.iis_cclk); 68 + ret = PTR_ERR(s3c2412_i2s.iis_cclk); 69 + goto err; 69 70 } 70 71 71 72 /* Set MPLL as the source for IIS CLK */ 72 73 73 74 clk_set_parent(s3c2412_i2s.iis_cclk, clk_get(NULL, "mpll")); 74 - clk_prepare_enable(s3c2412_i2s.iis_cclk); 75 - 76 - s3c2412_i2s.iis_cclk = s3c2412_i2s.iis_pclk; 75 + ret = clk_prepare_enable(s3c2412_i2s.iis_cclk); 76 + if (ret) 77 + goto err; 77 78 78 79 /* Configure the I2S pins (GPE0...GPE4) in correct mode */ 79 80 s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), 80 81 S3C_GPIO_PULL_NONE); 81 82 82 83 return 0; 84 + 85 + err: 86 + s3c_i2sv2_cleanup(dai, &s3c2412_i2s); 87 + 88 + return ret; 83 89 } 84 90 85 91 static int s3c2412_i2s_remove(struct snd_soc_dai *dai) 86 92 { 87 93 clk_disable_unprepare(s3c2412_i2s.iis_cclk); 94 + s3c_i2sv2_cleanup(dai, &s3c2412_i2s); 88 95 89 96 return 0; 90 97 }
+9 -2
sound/soc/samsung/s3c24xx-i2s.c
··· 340 340 341 341 static int s3c24xx_i2s_probe(struct snd_soc_dai *dai) 342 342 { 343 + int ret; 343 344 snd_soc_dai_init_dma_data(dai, &s3c24xx_i2s_pcm_stereo_out, 344 345 &s3c24xx_i2s_pcm_stereo_in); 345 346 ··· 349 348 pr_err("failed to get iis_clock\n"); 350 349 return PTR_ERR(s3c24xx_i2s.iis_clk); 351 350 } 352 - clk_prepare_enable(s3c24xx_i2s.iis_clk); 351 + ret = clk_prepare_enable(s3c24xx_i2s.iis_clk); 352 + if (ret) 353 + return ret; 353 354 354 355 /* Configure the I2S pins (GPE0...GPE4) in correct mode */ 355 356 s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), ··· 380 377 381 378 static int s3c24xx_i2s_resume(struct snd_soc_dai *cpu_dai) 382 379 { 383 - clk_prepare_enable(s3c24xx_i2s.iis_clk); 380 + int ret; 381 + 382 + ret = clk_prepare_enable(s3c24xx_i2s.iis_clk); 383 + if (ret) 384 + return ret; 384 385 385 386 writel(s3c24xx_i2s.iiscon, s3c24xx_i2s.regs + S3C2410_IISCON); 386 387 writel(s3c24xx_i2s.iismod, s3c24xx_i2s.regs + S3C2410_IISMOD);
+1 -1
sound/soc/samsung/s3c24xx_simtec.c
··· 211 211 return 0; 212 212 } 213 213 214 - static struct snd_soc_ops simtec_snd_ops = { 214 + static const struct snd_soc_ops simtec_snd_ops = { 215 215 .hw_params = simtec_hw_params, 216 216 }; 217 217
+1 -2
sound/soc/samsung/s3c24xx_uda134x.c
··· 199 199 return 0; 200 200 } 201 201 202 - static struct snd_soc_ops s3c24xx_uda134x_ops = { 202 + static const struct snd_soc_ops s3c24xx_uda134x_ops = { 203 203 .startup = s3c24xx_uda134x_startup, 204 204 .shutdown = s3c24xx_uda134x_shutdown, 205 205 .hw_params = s3c24xx_uda134x_hw_params, ··· 237 237 mutex_init(&priv->clk_lock); 238 238 239 239 card->dev = &pdev->dev; 240 - platform_set_drvdata(pdev, card); 241 240 snd_soc_card_set_drvdata(card, priv); 242 241 243 242 ret = devm_snd_soc_register_card(&pdev->dev, card);
+1 -1
sound/soc/samsung/smdk_spdif.c
··· 144 144 return ret; 145 145 } 146 146 147 - static struct snd_soc_ops smdk_spdif_ops = { 147 + static const struct snd_soc_ops smdk_spdif_ops = { 148 148 .hw_params = smdk_hw_params, 149 149 }; 150 150
+6 -2
sound/soc/samsung/spdif.c
··· 391 391 ret = -ENOENT; 392 392 goto err0; 393 393 } 394 - clk_prepare_enable(spdif->pclk); 394 + ret = clk_prepare_enable(spdif->pclk); 395 + if (ret) 396 + goto err0; 395 397 396 398 spdif->sclk = devm_clk_get(&pdev->dev, "sclk_spdif"); 397 399 if (IS_ERR(spdif->sclk)) { ··· 401 399 ret = -ENOENT; 402 400 goto err1; 403 401 } 404 - clk_prepare_enable(spdif->sclk); 402 + ret = clk_prepare_enable(spdif->sclk); 403 + if (ret) 404 + goto err1; 405 405 406 406 /* Request S/PDIF Register's memory region */ 407 407 if (!request_mem_region(mem_res->start,
+2 -2
sound/soc/samsung/tm2_wm5110.c
··· 318 318 SOC_DAPM_PIN_SWITCH("Headset Mic"), 319 319 }; 320 320 321 - const struct snd_soc_dapm_widget tm2_dapm_widgets[] = { 321 + static const struct snd_soc_dapm_widget tm2_dapm_widgets[] = { 322 322 SND_SOC_DAPM_HP("HP", NULL), 323 323 SND_SOC_DAPM_SPK("SPK", NULL), 324 324 SND_SOC_DAPM_SPK("RCV", NULL), ··· 521 521 tm2_start_sysclk(card); 522 522 } 523 523 524 - const struct dev_pm_ops tm2_pm_ops = { 524 + static const struct dev_pm_ops tm2_pm_ops = { 525 525 .prepare = tm2_pm_prepare, 526 526 .suspend = snd_soc_suspend, 527 527 .resume = snd_soc_resume,