/drivers/staging/line6/variax.h

https://bitbucket.org/slukk/jb-tsm-kernel-4.2 · C Header · 132 lines · 51 code · 22 blank · 59 comment · 0 complexity · e6fc81b7b60a3fbca0e82913d12b5811 MD5 · raw file

  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 VARIAX_H
  12. #define VARIAX_H
  13. #include <linux/spinlock.h>
  14. #include <linux/usb.h>
  15. #include <linux/wait.h>
  16. #include <sound/core.h>
  17. #include "driver.h"
  18. #include "dumprequest.h"
  19. #define VARIAX_STARTUP_DELAY1 1000
  20. #define VARIAX_STARTUP_DELAY3 100
  21. #define VARIAX_STARTUP_DELAY4 100
  22. /*
  23. Stages of Variax startup procedure
  24. */
  25. enum {
  26. VARIAX_STARTUP_INIT = 1,
  27. VARIAX_STARTUP_VERSIONREQ,
  28. VARIAX_STARTUP_WAIT,
  29. VARIAX_STARTUP_ACTIVATE,
  30. VARIAX_STARTUP_DUMPREQ,
  31. VARIAX_STARTUP_WORKQUEUE,
  32. VARIAX_STARTUP_SETUP,
  33. VARIAX_STARTUP_LAST = VARIAX_STARTUP_SETUP - 1
  34. };
  35. enum {
  36. VARIAX_DUMP_PASS1 = LINE6_DUMP_CURRENT,
  37. VARIAX_DUMP_PASS2,
  38. VARIAX_DUMP_PASS3
  39. };
  40. /**
  41. Binary Variax model dump
  42. */
  43. struct variax_model {
  44. /**
  45. Header information (including program name).
  46. */
  47. unsigned char name[18];
  48. /**
  49. Model parameters.
  50. */
  51. unsigned char control[78 * 2];
  52. };
  53. struct usb_line6_variax {
  54. /**
  55. Generic Line6 USB data.
  56. */
  57. struct usb_line6 line6;
  58. /**
  59. Dump request structure.
  60. Append two extra buffers for 3-pass data query.
  61. */
  62. struct line6_dump_request dumpreq;
  63. struct line6_dump_reqbuf extrabuf[2];
  64. /**
  65. Buffer for activation code.
  66. */
  67. unsigned char *buffer_activate;
  68. /**
  69. Model number.
  70. */
  71. int model;
  72. /**
  73. Current model settings.
  74. */
  75. struct variax_model model_data;
  76. /**
  77. Name of connected guitar.
  78. */
  79. unsigned char guitar[18];
  80. /**
  81. Name of current model bank.
  82. */
  83. unsigned char bank[18];
  84. /**
  85. Position of volume dial.
  86. */
  87. int volume;
  88. /**
  89. Position of tone control dial.
  90. */
  91. int tone;
  92. /**
  93. Handler for device initializaton.
  94. */
  95. struct work_struct startup_work;
  96. /**
  97. Timers for device initializaton.
  98. */
  99. struct timer_list startup_timer1;
  100. struct timer_list startup_timer2;
  101. /**
  102. Current progress in startup procedure.
  103. */
  104. int startup_progress;
  105. };
  106. extern void line6_variax_disconnect(struct usb_interface *interface);
  107. extern int line6_variax_init(struct usb_interface *interface,
  108. struct usb_line6_variax *variax);
  109. extern void line6_variax_process_message(struct usb_line6_variax *variax);
  110. #endif