Received: by 2002:a05:7208:2202:b0:86:316c:7444 with SMTP id s2csp2363486rbb; Tue, 4 Jun 2024 03:11:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX8n1Vv9uFACPWq/LlX3JedIcxZ1ieQJzNqWS3VeKuC+/SMmshiFxTIeFB/oOkkeX1qVzEj+TQIxVcW5N9Em+NFOCuBFqRlt1KXeQ11oQ== X-Google-Smtp-Source: AGHT+IHwZmSEFWj7E8hGDYr2hP4nJcormZzHd2ZIvoovD/8kIEGRTl5DkwKexqD5M63b264YsyDi X-Received: by 2002:a17:902:e5c8:b0:1f6:1a86:37ba with SMTP id d9443c01a7336-1f6936abf5fmr36356505ad.2.1717495916452; Tue, 04 Jun 2024 03:11:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717495916; cv=pass; d=google.com; s=arc-20160816; b=SDMM87xgWq/lkwJ5CZM6ur35iDnq1HqBOZa6LLW2qC/0wzhkK1/4Iq0XnvxXlAGiNV n9PUmT3H4qxNhMlFfMYC9FRuA5k+BiKNaNHBjuUrlBAwmwLoTYOh3EbrQR0Enfb884dB a0fHHWATnkG+oCTF0Sl8yaERLbaWQEJaygfk8EgOumTqA9g7hBxTbh4L02XxEXhs/Zig j2ya1C7PHq+/FTLDzfRF13MlupX5j1Yk0YxaiLA3habCv1QtEYMcGxqV4vMU9Oo59Iam C/Pcd51+8OpjVKbepTF/ffPMmLgWsebJfNsvlyNi9Rf7iwn4fDFK/k4phpsWgSKPUFn2 Z0bQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=srFdyHmG+eVSJSeNpByYYVG11HoAPJuwu3sS/fuSBxI=; fh=2/x1ZdkVHbPgJBel6rJ6ohx974inUJtoWr4OtYY+ZGw=; b=J7M6j+MbZPV9cn92UlhUw29KVLxQotPOkI7Ruvi7muKNZWsvxaOhF/tlLv5GRQhk+e n42H0VWVPIhSQJgj0Kf20GFY+EiUyqY9OAC/IGFI6IhEIBRho+pNwnqOx02nWzVDFqG7 dGKvd0J97xi4dxhMz3QbHEM2d1TiNmnHqLZ503rpJH0BrmOCZoL9LLm50ivk/l+JRSeh ypezOV3HartaRGCSio1nGECy+NgVgWoMjKc4tJSSGCqLpO1D0faq6cQrN3lfm3wZMBqx AC3byEoLX/uNALuSyAXRkz7tx9gi7nhMznJJowqj5rmi29cEUih2yykLK7OSfVyprExz F67g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=E+DvwRIS; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-200404-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200404-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6324173e2si80176365ad.583.2024.06.04.03.11.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 03:11:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200404-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=E+DvwRIS; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-200404-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200404-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 55E49283DAB for ; Tue, 4 Jun 2024 10:11:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5CA86144D10; Tue, 4 Jun 2024 10:11:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="E+DvwRIS" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 526D0143C7B; Tue, 4 Jun 2024 10:11:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717495899; cv=none; b=nBaZYB+h0Tqj1GjG+WieQgBzBmOZ1cvwNkyd52dydCWZCCF6DORVXIw61YcrGEvuZn+a5sdYRl4OeBEXRUQzfrq2h4TG1ogSiqeck3wW0ceocOJD1jPHdFByKuqQWa4fPc6IZPT90PZXUoUdfgK2E/fFpy5wgnHhDUoPCQKEQXE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717495899; c=relaxed/simple; bh=C9QZlpACMYy1Zfnu2NImSG8I/J6FWYhPgPQBtPiN+aM=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=NIvKm2GOmUg34V61BNa6gqXWwMrsVQLcgO81xICclx11PGK/aJBNc8DvY8EZbkDqsh/R7n+GyjwfGXOYwKTP6dlOq4LIVJP/XbL5b3YLxY3He09+1jnbxMqBuBDilamxVhLYd7WbXybZAyPE6zfqlBKXlmiNiV4ah2ptBK5sFtU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=E+DvwRIS; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1717495898; x=1749031898; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=C9QZlpACMYy1Zfnu2NImSG8I/J6FWYhPgPQBtPiN+aM=; b=E+DvwRISWsIp+FV/u1kORVbvpHp2sBvN7oIIjGDxK+46ugBXY7bNHKSC 3OK5wYRj9WMWmb55fBFjc2JLq3Ic9PoIN4fhu4sLAzIp5wJJz778SLIMM BIfwPYIfYQdHd57TptjkCwCIvTfhKYbBML10zW9EphJjmcu6oYz1IulfU 7jAYmgrdgatau5DUvjlcBAEkV8a/XzPfqiUmFA1JSzDfUkCFIrCl13aM8 3hcUj0+JimlYaC00p/s0TIaPDxhjyCwcSoaVOip9SRomyAFJ9ff3qshWD mhT6LpS/XluSbdbvQYOFuC1QNNF71/yZ+6s0c496IHE6ZmKLPzzozVCx1 w==; 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 --- 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; -- 2.34.1