Merge branch 'for-linus' into for-next
authorTakashi Iwai <tiwai@suse.de>
Wed, 9 Sep 2020 16:26:07 +0000 (18:26 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 9 Sep 2020 16:26:48 +0000 (18:26 +0200)
Back-merge to apply the tasklet conversion patches that are based
on the already applied tasklet API changes on 5.9-rc4.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
1  2 
sound/core/timer.c
sound/usb/quirks-table.h

diff --combined sound/core/timer.c
index b915d39e7acb3069c0773abc56dfa89cc5853fcf,6e27d87b18ed6b9e696321d0fe6767bb553fb60d..227d8152d32559374bda4439e53a50fa5d8acea9
@@@ -173,7 -173,7 +173,7 @@@ EXPORT_SYMBOL(snd_timer_instance_free)
   */
  static struct snd_timer *snd_timer_find(struct snd_timer_id *tid)
  {
 -      struct snd_timer *timer = NULL;
 +      struct snd_timer *timer;
  
        list_for_each_entry(timer, &snd_timer_list, device_list) {
                if (timer->tmr_class != tid->dev_class)
@@@ -816,9 -816,9 +816,9 @@@ static void snd_timer_clear_callbacks(s
   * timer tasklet
   *
   */
- static void snd_timer_tasklet(unsigned long arg)
+ static void snd_timer_tasklet(struct tasklet_struct *t)
  {
-       struct snd_timer *timer = (struct snd_timer *) arg;
+       struct snd_timer *timer = from_tasklet(timer, t, task_queue);
        unsigned long flags;
  
        if (timer->card && timer->card->shutdown) {
@@@ -967,8 -967,7 +967,7 @@@ int snd_timer_new(struct snd_card *card
        INIT_LIST_HEAD(&timer->ack_list_head);
        INIT_LIST_HEAD(&timer->sack_list_head);
        spin_lock_init(&timer->lock);
-       tasklet_init(&timer->task_queue, snd_timer_tasklet,
-                    (unsigned long)timer);
+       tasklet_setup(&timer->task_queue, snd_timer_tasklet);
        timer->max_instances = 1000; /* default limit per timer */
        if (card != NULL) {
                timer->module = card->module;
@@@ -1281,8 -1280,8 +1280,8 @@@ static void snd_timer_proc_read(struct 
                list_for_each_entry(ti, &timer->open_list_head, open_list)
                        snd_iprintf(buffer, "  Client %s : %s\n",
                                    ti->owner ? ti->owner : "unknown",
 -                                  ti->flags & (SNDRV_TIMER_IFLG_START |
 -                                               SNDRV_TIMER_IFLG_RUNNING)
 +                                  (ti->flags & (SNDRV_TIMER_IFLG_START |
 +                                                SNDRV_TIMER_IFLG_RUNNING))
                                    ? "running" : "stopped");
        }
        mutex_unlock(&register_mutex);
diff --combined sound/usb/quirks-table.h
index 7fe9d3e75d591d4a0bd277d77fb5c5148a821a7b,23eafd50126f31221d4c7e98cb8fa07168d42ed4..3c1697f6b60c9774aa6496d1df9e18c0ce448a68
        .idProduct = prod, \
        .bInterfaceClass = USB_CLASS_VENDOR_SPEC
  
 -#define QUIRK_RENAME_DEVICE(_vendor, _device)                         \
 -      .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { \
 -              .vendor_name = _vendor,                                 \
 -              .product_name = _device,                                \
 -              .ifnum = QUIRK_NO_INTERFACE                             \
 -      }
 -
 -#define QUIRK_DEVICE_PROFILE(_vendor, _device, _profile)              \
 -      .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { \
 -              .vendor_name = _vendor,                                 \
 -              .product_name = _device,                                \
 -              .profile_name = _profile,                               \
 -              .ifnum = QUIRK_NO_INTERFACE                             \
 -      }
 +/* A standard entry matching with vid/pid and the audio class/subclass */
 +#define USB_AUDIO_DEVICE(vend, prod) \
 +      .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
 +                     USB_DEVICE_ID_MATCH_INT_CLASS | \
 +                     USB_DEVICE_ID_MATCH_INT_SUBCLASS, \
 +      .idVendor = vend, \
 +      .idProduct = prod, \
 +      .bInterfaceClass = USB_CLASS_AUDIO, \
 +      .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL
  
 -/* HP Thunderbolt Dock Audio Headset */
 -{
 -      USB_DEVICE(0x03f0, 0x0269),
 -      QUIRK_DEVICE_PROFILE("HP", "Thunderbolt Dock Audio Headset",
 -                           "HP-Thunderbolt-Dock-Audio-Headset"),
 -},
 -/* HP Thunderbolt Dock Audio Module */
 -{
 -      USB_DEVICE(0x03f0, 0x0567),
 -      QUIRK_DEVICE_PROFILE("HP", "Thunderbolt Dock Audio Module",
 -                           "HP-Thunderbolt-Dock-Audio-Module"),
 -},
  /* FTDI devices */
  {
        USB_DEVICE(0x0403, 0xb8d8),
        }
  },
  
 -/* Creative/E-Mu devices */
 -{
 -      USB_DEVICE(0x041e, 0x3010),
 -      QUIRK_RENAME_DEVICE("Creative Labs", "Sound Blaster MP3+")
 -},
 -/* Creative/Toshiba Multimedia Center SB-0500 */
 -{
 -      USB_DEVICE(0x041e, 0x3048),
 -      QUIRK_RENAME_DEVICE("Toshiba", "SB-0500")
 -},
 -{
 -      /* E-Mu 0202 USB */
 -      .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
 -      .idVendor = 0x041e,
 -      .idProduct = 0x3f02,
 -      .bInterfaceClass = USB_CLASS_AUDIO,
 -},
 -{
 -      /* E-Mu 0404 USB */
 -      .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
 -      .idVendor = 0x041e,
 -      .idProduct = 0x3f04,
 -      .bInterfaceClass = USB_CLASS_AUDIO,
 -},
 -{
 -      /* E-Mu Tracker Pre */
 -      .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
 -      .idVendor = 0x041e,
 -      .idProduct = 0x3f0a,
 -      .bInterfaceClass = USB_CLASS_AUDIO,
 -},
 -{
 -      /* E-Mu 0204 USB */
 -      .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
 -      .idVendor = 0x041e,
 -      .idProduct = 0x3f19,
 -      .bInterfaceClass = USB_CLASS_AUDIO,
 -},
 +/* E-Mu 0202 USB */
 +{ USB_DEVICE_VENDOR_SPEC(0x041e, 0x3f02) },
 +/* E-Mu 0404 USB */
 +{ USB_DEVICE_VENDOR_SPEC(0x041e, 0x3f04) },
 +/* E-Mu Tracker Pre */
 +{ USB_DEVICE_VENDOR_SPEC(0x041e, 0x3f0a) },
 +/* E-Mu 0204 USB */
 +{ USB_DEVICE_VENDOR_SPEC(0x041e, 0x3f19) },
  
  /*
   * HP Wireless Audio
   * Logitech QuickCam: bDeviceClass is vendor-specific, so generic interface
   * class matches do not take effect without an explicit ID match.
   */
 -{
 -      .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
 -                     USB_DEVICE_ID_MATCH_INT_CLASS |
 -                     USB_DEVICE_ID_MATCH_INT_SUBCLASS,
 -      .idVendor = 0x046d,
 -      .idProduct = 0x0850,
 -      .bInterfaceClass = USB_CLASS_AUDIO,
 -      .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL
 -},
 -{
 -      .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
 -                     USB_DEVICE_ID_MATCH_INT_CLASS |
 -                     USB_DEVICE_ID_MATCH_INT_SUBCLASS,
 -      .idVendor = 0x046d,
 -      .idProduct = 0x08ae,
 -      .bInterfaceClass = USB_CLASS_AUDIO,
 -      .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL
 -},
 -{
 -      .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
 -                     USB_DEVICE_ID_MATCH_INT_CLASS |
 -                     USB_DEVICE_ID_MATCH_INT_SUBCLASS,
 -      .idVendor = 0x046d,
 -      .idProduct = 0x08c6,
 -      .bInterfaceClass = USB_CLASS_AUDIO,
 -      .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL
 -},
 -{
 -      .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
 -                     USB_DEVICE_ID_MATCH_INT_CLASS |
 -                     USB_DEVICE_ID_MATCH_INT_SUBCLASS,
 -      .idVendor = 0x046d,
 -      .idProduct = 0x08f0,
 -      .bInterfaceClass = USB_CLASS_AUDIO,
 -      .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL
 -},
 -{
 -      .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
 -                     USB_DEVICE_ID_MATCH_INT_CLASS |
 -                     USB_DEVICE_ID_MATCH_INT_SUBCLASS,
 -      .idVendor = 0x046d,
 -      .idProduct = 0x08f5,
 -      .bInterfaceClass = USB_CLASS_AUDIO,
 -      .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL
 -},
 -{
 -      .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
 -                     USB_DEVICE_ID_MATCH_INT_CLASS |
 -                     USB_DEVICE_ID_MATCH_INT_SUBCLASS,
 -      .idVendor = 0x046d,
 -      .idProduct = 0x08f6,
 -      .bInterfaceClass = USB_CLASS_AUDIO,
 -      .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL
 -},
 -{
 -      .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
 -                     USB_DEVICE_ID_MATCH_INT_CLASS |
 -                     USB_DEVICE_ID_MATCH_INT_SUBCLASS,
 -      .idVendor = 0x046d,
 -      .idProduct = 0x0990,
 -      .bInterfaceClass = USB_CLASS_AUDIO,
 -      .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
 -      QUIRK_RENAME_DEVICE("Logitech, Inc.", "QuickCam Pro 9000")
 -},
 +{ USB_AUDIO_DEVICE(0x046d, 0x0850) },
 +{ USB_AUDIO_DEVICE(0x046d, 0x08ae) },
 +{ USB_AUDIO_DEVICE(0x046d, 0x08c6) },
 +{ USB_AUDIO_DEVICE(0x046d, 0x08f0) },
 +{ USB_AUDIO_DEVICE(0x046d, 0x08f5) },
 +{ USB_AUDIO_DEVICE(0x046d, 0x08f6) },
 +{ USB_AUDIO_DEVICE(0x046d, 0x0990) },
  
  /*
   * Yamaha devices
@@@ -2505,6 -2609,10 +2505,6 @@@ YAMAHA_DEVICE(0x7010, "UB99")
                .type = QUIRK_MIDI_STANDARD_INTERFACE
        }
  },
 -{
 -      USB_DEVICE(0x0ccd, 0x0028),
 -      QUIRK_RENAME_DEVICE("TerraTec", "Aureon5.1MkII")
 -},
  {
        USB_DEVICE(0x0ccd, 0x0035),
        .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
        }
  },
  
 -/* Stanton/N2IT Final Scratch v1 device ('Scratchamp') */
 -{
 -      USB_DEVICE(0x103d, 0x0100),
 -      QUIRK_RENAME_DEVICE("Stanton", "ScratchAmp")
 -},
 -{
 -      USB_DEVICE(0x103d, 0x0101),
 -      QUIRK_RENAME_DEVICE("Stanton", "ScratchAmp")
 -},
 -
  /* Novation EMS devices */
  {
        USB_DEVICE_VENDOR_SPEC(0x1235, 0x0001),
        }
  },
  
 -/* */
 -{
 -      /* aka. Serato Scratch Live DJ Box */
 -      USB_DEVICE(0x13e5, 0x0001),
 -      QUIRK_RENAME_DEVICE("Rane", "SL-1")
 -},
 -
  /* Lenovo ThinkStation P620 Rear Line-in, Line-out and Microphone */
  {
        USB_DEVICE(0x17aa, 0x1046),
        .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
 -              .vendor_name = "Lenovo",
 -              .product_name = "ThinkStation P620 Rear",
 -              .profile_name = "Lenovo-ThinkStation-P620-Rear",
                .ifnum = QUIRK_ANY_INTERFACE,
                .type = QUIRK_SETUP_DISABLE_AUTOSUSPEND
        }
  {
        USB_DEVICE(0x17aa, 0x104d),
        .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
 -              .vendor_name = "Lenovo",
 -              .product_name = "ThinkStation P620 Main",
 -              .profile_name = "Lenovo-ThinkStation-P620-Main",
                .ifnum = QUIRK_ANY_INTERFACE,
                .type = QUIRK_SETUP_DISABLE_AUTOSUSPEND
        }
  },
  
  /* KeithMcMillen Stringport */
 -{
 -      USB_DEVICE(0x1f38, 0x0001),
 -      .bInterfaceClass = USB_CLASS_AUDIO,
 -},
 +{ USB_DEVICE(0x1f38, 0x0001) }, /* FIXME: should be more restrictive matching */
  
  /* Miditech devices */
  {
   */
  
  #define AU0828_DEVICE(vid, pid, vname, pname) { \
 -      .idVendor = vid, \
 -      .idProduct = pid, \
 -      .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
 -                     USB_DEVICE_ID_MATCH_INT_CLASS | \
 -                     USB_DEVICE_ID_MATCH_INT_SUBCLASS, \
 -      .bInterfaceClass = USB_CLASS_AUDIO, \
 -      .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, \
 +      USB_AUDIO_DEVICE(vid, pid), \
        .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { \
                .vendor_name = vname, \
                .product_name = pname, \
@@@ -2809,7 -2949,13 +2809,7 @@@ AU0828_DEVICE(0x2040, 0x7270, "Hauppaug
  
  /* Syntek STK1160 */
  {
 -      .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
 -                     USB_DEVICE_ID_MATCH_INT_CLASS |
 -                     USB_DEVICE_ID_MATCH_INT_SUBCLASS,
 -      .idVendor = 0x05e1,
 -      .idProduct = 0x0408,
 -      .bInterfaceClass = USB_CLASS_AUDIO,
 -      .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
 +      USB_AUDIO_DEVICE(0x05e1, 0x0408),
        .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
                .vendor_name = "Syntek",
                .product_name = "STK1160",
  },
  {
        /* Tascam US122 MKII - playback-only support */
 -      .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
 -      .idVendor = 0x0644,
 -      .idProduct = 0x8021,
 -      .bInterfaceClass = USB_CLASS_AUDIO,
 +      USB_DEVICE_VENDOR_SPEC(0x0644, 0x8021),
        .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
                .vendor_name = "TASCAM",
                .product_name = "US122 MKII",
        }
  },
  
 -/*
 - * The original product_name is "USB Sound Device", however this name
 - * is also used by the CM106 based cards, so make it unique.
 - */
 -{
 -      USB_DEVICE(0x0d8c, 0x0102),
 -      QUIRK_RENAME_DEVICE(NULL, "ICUSBAUDIO7D")
 -},
 -{
 -      USB_DEVICE(0x0d8c, 0x0103),
 -      QUIRK_RENAME_DEVICE(NULL, "Audio Advantage MicroII")
 -},
 -
  /* disabled due to regression for other devices;
   * see https://bugzilla.kernel.org/show_bug.cgi?id=199905
   */
                }
        }
  },
 -/* Dell WD15 Dock */
 -{
 -      USB_DEVICE(0x0bda, 0x4014),
 -      QUIRK_DEVICE_PROFILE("Dell", "WD15 Dock", "Dell-WD15-Dock")
 -},
  /* Dell WD19 Dock */
  {
        USB_DEVICE(0x0bda, 0x402e),
        .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
 -              .vendor_name = "Dell",
 -              .product_name = "WD19 Dock",
 -              .profile_name = "Dell-WD15-Dock",
                .ifnum = QUIRK_ANY_INTERFACE,
                .type = QUIRK_SETUP_FMT_AFTER_RESUME
        }
  {
        /*
         * Pioneer DJ DJM-250MK2
-        * PCM is 8 channels out @ 48 fixed (endpoints 0x01).
-        * The output from computer to the mixer is usable.
+        * PCM is 8 channels out @ 48 fixed (endpoint 0x01)
+        * and 8 channels in @ 48 fixed (endpoint 0x82).
         *
-        * The input (phono or line to computer) is not working.
-        * It should be at endpoint 0x82 and probably also 8 channels,
-        * but it seems that it works only with Pioneer proprietary software.
-        * Even on officially supported OS, the Audacity was unable to record
-        * and Mixxx to recognize the control vinyls.
+        * Both playback and recording is working, even simultaneously.
+        *
+        * Playback channels could be mapped to:
+        *  - CH1
+        *  - CH2
+        *  - AUX
+        *
+        * Recording channels could be mapped to:
+        *  - Post CH1 Fader
+        *  - Post CH2 Fader
+        *  - Cross Fader A
+        *  - Cross Fader B
+        *  - MIC
+        *  - AUX
+        *  - REC OUT
+        *
+        * There is remaining problem with recording directly from PHONO/LINE.
+        * If we map a channel to:
+        *  - CH1 Control Tone PHONO
+        *  - CH1 Control Tone LINE
+        *  - CH2 Control Tone PHONO
+        *  - CH2 Control Tone LINE
+        * it is silent.
+        * There is no signal even on other operating systems with official drivers.
+        * The signal appears only when a supported application is started.
+        * This needs to be investigated yet...
+        * (there is quite a lot communication on the USB in both directions)
+        *
+        * In current version this mixer could be used for playback
+        * and for recording from vinyls (through Post CH* Fader)
+        * but not for DVS (Digital Vinyl Systems) like in Mixxx.
         */
        USB_DEVICE_VENDOR_SPEC(0x2b73, 0x0017),
        .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
                                        .rate_max = 48000,
                                        .nr_rates = 1,
                                        .rate_table = (unsigned int[]) { 48000 }
+                                       }
+                       },
+                       {
+                               .ifnum = 0,
+                               .type = QUIRK_AUDIO_FIXED_ENDPOINT,
+                               .data = &(const struct audioformat) {
+                                       .formats = SNDRV_PCM_FMTBIT_S24_3LE,
+                                       .channels = 8, // inputs
+                                       .iface = 0,
+                                       .altsetting = 1,
+                                       .altset_idx = 1,
+                                       .endpoint = 0x82,
+                                       .ep_attr = USB_ENDPOINT_XFER_ISOC|
+                                               USB_ENDPOINT_SYNC_ASYNC|
+                                               USB_ENDPOINT_USAGE_IMPLICIT_FB,
+                                       .rates = SNDRV_PCM_RATE_48000,
+                                       .rate_min = 48000,
+                                       .rate_max = 48000,
+                                       .nr_rates = 1,
+                                       .rate_table = (unsigned int[]) { 48000 }
                                }
                        },
                        {
        }
  },
  
 -#define ALC1220_VB_DESKTOP(vend, prod) { \
 -      USB_DEVICE(vend, prod), \
 -      QUIRK_DEVICE_PROFILE("Realtek", "ALC1220-VB-DT", \
 -                           "Realtek-ALC1220-VB-Desktop") \
 -}
 -ALC1220_VB_DESKTOP(0x0414, 0xa002), /* Gigabyte TRX40 Aorus Pro WiFi */
 -ALC1220_VB_DESKTOP(0x0db0, 0x0d64), /* MSI TRX40 Creator */
 -ALC1220_VB_DESKTOP(0x0db0, 0x543d), /* MSI TRX40 */
 -ALC1220_VB_DESKTOP(0x26ce, 0x0a01), /* Asrock TRX40 Creator */
 -#undef ALC1220_VB_DESKTOP
 -
 -/* Two entries for Gigabyte TRX40 Aorus Master:
 - * TRX40 Aorus Master has two USB-audio devices, one for the front headphone
 - * with ESS SABRE9218 DAC chip, while another for the rest I/O (the rear
 - * panel and the front mic) with Realtek ALC1220-VB.
 - * Here we provide two distinct names for making UCM profiles easier.
 - */
 -{
 -      USB_DEVICE(0x0414, 0xa000),
 -      QUIRK_DEVICE_PROFILE("Gigabyte", "Aorus Master Front Headphone",
 -                           "Gigabyte-Aorus-Master-Front-Headphone")
 -},
 -{
 -      USB_DEVICE(0x0414, 0xa001),
 -      QUIRK_DEVICE_PROFILE("Gigabyte", "Aorus Master Main Audio",
 -                           "Gigabyte-Aorus-Master-Main-Audio")
 -},
  {
        /*
         * Pioneer DJ DJM-900NXS2
   * channels to be swapped and out of phase, which is dealt with in quirks.c.
   */
  {
 -      .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
 -                     USB_DEVICE_ID_MATCH_INT_CLASS |
 -                     USB_DEVICE_ID_MATCH_INT_SUBCLASS,
 -      .idVendor = 0x534d,
 -      .idProduct = 0x2109,
 -      .bInterfaceClass = USB_CLASS_AUDIO,
 -      .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
 +      USB_AUDIO_DEVICE(0x534d, 0x2109),
        .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
                .vendor_name = "MacroSilicon",
                .product_name = "MS2109",
  },
  
  #undef USB_DEVICE_VENDOR_SPEC
 +#undef USB_AUDIO_DEVICE