u_uac1.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * u_uac1.h -- interface to USB gadget "ALSA AUDIO" utilities
  3. *
  4. * Copyright (C) 2008 Bryan Wu <cooloney@kernel.org>
  5. * Copyright (C) 2008 Analog Devices, Inc
  6. *
  7. * Enter bugs at http://blackfin.uclinux.org/
  8. *
  9. * Licensed under the GPL-2 or later.
  10. */
  11. #ifndef __U_AUDIO_H
  12. #define __U_AUDIO_H
  13. #include <linux/device.h>
  14. #include <linux/err.h>
  15. #include <linux/usb/audio.h>
  16. #include <linux/usb/composite.h>
  17. #include <sound/core.h>
  18. #include <sound/pcm.h>
  19. #include <sound/pcm_params.h>
  20. #include "gadget_chips.h"
  21. /*
  22. * This represents the USB side of an audio card device, managed by a USB
  23. * function which provides control and stream interfaces.
  24. */
  25. struct gaudio_snd_dev {
  26. struct gaudio *card;
  27. struct file *filp;
  28. struct snd_pcm_substream *substream;
  29. int access;
  30. int format;
  31. int channels;
  32. int rate;
  33. };
  34. struct gaudio {
  35. struct usb_function func;
  36. struct usb_gadget *gadget;
  37. /* ALSA sound device interfaces */
  38. struct gaudio_snd_dev control;
  39. struct gaudio_snd_dev playback;
  40. struct gaudio_snd_dev capture;
  41. /* TODO */
  42. };
  43. int gaudio_setup(struct gaudio *card);
  44. void gaudio_cleanup(void);
  45. #endif /* __U_AUDIO_H */