aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/boards/cht_bsw_rt5672.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/intel/boards/cht_bsw_rt5672.c')
-rw-r--r--sound/soc/intel/boards/cht_bsw_rt5672.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/soc/intel/boards/cht_bsw_rt5672.c b/sound/soc/intel/boards/cht_bsw_rt5672.c
index e5aa13058dd7..51f0d45d6f8f 100644
--- a/sound/soc/intel/boards/cht_bsw_rt5672.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5672.c
@@ -16,6 +16,7 @@
* General Public License for more details.
*/
+#include <linux/input.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
@@ -212,6 +213,10 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
if (ret)
return ret;
+ snd_jack_set_key(ctx->headset.jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
+ snd_jack_set_key(ctx->headset.jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
+ snd_jack_set_key(ctx->headset.jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
+
rt5670_set_jack_detect(component, &ctx->headset);
if (ctx->mclk) {
/*
@@ -342,7 +347,7 @@ static int cht_suspend_pre(struct snd_soc_card *card)
struct snd_soc_component *component;
struct cht_mc_private *ctx = snd_soc_card_get_drvdata(card);
- list_for_each_entry(component, &card->component_dev_list, card_list) {
+ for_each_card_components(card, component) {
if (!strncmp(component->name,
ctx->codec_name, sizeof(ctx->codec_name))) {
@@ -359,7 +364,7 @@ static int cht_resume_post(struct snd_soc_card *card)
struct snd_soc_component *component;
struct cht_mc_private *ctx = snd_soc_card_get_drvdata(card);
- list_for_each_entry(component, &card->component_dev_list, card_list) {
+ for_each_card_components(card, component) {
if (!strncmp(component->name,
ctx->codec_name, sizeof(ctx->codec_name))) {