Skip to content

Commit f23a44c

Browse files
shumingfanplbossart
authored andcommitted
ASoC: rt711-sdca: remap buttons
This patch uses the same mapping as the machine driver: BTN_0 : KEY_PLAYPAUSE BTN_1 : KEY_VOICECOMMAND BTN_2 : KEY_VOLUMEUP BTN_3 : KEY_VOLUMEDOWN Signed-off-by: Shuming Fan <shumingf@realtek.com> Reviewed-by: Bard Liao <bard.liao@intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
1 parent 2bb0572 commit f23a44c

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

sound/soc/codecs/rt711-sdca.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -199,34 +199,34 @@ static unsigned int rt711_sdca_button_detect(struct rt711_sdca_priv *rt711)
199199
if (buf[0] == 0x11) {
200200
switch (buf[1] & 0xf0) {
201201
case 0x10:
202-
btn_type |= SND_JACK_BTN_0;
202+
btn_type |= SND_JACK_BTN_2;
203203
break;
204204
case 0x20:
205-
btn_type |= SND_JACK_BTN_1;
205+
btn_type |= SND_JACK_BTN_3;
206206
break;
207207
case 0x40:
208-
btn_type |= SND_JACK_BTN_2;
208+
btn_type |= SND_JACK_BTN_0;
209209
break;
210210
case 0x80:
211-
btn_type |= SND_JACK_BTN_3;
211+
btn_type |= SND_JACK_BTN_1;
212212
break;
213213
}
214214
switch (buf[2]) {
215215
case 0x01:
216216
case 0x10:
217-
btn_type |= SND_JACK_BTN_0;
217+
btn_type |= SND_JACK_BTN_2;
218218
break;
219219
case 0x02:
220220
case 0x20:
221-
btn_type |= SND_JACK_BTN_1;
221+
btn_type |= SND_JACK_BTN_3;
222222
break;
223223
case 0x04:
224224
case 0x40:
225-
btn_type |= SND_JACK_BTN_2;
225+
btn_type |= SND_JACK_BTN_0;
226226
break;
227227
case 0x08:
228228
case 0x80:
229-
btn_type |= SND_JACK_BTN_3;
229+
btn_type |= SND_JACK_BTN_1;
230230
break;
231231
}
232232
}
@@ -370,34 +370,34 @@ static void rt711_sdca_btn_check_handler(struct work_struct *work)
370370
if (buf[0] == 0x11) {
371371
switch (buf[1] & 0xf0) {
372372
case 0x10:
373-
btn_type |= SND_JACK_BTN_0;
373+
btn_type |= SND_JACK_BTN_2;
374374
break;
375375
case 0x20:
376-
btn_type |= SND_JACK_BTN_1;
376+
btn_type |= SND_JACK_BTN_3;
377377
break;
378378
case 0x40:
379-
btn_type |= SND_JACK_BTN_2;
379+
btn_type |= SND_JACK_BTN_0;
380380
break;
381381
case 0x80:
382-
btn_type |= SND_JACK_BTN_3;
382+
btn_type |= SND_JACK_BTN_1;
383383
break;
384384
}
385385
switch (buf[2]) {
386386
case 0x01:
387387
case 0x10:
388-
btn_type |= SND_JACK_BTN_0;
388+
btn_type |= SND_JACK_BTN_2;
389389
break;
390390
case 0x02:
391391
case 0x20:
392-
btn_type |= SND_JACK_BTN_1;
392+
btn_type |= SND_JACK_BTN_3;
393393
break;
394394
case 0x04:
395395
case 0x40:
396-
btn_type |= SND_JACK_BTN_2;
396+
btn_type |= SND_JACK_BTN_0;
397397
break;
398398
case 0x08:
399399
case 0x80:
400-
btn_type |= SND_JACK_BTN_3;
400+
btn_type |= SND_JACK_BTN_1;
401401
break;
402402
}
403403
}

0 commit comments

Comments
 (0)