From patchwork Tue Jun 4 10:10:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Simion X-Patchwork-Id: 13685013 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6B34DC25B78 for ; Tue, 4 Jun 2024 10:11:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=FqAkgWvjVEiPS49G0nCTyoNiUJN7yBCHwDW1iYMvi4Y=; b=1FL9fmIhMq0GC+ CoU260C69Uic6lbsOdV4lHEbMN/xeoeqJQA7WcJ2lIn0ng6Gxpj7UI40+3SI1ZNd1pia1Z8Dv7kWd SkbImbxlp7IK75Z4Zx7+2KFptm/YH08olH53jj+M1G4qlaM2BEJsys/8IRLZwpBwLb+9v8jS5gcgR KQRzpgnxVhi6MHpvSZCvN2DRM4krwkl3bi/Yq21pEpyiX+cxi5Y0+iO/EDooUqMTz9/FPUxrUx2U8 0ffYDcqrP3p/qjHyHLBHcbP0lzuWaUhVIRvgniwBhHqQfuoDqMuM20e6l9VAK4DzYAtr0M1JEDP0j pn9ftrq0/+XPDKkPjuNw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sER8j-00000001xMc-00a4; Tue, 04 Jun 2024 10:11:37 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sER8f-00000001xM9-2epO for linux-arm-kernel@lists.infradead.org; Tue, 04 Jun 2024 10:11:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1717495894; x=1749031894; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=C9QZlpACMYy1Zfnu2NImSG8I/J6FWYhPgPQBtPiN+aM=; b=0iLrKx3GdhBNFIckFdVsQYCM2UkwT0/UkPy8mazvN7cXvfRZ0oNgELxD AfRmjVd6pIbL4iStdPX5ChjKstyBScPr4uL26RBlyItG8P+oUbZPPBE8n 91vays3wBUR6uVnF/aFfZKOgE019Su1TcLHlnuTDYwkQ2TG3XDTIKuDbi Y0ZLsG09Fo15h9e93MzHAiDHXkBMS3vkoL7TVvisv+XJktHH80RnwWsGY bOde2yPLZ4wl0JuaMBV7rleNF3f9e28aY4edv0/AfDImyd9hHGeyxQX8L qc1U/fhgNcwv5xqrI/IY4RpXOm8/jaJUh7AsDOKyURTm+lCQPm0xX3QEl A==; X-CSE-ConnectionGUID: wEzRrHHTQXqTSqyPNngmpw== X-CSE-MsgGUID: VmTWgr6UT6GmI5MeZ9Sbbw== X-IronPort-AV: E=Sophos;i="6.08,213,1712646000"; d="scan'208";a="257789211" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 Jun 2024 03:11:30 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 4 Jun 2024 03:10:49 -0700 Received: from ROB-ULT-M76677.microchip.com (10.10.85.11) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Tue, 4 Jun 2024 03:10:47 -0700 From: Andrei Simion To: , , , , , , , CC: , , , , Andrei Simion Subject: [PATCH] ASoC: atmel: atmel-classd: Re-add dai_link->platform to fix card init Date: Tue, 4 Jun 2024 13:10:30 +0300 Message-ID: <20240604101030.237792-1-andrei.simion@microchip.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240604_031133_815929_D794652C X-CRM114-Status: UNSURE ( 9.70 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The removed dai_link->platform component cause a fail which is exposed at runtime. (ex: when a sound tool is used) This patch re-adds the dai_link->platform component to have a full card registered. Before this patch: :~$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: CLASSD [CLASSD], device 0: CLASSD PCM snd-soc-dummy-dai-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 :~$ speaker-test -t sine speaker-test 1.2.6 Playback device is default Stream parameters are 48000Hz, S16_LE, 1 channels Sine wave rate is 440.0000Hz Playback open error: -22,Invalid argument After this patch which restores the platform component: :~$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: CLASSD [CLASSD], device 0: CLASSD PCM snd-soc-dummy-dai-0 [CLASSD PCM snd-soc-dummy-dai-0] Subdevices: 1/1 Subdevice #0: subdevice #0 -> Resolve the playback error. Fixes: 2f650f87c03c ("ASoC: atmel: remove unnecessary dai_link->platform") Signed-off-by: Andrei Simion Acked-by: Kuninori Morimoto --- sound/soc/atmel/atmel-classd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sound/soc/atmel/atmel-classd.c b/sound/soc/atmel/atmel-classd.c index 6aed1ee443b4..ba314b279919 100644 --- a/sound/soc/atmel/atmel-classd.c +++ b/sound/soc/atmel/atmel-classd.c @@ -473,19 +473,22 @@ static int atmel_classd_asoc_card_init(struct device *dev, if (!dai_link) return -ENOMEM; - comp = devm_kzalloc(dev, sizeof(*comp), GFP_KERNEL); + comp = devm_kzalloc(dev, 2 * sizeof(*comp), GFP_KERNEL); if (!comp) return -ENOMEM; - dai_link->cpus = comp; + dai_link->cpus = &comp[0]; dai_link->codecs = &snd_soc_dummy_dlc; + dai_link->platforms = &comp[1]; dai_link->num_cpus = 1; dai_link->num_codecs = 1; + dai_link->num_platforms = 1; dai_link->name = "CLASSD"; dai_link->stream_name = "CLASSD PCM"; dai_link->cpus->dai_name = dev_name(dev); + dai_link->platforms->name = dev_name(dev); card->dai_link = dai_link; card->num_links = 1;