pod.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * Line6 Linux USB driver - 0.9.1beta
  3. *
  4. * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation, version 2.
  9. *
  10. */
  11. #ifndef POD_H
  12. #define POD_H
  13. #include <linux/interrupt.h>
  14. #include <linux/spinlock.h>
  15. #include <linux/usb.h>
  16. #include <sound/core.h>
  17. #include "driver.h"
  18. /*
  19. PODxt Live interfaces
  20. */
  21. #define PODXTLIVE_INTERFACE_POD 0
  22. #define PODXTLIVE_INTERFACE_VARIAX 1
  23. /*
  24. Locate name in binary program dump
  25. */
  26. #define POD_NAME_OFFSET 0
  27. #define POD_NAME_LENGTH 16
  28. /*
  29. Other constants
  30. */
  31. #define POD_CONTROL_SIZE 0x80
  32. #define POD_BUFSIZE_DUMPREQ 7
  33. #define POD_STARTUP_DELAY 1000
  34. /*
  35. Stages of POD startup procedure
  36. */
  37. enum {
  38. POD_STARTUP_INIT = 1,
  39. POD_STARTUP_VERSIONREQ,
  40. POD_STARTUP_WORKQUEUE,
  41. POD_STARTUP_SETUP,
  42. POD_STARTUP_LAST = POD_STARTUP_SETUP - 1
  43. };
  44. struct usb_line6_pod {
  45. /**
  46. Generic Line6 USB data.
  47. */
  48. struct usb_line6 line6;
  49. /**
  50. Instrument monitor level.
  51. */
  52. int monitor_level;
  53. /**
  54. Timer for device initializaton.
  55. */
  56. struct timer_list startup_timer;
  57. /**
  58. Work handler for device initializaton.
  59. */
  60. struct work_struct startup_work;
  61. /**
  62. Current progress in startup procedure.
  63. */
  64. int startup_progress;
  65. /**
  66. Serial number of device.
  67. */
  68. int serial_number;
  69. /**
  70. Firmware version (x 100).
  71. */
  72. int firmware_version;
  73. /**
  74. Device ID.
  75. */
  76. int device_id;
  77. };
  78. extern void line6_pod_disconnect(struct usb_interface *interface);
  79. extern int line6_pod_init(struct usb_interface *interface,
  80. struct usb_line6_pod *pod);
  81. extern void line6_pod_process_message(struct usb_line6_pod *pod);
  82. extern void line6_pod_transmit_parameter(struct usb_line6_pod *pod, int param,
  83. u8 value);
  84. #endif