Skip to content

Commit 618a51f

Browse files
jinxiuxuAlan Carvalho de Assis
authored andcommitted
audio: add 12K support in sim_alsa driver
Signed-off-by: jinxiuxu <[email protected]>
1 parent 7355629 commit 618a51f

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

arch/sim/src/sim/posix/sim_alsa.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ static int sim_audio_getcaps(struct audio_lowerhalf_s *dev, int type,
309309
struct audio_caps_s *caps)
310310
{
311311
struct sim_audio_s *priv = (struct sim_audio_s *)dev;
312+
uint16_t *ptr;
312313
long val;
313314

314315
caps->ac_format.hw = 0;
@@ -369,14 +370,16 @@ static int sim_audio_getcaps(struct audio_lowerhalf_s *dev, int type,
369370

370371
/* Report the Sample rates we support */
371372

372-
caps->ac_controls.b[0] = AUDIO_SAMP_RATE_8K |
373-
AUDIO_SAMP_RATE_11K |
374-
AUDIO_SAMP_RATE_16K |
375-
AUDIO_SAMP_RATE_22K |
376-
AUDIO_SAMP_RATE_24K |
377-
AUDIO_SAMP_RATE_32K |
378-
AUDIO_SAMP_RATE_44K |
379-
AUDIO_SAMP_RATE_48K;
373+
ptr = (uint16_t *)caps->ac_controls.b;
374+
*ptr = AUDIO_SAMP_RATE_8K |
375+
AUDIO_SAMP_RATE_11K |
376+
AUDIO_SAMP_RATE_12K |
377+
AUDIO_SAMP_RATE_16K |
378+
AUDIO_SAMP_RATE_22K |
379+
AUDIO_SAMP_RATE_24K |
380+
AUDIO_SAMP_RATE_32K |
381+
AUDIO_SAMP_RATE_44K |
382+
AUDIO_SAMP_RATE_48K;
380383
break;
381384

382385
default:

0 commit comments

Comments
 (0)