android.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Platform data for Android USB
  3. *
  4. * Copyright (C) 2008 Google, Inc.
  5. * Author: Mike Lockwood <lockwood@android.com>
  6. *
  7. * This software is licensed under the terms of the GNU General Public
  8. * License version 2, as published by the Free Software Foundation, and
  9. * may be copied, distributed, and modified under those terms.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. */
  17. #ifndef __LINUX_USB_ANDROID_H
  18. #define __LINUX_USB_ANDROID_H
  19. #include <linux/usb/composite.h>
  20. #define MAX_STREAMING_FUNCS 3
  21. #define FUNC_NAME_LEN 10
  22. struct android_usb_platform_data {
  23. int (*update_pid_and_serial_num)(uint32_t, const char *);
  24. u32 swfi_latency;
  25. u8 usb_core_id;
  26. bool cdrom;
  27. #ifdef CONFIG_USB_ANDROID_SAMSUNG_COMPOSITE
  28. u8 nluns;
  29. #endif
  30. bool internal_ums;
  31. char streaming_func[MAX_STREAMING_FUNCS][FUNC_NAME_LEN];
  32. int streaming_func_count;
  33. u32 uicc_nluns;
  34. };
  35. #ifndef CONFIG_TARGET_CORE
  36. static inline int f_tcm_init(int (*connect_cb)(bool connect))
  37. {
  38. /*
  39. * Fail bind() not init(). If a function init() returns error
  40. * android composite registration would fail.
  41. */
  42. return 0;
  43. }
  44. static inline void f_tcm_exit(void)
  45. {
  46. }
  47. static inline int tcm_bind_config(struct usb_configuration *c)
  48. {
  49. return -ENODEV;
  50. }
  51. #endif
  52. #endif /* __LINUX_USB_ANDROID_H */