Message ID | 20230519093114.28813-15-tiwai@suse.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1103385vqo; Fri, 19 May 2023 02:37:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ZVJYNd7eSP45ymxZg2Oe6hIpoFCSDXn9r8Je9qCJZJOhrkugDqazPPkRyC+Uh1I9tY4Jl X-Received: by 2002:a05:6a20:e185:b0:ec:e5bb:1bc4 with SMTP id ks5-20020a056a20e18500b000ece5bb1bc4mr1491390pzb.6.1684489060799; Fri, 19 May 2023 02:37:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684489060; cv=none; d=google.com; s=arc-20160816; b=Ut+wAO311+zEfJx/PFXtsYbcJ4qq12qhfA9eP5g+IGTBWZCw/TPIerwrurrWB0KSws s2dVBqr6DZagHABNKOxd0ne9kWsZqIIxStojzHX5g+hHu8I6dhOeAhgI/SIUF6VDuPei Asjwqinf0Dwuz6QBLlSnkHPyPnw3QN0jxkFP/iejfoNo5FGYme6WD7inlkIXyW7CeQjK AbO1Gl+RMqDLTG0Xfx/VBfwbDILEFfoTQwcLf6ZKGVIg69jEyFfv0tSCLZN1E5eggyix uQOAKF9HKdkdfpTlCwREutFKKT7UbMouxmdJHnHTU7vbYJggcj2t/tJVGLI304UIEn9D 2mQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=/xY1PXIKgQoKZfhDbEDsNHHq6OQlJxBtxfki3i8O/8I=; b=B9dx5K84uKXFRsv0KXEzt3a+BZtA8DwDstwmQfrDqWDhkdV/JPm68ml/oo+FFludJU gbqKmAnaotCDdh1n27BJjJacJj9eJGb3Ar0DVOqo29dy6/EFBmizegJd27YwXn1MO/kz VfRByr7ReVbraV7cOI207qia9ecdvjplkwi2phK34masJtY1zG89Yc7w3YRJKb80T1gb ymrim1p7s7hGpdoep7VmRENFeTCGH76NII4yWZB+3ZXx6HrCUOdEgl0C0uR1gEvHGDOZ Nw69BphKh2RlABukcdKPNYv3vNHMO6AXtXAHgEKv3jLdo+B2my3fmnLOKah/8LmVWQXX FJJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="JE9gSUd/"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h192-20020a636cc9000000b00517aa9db92dsi3418549pgc.396.2023.05.19.02.37.22; Fri, 19 May 2023 02:37:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="JE9gSUd/"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231613AbjESJcS (ORCPT <rfc822;wlfightup@gmail.com> + 99 others); Fri, 19 May 2023 05:32:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231486AbjESJbm (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 19 May 2023 05:31:42 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F6ABE75 for <linux-kernel@vger.kernel.org>; Fri, 19 May 2023 02:31:40 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 9B7C41FE3D; Fri, 19 May 2023 09:31:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684488698; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/xY1PXIKgQoKZfhDbEDsNHHq6OQlJxBtxfki3i8O/8I=; b=JE9gSUd/2Z0GCV3yULP+OP35bx1YeVcmky1+aocFqxQi4Rp84z6uoETDMbnlxXflqGpI4D tXhnfjfU1TIu/0MYsIVxOGZHBugPlmwcpSVy2AENcZ/yJ4B22HZCcwMj/RVVYqjgCXWCL7 Hsd9qRGhXHBofvnjfSwjFllZ9sr6CgE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684488698; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/xY1PXIKgQoKZfhDbEDsNHHq6OQlJxBtxfki3i8O/8I=; b=WmJIhMPZgi2CKwleYTaKJlxX0lv706rEobLQTKShNbtzZ8lU1rkGwdE5zJcp7vbmubwYIL u38d9bL5Jg+gjfDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7BADE13A12; Fri, 19 May 2023 09:31:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id EEtGHfpBZ2RXJAAAMHmgww (envelope-from <tiwai@suse.de>); Fri, 19 May 2023 09:31:38 +0000 From: Takashi Iwai <tiwai@suse.de> To: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 14/36] ALSA: usb-audio: Enable the legacy raw MIDI support Date: Fri, 19 May 2023 11:30:52 +0200 Message-Id: <20230519093114.28813-15-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230519093114.28813-1-tiwai@suse.de> References: <20230519093114.28813-1-tiwai@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766314801107715485?= X-GMAIL-MSGID: =?utf-8?q?1766314801107715485?= |
Series |
ALSA: Add MIDI 2.0 support
|
|
Commit Message
Takashi Iwai
May 19, 2023, 9:30 a.m. UTC
Attach the legacy rawmidi devices when enabled in Kconfig accordingly.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/usb/midi2.c | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/sound/usb/midi2.c b/sound/usb/midi2.c index 3502a4b7fa41..f005de9f9b8a 100644 --- a/sound/usb/midi2.c +++ b/sound/usb/midi2.c @@ -856,6 +856,25 @@ static int create_blocks_from_gtb(struct snd_usb_midi2_interface *umidi) return 0; } +/* attach legacy rawmidis */ +static int attach_legacy_rawmidi(struct snd_usb_midi2_interface *umidi) +{ +#if IS_ENABLED(CONFIG_SND_UMP_LEGACY_RAWMIDI) + struct snd_usb_midi2_ump *rmidi; + int err; + + list_for_each_entry(rmidi, &umidi->rawmidi_list, list) { + err = snd_ump_attach_legacy_rawmidi(rmidi->ump, + "Legacy MIDI", + umidi->chip->num_rawmidis); + if (err < 0) + return err; + umidi->chip->num_rawmidis++; + } +#endif + return 0; +} + static void snd_usb_midi_v2_free(struct snd_usb_midi2_interface *umidi) { free_all_midi2_endpoints(umidi); @@ -921,7 +940,7 @@ static int parse_midi_2_0(struct snd_usb_midi2_interface *umidi) } } - return 0; + return attach_legacy_rawmidi(umidi); } /* is the given interface for MIDI 2.0? */ @@ -990,6 +1009,12 @@ static void set_fallback_rawmidi_names(struct snd_usb_midi2_interface *umidi) usb_string(dev, dev->descriptor.iSerialNumber, ump->info.product_id, sizeof(ump->info.product_id)); +#if IS_ENABLED(CONFIG_SND_UMP_LEGACY_RAWMIDI) + if (ump->legacy_rmidi && !*ump->legacy_rmidi->name) + snprintf(ump->legacy_rmidi->name, + sizeof(ump->legacy_rmidi->name), + "%s (MIDI 1.0)", ump->info.name); +#endif } }