Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp345431lqp; Tue, 11 Jun 2024 06:28:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWzOB28Io8YRSq5Nh0ojx5iE8TYefXK8Lg6CIhwlUUs3xvWQgXUY+jRRbTN38lQnAtwKveKXmR09YwtBWYClf80zxU91yEMBcckKb/GSQ== X-Google-Smtp-Source: AGHT+IFMb1/05zgvQkzECXppAHN/yjTi76Msdm/2iYlv9iPZetClAHaMIgdrIp/diQ4eQLAkp7zs X-Received: by 2002:a05:620a:294b:b0:797:9949:a02e with SMTP id af79cd13be357-7979949a18fmr405902885a.9.1718112480434; Tue, 11 Jun 2024 06:28:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718112480; cv=pass; d=google.com; s=arc-20160816; b=EQUadT65aAHRVUmFhcPPQo4r3bx/6Fbn8yM0RculeBPIgaLdIlRt7//gYSTeFFVWHG psGrgylcxlaayW3IY0hCrSkwX8kn+JYXhaTuQLweeO3y4xNrPRNRVes4EVKEP0n/infc Y/ba3gibj74Pvt9xhDCDARFJcM4VC1W3PsdSd3huGoYQjcbRARfGpS0dncMO758gVl1G dBUfedAAwA0ce4fVFkAh7xLIyoaVyvBycGdtHh7Zq5I1O3AEiqCpVSfK4iJYGVujpyBV Q5wyDp07zZLEx67ho1MA/M2uT/6W832SNdGeiKlIYxd2JtxYjxPI43D/Sj3txtyEPnSa 9j+g== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=bY/YYO0JK9L565n9PzZjzHjTXNAAU0kC6wTI1GzcH0w=; fh=SdIMFJ1y/X9wD0XNQ5Mz16VioyAptPvPBDK62umWZ90=; b=pSbObX5psm0OMMsYer6RfLumaHABi6EU2mx80ySQHB+NaZXBZJaJ/BIksdL5bsgEtZ vcfNHAev3PHfO5LkEyxs/HGoRzomCOgAKuW+d5INmYDllGDpl7zp0nt3WNgCZyBcFXpS /79lsCCtEwlRFHc62vjSAvyX0YXA01uLSVFlGKTaX2cdMSnW2HqxW9r47BYY56B+IjMi L+2/6jB23BYZSCZVqBZVCzLgZ9hxiCZsqwD6pxVk/HK+p92ZnMG9E40nXGk4T7qsIbtt HPcHB5M70/FI0haYwDBDuNHM6i+Kr1uWMRvxVsWg3cf8UzSR3q3KGXMYd/wDVSBhMpF7 UCUw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=WwcsRWRV; arc=pass (i=1 spf=pass spfdomain=opensource.cirrus.com dkim=pass dkdomain=cirrus.com dmarc=pass fromdomain=opensource.cirrus.com); spf=pass (google.com: domain of linux-kernel+bounces-209947-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209947-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-7955b9b8851si675185285a.114.2024.06.11.06.28.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 06:28:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209947-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=WwcsRWRV; arc=pass (i=1 spf=pass spfdomain=opensource.cirrus.com dkim=pass dkdomain=cirrus.com dmarc=pass fromdomain=opensource.cirrus.com); spf=pass (google.com: domain of linux-kernel+bounces-209947-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209947-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 445E41C2411C for ; Tue, 11 Jun 2024 13:27:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE0D917CA12; Tue, 11 Jun 2024 13:26:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="WwcsRWRV" Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (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 8238C17D358; Tue, 11 Jun 2024 13:26:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.152.168 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718112364; cv=none; b=htS6RKCEormN41BVYecSf7or3Fqe/QW//M7eWKreBDXk2Lh8APUwnEt8XkVK9jmG05W/2cZIjya2n3Tp2bH0NyT9pE1Rzbx1j8bMgRhlTs6+pbkKZETn1xrpJTlMOZ4AHiazq2WrTaJ7AzjOBfFwwcep5h3Kl4atdZhOl1eFqV4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718112364; c=relaxed/simple; bh=08k+wAcbql/lsu9rymmUxtWIFDkESLOMHf5F/uImiHc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=d83Bp7SwmCyJykqqDb1+7nnINRZEk0KiU6SRkwzucp+GM36hmj7oT6yfW95hCTfn0ZJ1Wm1Ys6uZq0RV9kqUGvLiT193HvDbysqO0ltWjdj7g0ZX7glOlRXbsPkkyeEDJSTtDF9p8Z0XoSM8/SqZQbL1SKoiPOIWl5uXcexO0Uc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=WwcsRWRV; arc=none smtp.client-ip=67.231.152.168 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45B5xVav021424; Tue, 11 Jun 2024 08:25:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= PODMain02222019; bh=bY/YYO0JK9L565n9PzZjzHjTXNAAU0kC6wTI1GzcH0w=; b= WwcsRWRVwd8rPsDNmuSn+0cKb/iwfkFujmPNQUteJrI2iANNucTetADPI8eRGdyS WZlVnzpITd+2ttg+pWzkT/Q3+nFOZ3EC7BrHkbJK/TJFZ0Qvn6E0Og4sIda2QSVd E6NEe2lhDzrPlsOH9VB8gAf9i9PazdTWllcrZLuU9Z13bUiuk8OYfGjL52jCB713 2ptSPUJYHyaGpVDQE3tKzWGLVYSmVULsanv2SzHyjT2UNcHaKCZdQJFSbG3IL6vq JzCRLJ3N92o0CzLYLGW+fj96TNuorC8gnX95QlE8FxCDuJu82xZaCJolvKWk85Ni RmQT9NmV0CtCiO9+8PT7vQ== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3ymkqhtuva-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jun 2024 08:25:58 -0500 (CDT) Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 11 Jun 2024 14:25:56 +0100 Received: from ediswmail9.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1544.9 via Frontend Transport; Tue, 11 Jun 2024 14:25:56 +0100 Received: from ediswws07.ad.cirrus.com (ediswws07.ad.cirrus.com [198.90.208.14]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTP id BDC9D82024A; Tue, 11 Jun 2024 13:25:56 +0000 (UTC) From: Charles Keepax To: CC: , , , , Subject: [PATCH 3/3] ASoC: cs35l56: Attempt to read from cirrus,speaker-id device property first Date: Tue, 11 Jun 2024 14:25:56 +0100 Message-ID: <20240611132556.1557075-3-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240611132556.1557075-1-ckeepax@opensource.cirrus.com> References: <20240611132556.1557075-1-ckeepax@opensource.cirrus.com> 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 X-Proofpoint-GUID: cOWaB2ODgemJ1AfYcaeFaYYJTdZ059-H X-Proofpoint-ORIG-GUID: cOWaB2ODgemJ1AfYcaeFaYYJTdZ059-H X-Proofpoint-Spam-Reason: safe From: Simon Trimmer When cs35l56 is connected via cs42l43 there isn't an ACPI node for the cs35l56 so all properties are under the cs42l43 ACPI node. We're adding a property as a way for the cs42l43 driver to pass this info in via a software node. Signed-off-by: Simon Trimmer Signed-off-by: Charles Keepax --- sound/soc/codecs/cs35l56-shared.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/cs35l56-shared.c b/sound/soc/codecs/cs35l56-shared.c index 8af89a263594..e89027cd40d1 100644 --- a/sound/soc/codecs/cs35l56-shared.c +++ b/sound/soc/codecs/cs35l56-shared.c @@ -853,9 +853,16 @@ EXPORT_SYMBOL_NS_GPL(cs35l56_hw_init, SND_SOC_CS35L56_SHARED); int cs35l56_get_speaker_id(struct cs35l56_base *cs35l56_base) { struct gpio_descs *descs; - int speaker_id; + u32 speaker_id; int i, ret; + /* Attempt to read the speaker type from a device property first */ + ret = device_property_read_u32(cs35l56_base->dev, "cirrus,speaker-id", &speaker_id); + if (!ret) { + dev_dbg(cs35l56_base->dev, "Speaker ID = %d\n", speaker_id); + return speaker_id; + } + /* Read the speaker type qualifier from the motherboard GPIOs */ descs = gpiod_get_array_optional(cs35l56_base->dev, "spk-id", GPIOD_IN); if (!descs) { -- 2.39.2