From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A7E8C433B4 for ; Wed, 5 May 2021 16:56:00 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B05B2613F3 for ; Wed, 5 May 2021 16:55:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B05B2613F3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 386341792; Wed, 5 May 2021 18:55:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 386341792 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1620233756; bh=L40hcuFjXBEMwH8EYrimSoIFlROA8Eps/UJXGasiQKI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=P8cG+OpNx1+CNXGFvgcM9mvSygc6YkJrw7J8ge52BfbOej9Ncn9rlJISkgJN3hPoP kfDZZsCGh4+zRcKJViTVjvzWvhi3u39oy3ZJN2bpKUnnlNmZSNGRajpHfERvoYsqOB yH9S0RksWiTYvmQsl9NEo5ip9TJxLX1u8U2VqEIo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 437F6F8051A; Wed, 5 May 2021 18:39:18 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B7A8BF8062D; Wed, 5 May 2021 18:39:16 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 68857F8032C for ; Wed, 5 May 2021 18:39:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 68857F8032C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kmaQ4jsZ" Received: by mail.kernel.org (Postfix) with ESMTPSA id 2208861993; Wed, 5 May 2021 16:39:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620232750; bh=L40hcuFjXBEMwH8EYrimSoIFlROA8Eps/UJXGasiQKI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kmaQ4jsZa46MouDYprhL4oPdd31Ef9LG/brg2JIAyl0QhALMXUpJzq7ELZYM44nrj qKt81WfPyEH6NsSc2Zr09fGJn5ExNVZ1LykklOz9AL3pYCV9KnH7x2PFHPSKdzczs7 mUQoEvMUELfspq8hDPlBgbZmgbn/GgJaWXgcWlpCtYsPHsi6Ik7isrHX2xUtUQBhyM nFp8Xx0NF7GR69HTQ+eueyeag5jz6ZAHgQF1BP5/y7MA/yl4bBkk9OZEdKv7WWttoJ 67aackvFHU4eso0TTmSWmQwcN7wPxuW33qgkaqiuhJfkXYJ0dLUieSJt50Z08WsNvN 4umDgROzDIQVg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 10/46] ALSA: bebob: enable to deliver MIDI messages for multiple ports Date: Wed, 5 May 2021 12:38:20 -0400 Message-Id: <20210505163856.3463279-10-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210505163856.3463279-1-sashal@kernel.org> References: <20210505163856.3463279-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Cc: Takashi Iwai , Sasha Levin , alsa-devel@alsa-project.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Takashi Sakamoto [ Upstream commit d2b6f15bc18ac8fbce25398290774c21f5b2cd44 ] Current implementation of bebob driver doesn't correctly handle the case that the device has multiple MIDI ports. The cause is the number of MIDI conformant data channels is passed to AM824 data block processing layer. This commit fixes the bug. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20210321032831.340278-4-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/firewire/bebob/bebob_stream.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c index ce07ea0d4e71..3935e90c8e8f 100644 --- a/sound/firewire/bebob/bebob_stream.c +++ b/sound/firewire/bebob/bebob_stream.c @@ -534,20 +534,22 @@ int snd_bebob_stream_init_duplex(struct snd_bebob *bebob) static int keep_resources(struct snd_bebob *bebob, struct amdtp_stream *stream, unsigned int rate, unsigned int index) { - struct snd_bebob_stream_formation *formation; + unsigned int pcm_channels; + unsigned int midi_ports; struct cmp_connection *conn; int err; if (stream == &bebob->tx_stream) { - formation = bebob->tx_stream_formations + index; + pcm_channels = bebob->tx_stream_formations[index].pcm; + midi_ports = bebob->midi_input_ports; conn = &bebob->out_conn; } else { - formation = bebob->rx_stream_formations + index; + pcm_channels = bebob->rx_stream_formations[index].pcm; + midi_ports = bebob->midi_output_ports; conn = &bebob->in_conn; } - err = amdtp_am824_set_parameters(stream, rate, formation->pcm, - formation->midi, false); + err = amdtp_am824_set_parameters(stream, rate, pcm_channels, midi_ports, false); if (err < 0) return err; -- 2.30.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE62DC468C6 for ; Wed, 5 May 2021 17:05:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E591A61042 for ; Wed, 5 May 2021 17:05:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238273AbhEERF1 (ORCPT ); Wed, 5 May 2021 13:05:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:47764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236079AbhEEQ4f (ORCPT ); Wed, 5 May 2021 12:56:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2208861993; Wed, 5 May 2021 16:39:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620232750; bh=L40hcuFjXBEMwH8EYrimSoIFlROA8Eps/UJXGasiQKI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kmaQ4jsZa46MouDYprhL4oPdd31Ef9LG/brg2JIAyl0QhALMXUpJzq7ELZYM44nrj qKt81WfPyEH6NsSc2Zr09fGJn5ExNVZ1LykklOz9AL3pYCV9KnH7x2PFHPSKdzczs7 mUQoEvMUELfspq8hDPlBgbZmgbn/GgJaWXgcWlpCtYsPHsi6Ik7isrHX2xUtUQBhyM nFp8Xx0NF7GR69HTQ+eueyeag5jz6ZAHgQF1BP5/y7MA/yl4bBkk9OZEdKv7WWttoJ 67aackvFHU4eso0TTmSWmQwcN7wPxuW33qgkaqiuhJfkXYJ0dLUieSJt50Z08WsNvN 4umDgROzDIQVg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Takashi Sakamoto , Takashi Iwai , Sasha Levin , alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.4 10/46] ALSA: bebob: enable to deliver MIDI messages for multiple ports Date: Wed, 5 May 2021 12:38:20 -0400 Message-Id: <20210505163856.3463279-10-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210505163856.3463279-1-sashal@kernel.org> References: <20210505163856.3463279-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Sakamoto [ Upstream commit d2b6f15bc18ac8fbce25398290774c21f5b2cd44 ] Current implementation of bebob driver doesn't correctly handle the case that the device has multiple MIDI ports. The cause is the number of MIDI conformant data channels is passed to AM824 data block processing layer. This commit fixes the bug. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20210321032831.340278-4-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/firewire/bebob/bebob_stream.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c index ce07ea0d4e71..3935e90c8e8f 100644 --- a/sound/firewire/bebob/bebob_stream.c +++ b/sound/firewire/bebob/bebob_stream.c @@ -534,20 +534,22 @@ int snd_bebob_stream_init_duplex(struct snd_bebob *bebob) static int keep_resources(struct snd_bebob *bebob, struct amdtp_stream *stream, unsigned int rate, unsigned int index) { - struct snd_bebob_stream_formation *formation; + unsigned int pcm_channels; + unsigned int midi_ports; struct cmp_connection *conn; int err; if (stream == &bebob->tx_stream) { - formation = bebob->tx_stream_formations + index; + pcm_channels = bebob->tx_stream_formations[index].pcm; + midi_ports = bebob->midi_input_ports; conn = &bebob->out_conn; } else { - formation = bebob->rx_stream_formations + index; + pcm_channels = bebob->rx_stream_formations[index].pcm; + midi_ports = bebob->midi_output_ports; conn = &bebob->in_conn; } - err = amdtp_am824_set_parameters(stream, rate, formation->pcm, - formation->midi, false); + err = amdtp_am824_set_parameters(stream, rate, pcm_channels, midi_ports, false); if (err < 0) return err; -- 2.30.2