greybus: gb-audio: Add integrated greybus audio driver
authorJohn Stultz <john.stultz@linaro.org>
Fri, 8 May 2015 19:57:36 +0000 (12:57 -0700)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 8 May 2015 20:23:58 +0000 (22:23 +0200)
commita4749bbeee31204a48fc3bf10c80bb88cf52bab5
tree72046a5ac45e55e9f8e3b87da6e461da7007e103
parent6d653370c0a67ff9b9b0d8249182d537859b528c
greybus: gb-audio: Add integrated greybus audio driver

So here's the current greybus audio driver, which I
wanted to send out for more serious review and
consideration for merging.

I've tried to integrate much of the feedback from the
last round and most of the hotplug issues that I've found
have been resolved. I've tested this via gbsim, and the
Android ARA HAL layer seems to work with it.

Mark has also successfully played audio with this driver,
adding a few hacks to get the codec's i2c connection to
probe.

Current issues:
* Hotplug problem - When gbsim is killed, or the module
  removed, the greybus driver gets stuck since the android
  mediaserver process is holding the audio device open.
  Killing the mediaserver allows things to clean up and
  allows greybus to accept new gbsim connections. I have
  a workaround patch to the soc-core.c logic which converts
  the snd_card_free() call to snd_card_free_when_closed()
  which allows the greybus connection cleanup to finish.

Remaining todos:
* Probably need to break apart the mgmt_setup function
  to integrate better with the constraint logic. I took
  a really basic stab at this, but more is probably
  needed.
* Figure out how to properly find and tie in the
  codec's I2C bus-id to the driver.

This code requires that the kernel support the following
config options, which I've enabled in a separate kernel
patch:
CONFIG_SND_SIMPLE_CARD
CONFIG_SND_SOC_SPDIF
CONFIG_SND_SOC_RT5645

I really can't calim to be the sole author of this, since
many many fixes and tweaks that have been folded in have
come from Mark Greer. His analsysis and debugging is really
what has made this dummy-framework driver evolve into an
actual audio driver. So much credit and thanks to Mark!

Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/Makefile
drivers/staging/greybus/audio-dai.c [new file with mode: 0644]
drivers/staging/greybus/audio-gb-cmds.c [new file with mode: 0644]
drivers/staging/greybus/audio-pcm.c [new file with mode: 0644]
drivers/staging/greybus/audio.c [new file with mode: 0644]
drivers/staging/greybus/audio.h [new file with mode: 0644]
drivers/staging/greybus/gpb.c
drivers/staging/greybus/gpbridge.h
drivers/staging/greybus/protocol.h