greybus: gb-audio: Set I2S Configuration according to ASOC requests
authorMark A. Greer <mgreer@animalcreek.com>
Thu, 21 May 2015 22:57:03 +0000 (15:57 -0700)
committerGreg Kroah-Hartman <gregkh@google.com>
Sat, 23 May 2015 23:26:41 +0000 (16:26 -0700)
commit6b34099ec326e6c94fc5cf3ce3e1e4a9877c43ea
tree2c94b25587d43ed262e4349e6d3a6071f6d6f142
parent48229e592f95b4d0071f7711bd4c0e54104724e4
greybus: gb-audio: Set I2S Configuration according to ASOC requests

Currently, the audio driver unconditionally sets the I2S
configuration to have a sample rate of 48KHz, two channels,
16 bits per channel, in little endian order.  Make this
more flexible by setting the I2S configuration according to
the arguments passed to the PCM 'hw_params' callback.

To accomplish this, query for the supported I2S configurations
at Greybus protocol init time and save them in the 'snd_dev'
structure.  When the 'hw_params' callback is called, compare its
arguments to the table of supported configurations.  If there is
a match, set the I2S connection accordingly.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Acked-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/audio-gb-cmds.c
drivers/staging/greybus/audio-pcm.c
drivers/staging/greybus/audio.c
drivers/staging/greybus/audio.h