/*sysfs_notify(&pdev->dev.kobj, NULL, "headphone");*/
priv->hp_status = gpio_get_value(plat->hp_gpio);
+ /* if headphone is inserted, disable speaker */
+ if (priv->hp_status != plat->hp_active_low)
+ snd_soc_dapm_nc_pin(&gcodec->dapm, "Ext Spk");
+ else
+ snd_soc_dapm_enable_pin(&gcodec->dapm, "Ext Spk");
+
+ snd_soc_dapm_sync(&gcodec->dapm);
+
/* setup a message for userspace headphone in */
buf = kmalloc(32, GFP_ATOMIC);
if (!buf) {
else
snd_soc_dapm_enable_pin(&gcodec->dapm, "DMIC");
+ snd_soc_dapm_sync(&gcodec->dapm);
+
/* setup a message for userspace headphone in */
buf = kmalloc(32, GFP_ATOMIC);
if (!buf) {
ret = -EINVAL;
return ret;
}
+
+ priv->hp_status = gpio_get_value(plat->hp_gpio);
+
+ /* if headphone is inserted, disable speaker */
+ if (priv->hp_status != plat->hp_active_low)
+ snd_soc_dapm_nc_pin(&codec->dapm, "Ext Spk");
+ else
+ snd_soc_dapm_enable_pin(&codec->dapm, "Ext Spk");
}
if (plat->mic_gpio != -1) {