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

Merge branch 'topic/rt5677' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-intel

+34 -25
+7 -25
sound/soc/codecs/rt5677.c
··· 41 41 42 42 #define RT5677_PR_BASE (RT5677_PR_RANGE_BASE + (0 * RT5677_PR_SPACING)) 43 43 44 - /* GPIO indexes defined by ACPI */ 45 - enum { 46 - RT5677_GPIO_PLUG_DET = 0, 47 - RT5677_GPIO_MIC_PRESENT_L = 1, 48 - RT5677_GPIO_HOTWORD_DET_L = 2, 49 - RT5677_GPIO_DSP_INT = 3, 50 - RT5677_GPIO_HP_AMP_SHDN_L = 4, 51 - }; 52 - 53 44 static const struct regmap_range_cfg rt5677_ranges[] = { 54 45 { 55 46 .name = "PR", ··· 5021 5030 static const struct i2c_device_id rt5677_i2c_id[] = { 5022 5031 { "rt5677", RT5677 }, 5023 5032 { "rt5676", RT5676 }, 5024 - { "RT5677CE:00", RT5677 }, 5025 5033 { } 5026 5034 }; 5027 5035 MODULE_DEVICE_TABLE(i2c, rt5677_i2c_id); ··· 5031 5041 }; 5032 5042 MODULE_DEVICE_TABLE(of, rt5677_of_match); 5033 5043 5034 - static const struct acpi_gpio_params plug_det_gpio = { RT5677_GPIO_PLUG_DET, 0, false }; 5035 - static const struct acpi_gpio_params mic_present_gpio = { RT5677_GPIO_MIC_PRESENT_L, 0, false }; 5036 - static const struct acpi_gpio_params headphone_enable_gpio = { RT5677_GPIO_HP_AMP_SHDN_L, 0, false }; 5037 - 5038 - static const struct acpi_gpio_mapping bdw_rt5677_gpios[] = { 5039 - { "plug-det-gpios", &plug_det_gpio, 1 }, 5040 - { "mic-present-gpios", &mic_present_gpio, 1 }, 5041 - { "headphone-enable-gpios", &headphone_enable_gpio, 1 }, 5042 - { NULL }, 5044 + #ifdef CONFIG_ACPI 5045 + static const struct acpi_device_id rt5677_acpi_match[] = { 5046 + { "RT5677CE", RT5677 }, 5047 + { } 5043 5048 }; 5049 + MODULE_DEVICE_TABLE(acpi, rt5677_acpi_match); 5050 + #endif 5044 5051 5045 5052 static void rt5677_read_acpi_properties(struct rt5677_priv *rt5677, 5046 5053 struct device *dev) 5047 5054 { 5048 - int ret; 5049 5055 u32 val; 5050 - 5051 - ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(dev), 5052 - bdw_rt5677_gpios); 5053 - if (ret) 5054 - dev_warn(dev, "Failed to add driver gpios\n"); 5055 5056 5056 5057 if (!device_property_read_u32(dev, "DCLK", &val)) 5057 5058 rt5677->pdata.dmic2_clk_pin = val; ··· 5282 5301 .driver = { 5283 5302 .name = "rt5677", 5284 5303 .of_match_table = rt5677_of_match, 5304 + .acpi_match_table = ACPI_PTR(rt5677_acpi_match), 5285 5305 }, 5286 5306 .probe = rt5677_i2c_probe, 5287 5307 .remove = rt5677_i2c_remove,
+27
sound/soc/intel/boards/bdw-rt5677.c
··· 16 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 17 */ 18 18 19 + #include <linux/acpi.h> 19 20 #include <linux/module.h> 20 21 #include <linux/platform_device.h> 21 22 #include <linux/gpio/consumer.h> ··· 121 120 .invert = 1, 122 121 }; 123 122 123 + /* GPIO indexes defined by ACPI */ 124 + enum { 125 + RT5677_GPIO_PLUG_DET = 0, 126 + RT5677_GPIO_MIC_PRESENT_L = 1, 127 + RT5677_GPIO_HOTWORD_DET_L = 2, 128 + RT5677_GPIO_DSP_INT = 3, 129 + RT5677_GPIO_HP_AMP_SHDN_L = 4, 130 + }; 131 + 132 + static const struct acpi_gpio_params plug_det_gpio = { RT5677_GPIO_PLUG_DET, 0, false }; 133 + static const struct acpi_gpio_params mic_present_gpio = { RT5677_GPIO_MIC_PRESENT_L, 0, false }; 134 + static const struct acpi_gpio_params headphone_enable_gpio = { RT5677_GPIO_HP_AMP_SHDN_L, 0, false }; 135 + 136 + static const struct acpi_gpio_mapping bdw_rt5677_gpios[] = { 137 + { "plug-det-gpios", &plug_det_gpio, 1 }, 138 + { "mic-present-gpios", &mic_present_gpio, 1 }, 139 + { "headphone-enable-gpios", &headphone_enable_gpio, 1 }, 140 + { NULL }, 141 + }; 142 + 124 143 static int broadwell_ssp0_fixup(struct snd_soc_pcm_runtime *rtd, 125 144 struct snd_pcm_hw_params *params) 126 145 { ··· 205 184 snd_soc_card_get_drvdata(rtd->card); 206 185 struct snd_soc_codec *codec = rtd->codec; 207 186 struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); 187 + int ret; 188 + 189 + ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(codec->dev), 190 + bdw_rt5677_gpios); 191 + if (ret) 192 + dev_warn(codec->dev, "Failed to add driver gpios\n"); 208 193 209 194 /* Enable codec ASRC function for Stereo DAC/Stereo1 ADC/DMIC/I2S1. 210 195 * The ASRC clock source is clk_i2s1_asrc.