Loading include/sound/soc.h +5 −3 Original line number Diff line number Diff line Loading @@ -450,8 +450,10 @@ int soc_dai_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai); /* Jack reporting */ int snd_soc_jack_new(struct snd_soc_codec *codec, const char *id, int type, struct snd_soc_jack *jack); int snd_soc_card_jack_new(struct snd_soc_card *card, const char *id, int type, struct snd_soc_jack *jack, struct snd_soc_jack_pin *pins, unsigned int num_pins); void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask); int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count, struct snd_soc_jack_pin *pins); Loading Loading @@ -659,7 +661,7 @@ struct snd_soc_jack_gpio { struct snd_soc_jack { struct mutex mutex; struct snd_jack *jack; struct snd_soc_codec *codec; struct snd_soc_card *card; struct list_head pins; int status; struct blocking_notifier_head notifier; Loading sound/soc/codecs/max98357a.c +4 −7 Original line number Diff line number Diff line Loading @@ -26,8 +26,6 @@ #include <sound/soc-dai.h> #include <sound/soc-dapm.h> #define DRV_NAME "max98357a" static int max98357a_daiops_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { Loading Loading @@ -87,9 +85,9 @@ static struct snd_soc_dai_ops max98357a_dai_ops = { }; static struct snd_soc_dai_driver max98357a_dai_driver = { .name = DRV_NAME, .name = "HiFi", .playback = { .stream_name = DRV_NAME "-playback", .stream_name = "HiFi Playback", .formats = SNDRV_PCM_FMTBIT_S16 | SNDRV_PCM_FMTBIT_S24 | SNDRV_PCM_FMTBIT_S32, Loading Loading @@ -127,7 +125,7 @@ static int max98357a_platform_remove(struct platform_device *pdev) #ifdef CONFIG_OF static const struct of_device_id max98357a_device_id[] = { { .compatible = "maxim," DRV_NAME, }, { .compatible = "maxim,max98357a" }, {} }; MODULE_DEVICE_TABLE(of, max98357a_device_id); Loading @@ -135,7 +133,7 @@ MODULE_DEVICE_TABLE(of, max98357a_device_id); static struct platform_driver max98357a_platform_driver = { .driver = { .name = DRV_NAME, .name = "max98357a", .of_match_table = of_match_ptr(max98357a_device_id), }, .probe = max98357a_platform_probe, Loading @@ -145,4 +143,3 @@ module_platform_driver(max98357a_platform_driver); MODULE_DESCRIPTION("Maxim MAX98357A Codec Driver"); MODULE_LICENSE("GPL v2"); MODULE_ALIAS("platform:" DRV_NAME); sound/soc/codecs/rt286.c +14 −3 Original line number Diff line number Diff line Loading @@ -395,9 +395,20 @@ int rt286_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack) rt286->jack = jack; if (jack) { /* enable IRQ */ if (rt286->jack->status | SND_JACK_HEADPHONE) snd_soc_dapm_force_enable_pin(&codec->dapm, "LDO1"); regmap_update_bits(rt286->regmap, RT286_IRQ_CTRL, 0x2, 0x2); /* Send an initial empty report */ snd_soc_jack_report(rt286->jack, 0, snd_soc_jack_report(rt286->jack, rt286->jack->status, SND_JACK_MICROPHONE | SND_JACK_HEADPHONE); } else { /* disable IRQ */ regmap_update_bits(rt286->regmap, RT286_IRQ_CTRL, 0x2, 0x0); snd_soc_dapm_disable_pin(&codec->dapm, "LDO1"); } snd_soc_dapm_sync(&codec->dapm); return 0; } Loading sound/soc/codecs/sn95031.c +8 −6 Original line number Diff line number Diff line Loading @@ -783,19 +783,21 @@ static inline void sn95031_enable_jack_btn(struct snd_soc_codec *codec) snd_soc_write(codec, SN95031_BTNCTRL2, 0x01); } static int sn95031_get_headset_state(struct snd_soc_jack *mfld_jack) static int sn95031_get_headset_state(struct snd_soc_codec *codec, struct snd_soc_jack *mfld_jack) { int micbias = sn95031_get_mic_bias(mfld_jack->codec); int micbias = sn95031_get_mic_bias(codec); int jack_type = snd_soc_jack_get_type(mfld_jack, micbias); pr_debug("jack type detected = %d\n", jack_type); if (jack_type == SND_JACK_HEADSET) sn95031_enable_jack_btn(mfld_jack->codec); sn95031_enable_jack_btn(codec); return jack_type; } void sn95031_jack_detection(struct mfld_jack_data *jack_data) void sn95031_jack_detection(struct snd_soc_codec *codec, struct mfld_jack_data *jack_data) { unsigned int status; unsigned int mask = SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_HEADSET; Loading @@ -809,11 +811,11 @@ void sn95031_jack_detection(struct mfld_jack_data *jack_data) status = SND_JACK_HEADSET | SND_JACK_BTN_1; } else if (jack_data->intr_id & 0x4) { pr_debug("headset or headphones inserted\n"); status = sn95031_get_headset_state(jack_data->mfld_jack); status = sn95031_get_headset_state(codec, jack_data->mfld_jack); } else if (jack_data->intr_id & 0x8) { pr_debug("headset or headphones removed\n"); status = 0; sn95031_disable_jack_btn(jack_data->mfld_jack->codec); sn95031_disable_jack_btn(codec); } else { pr_err("unidentified interrupt\n"); return; Loading sound/soc/codecs/sn95031.h +2 −1 Original line number Diff line number Diff line Loading @@ -127,6 +127,7 @@ struct mfld_jack_data { struct snd_soc_jack *mfld_jack; }; extern void sn95031_jack_detection(struct mfld_jack_data *jack_data); extern void sn95031_jack_detection(struct snd_soc_codec *codec, struct mfld_jack_data *jack_data); #endif Loading
include/sound/soc.h +5 −3 Original line number Diff line number Diff line Loading @@ -450,8 +450,10 @@ int soc_dai_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai); /* Jack reporting */ int snd_soc_jack_new(struct snd_soc_codec *codec, const char *id, int type, struct snd_soc_jack *jack); int snd_soc_card_jack_new(struct snd_soc_card *card, const char *id, int type, struct snd_soc_jack *jack, struct snd_soc_jack_pin *pins, unsigned int num_pins); void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask); int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count, struct snd_soc_jack_pin *pins); Loading Loading @@ -659,7 +661,7 @@ struct snd_soc_jack_gpio { struct snd_soc_jack { struct mutex mutex; struct snd_jack *jack; struct snd_soc_codec *codec; struct snd_soc_card *card; struct list_head pins; int status; struct blocking_notifier_head notifier; Loading
sound/soc/codecs/max98357a.c +4 −7 Original line number Diff line number Diff line Loading @@ -26,8 +26,6 @@ #include <sound/soc-dai.h> #include <sound/soc-dapm.h> #define DRV_NAME "max98357a" static int max98357a_daiops_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { Loading Loading @@ -87,9 +85,9 @@ static struct snd_soc_dai_ops max98357a_dai_ops = { }; static struct snd_soc_dai_driver max98357a_dai_driver = { .name = DRV_NAME, .name = "HiFi", .playback = { .stream_name = DRV_NAME "-playback", .stream_name = "HiFi Playback", .formats = SNDRV_PCM_FMTBIT_S16 | SNDRV_PCM_FMTBIT_S24 | SNDRV_PCM_FMTBIT_S32, Loading Loading @@ -127,7 +125,7 @@ static int max98357a_platform_remove(struct platform_device *pdev) #ifdef CONFIG_OF static const struct of_device_id max98357a_device_id[] = { { .compatible = "maxim," DRV_NAME, }, { .compatible = "maxim,max98357a" }, {} }; MODULE_DEVICE_TABLE(of, max98357a_device_id); Loading @@ -135,7 +133,7 @@ MODULE_DEVICE_TABLE(of, max98357a_device_id); static struct platform_driver max98357a_platform_driver = { .driver = { .name = DRV_NAME, .name = "max98357a", .of_match_table = of_match_ptr(max98357a_device_id), }, .probe = max98357a_platform_probe, Loading @@ -145,4 +143,3 @@ module_platform_driver(max98357a_platform_driver); MODULE_DESCRIPTION("Maxim MAX98357A Codec Driver"); MODULE_LICENSE("GPL v2"); MODULE_ALIAS("platform:" DRV_NAME);
sound/soc/codecs/rt286.c +14 −3 Original line number Diff line number Diff line Loading @@ -395,9 +395,20 @@ int rt286_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack) rt286->jack = jack; if (jack) { /* enable IRQ */ if (rt286->jack->status | SND_JACK_HEADPHONE) snd_soc_dapm_force_enable_pin(&codec->dapm, "LDO1"); regmap_update_bits(rt286->regmap, RT286_IRQ_CTRL, 0x2, 0x2); /* Send an initial empty report */ snd_soc_jack_report(rt286->jack, 0, snd_soc_jack_report(rt286->jack, rt286->jack->status, SND_JACK_MICROPHONE | SND_JACK_HEADPHONE); } else { /* disable IRQ */ regmap_update_bits(rt286->regmap, RT286_IRQ_CTRL, 0x2, 0x0); snd_soc_dapm_disable_pin(&codec->dapm, "LDO1"); } snd_soc_dapm_sync(&codec->dapm); return 0; } Loading
sound/soc/codecs/sn95031.c +8 −6 Original line number Diff line number Diff line Loading @@ -783,19 +783,21 @@ static inline void sn95031_enable_jack_btn(struct snd_soc_codec *codec) snd_soc_write(codec, SN95031_BTNCTRL2, 0x01); } static int sn95031_get_headset_state(struct snd_soc_jack *mfld_jack) static int sn95031_get_headset_state(struct snd_soc_codec *codec, struct snd_soc_jack *mfld_jack) { int micbias = sn95031_get_mic_bias(mfld_jack->codec); int micbias = sn95031_get_mic_bias(codec); int jack_type = snd_soc_jack_get_type(mfld_jack, micbias); pr_debug("jack type detected = %d\n", jack_type); if (jack_type == SND_JACK_HEADSET) sn95031_enable_jack_btn(mfld_jack->codec); sn95031_enable_jack_btn(codec); return jack_type; } void sn95031_jack_detection(struct mfld_jack_data *jack_data) void sn95031_jack_detection(struct snd_soc_codec *codec, struct mfld_jack_data *jack_data) { unsigned int status; unsigned int mask = SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_HEADSET; Loading @@ -809,11 +811,11 @@ void sn95031_jack_detection(struct mfld_jack_data *jack_data) status = SND_JACK_HEADSET | SND_JACK_BTN_1; } else if (jack_data->intr_id & 0x4) { pr_debug("headset or headphones inserted\n"); status = sn95031_get_headset_state(jack_data->mfld_jack); status = sn95031_get_headset_state(codec, jack_data->mfld_jack); } else if (jack_data->intr_id & 0x8) { pr_debug("headset or headphones removed\n"); status = 0; sn95031_disable_jack_btn(jack_data->mfld_jack->codec); sn95031_disable_jack_btn(codec); } else { pr_err("unidentified interrupt\n"); return; Loading
sound/soc/codecs/sn95031.h +2 −1 Original line number Diff line number Diff line Loading @@ -127,6 +127,7 @@ struct mfld_jack_data { struct snd_soc_jack *mfld_jack; }; extern void sn95031_jack_detection(struct mfld_jack_data *jack_data); extern void sn95031_jack_detection(struct snd_soc_codec *codec, struct mfld_jack_data *jack_data); #endif