Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3853962iog; Tue, 28 Jun 2022 04:16:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sVWErMdByTOesothbINgI0G3eq+X1hqxQjSCc/DGEtn7md423kzvKxwEf9RvlOl347CveI X-Received: by 2002:a17:902:b289:b0:16b:940d:18bb with SMTP id u9-20020a170902b28900b0016b940d18bbmr1210329plr.83.1656415019533; Tue, 28 Jun 2022 04:16:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656415019; cv=none; d=google.com; s=arc-20160816; b=aVQziQFkzAEp7+SbOX8tejNNULFU36tVPwZLIm0xO/fuMmkl4ukl8qtiG2G4Ax3YHI jiLxL95VJQLpAD8XSOlnu6JbKceGzc+qAibiPn6mQA+l7n6meUvp9eUKjuX+JP1yye6Z qTRd8OCrAH65LvsXTbobtIGqSevN7j0a50Uh23DO55lD07QRENXsa1Kyw7fBpvWbrJmT 2L5Cq0SX+hJYXHJmnZU4o9RtRtsdagJJIRqv9Gutgl1uwtL3Vxv1gSrvzMUiFOwfknzi krEgeDFoCZSyTBsCWx9n1oxz/hY1vfFrbPCjGgmQIJTBNb2Ov7IhQaPehcXOLp4lmKVw kkaA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=QBEidroRw5+JD0Vl6jzELd5/Mgloypbq/UGjqMxx45w=; b=heplz2wlA75oYbYnG7tFlQ/vEkOUQD+rveFxHPefSRHrYC7LJaaCxHblshAle73nzQ b1BeXxpuXEdorkx7pyAASHYEDK1kIgQEka7KrEMAzGW6MLIKTEtG1cw2RjD79K0UbV3M df046Npa9e0s/tQdSerfDaPrab0ze77V2METaZRIE2wq35vMYmxXpgcLxNZI+26KsuHf mreipSLZhBEiiwRDZgj6jlUyF1KtRmhg7t3qq7KkqtxRth471uSkkHQ01W0tO7xNTN0O ovjkT8XKTKEoeJKSLwo4nvtTWp1OBZdpa7hxXcCyAfenubp+xEPyg+Dy8o8wuFnJfZqG XCKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b="ch9/kbVJ"; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x123-20020a636381000000b0040d510ee269si18229078pgb.105.2022.06.28.04.16.44; Tue, 28 Jun 2022 04:16:59 -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=@cirrus.com header.s=PODMain02222019 header.b="ch9/kbVJ"; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345051AbiF1Koe (ORCPT + 99 others); Tue, 28 Jun 2022 06:44:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236719AbiF1Ko3 (ORCPT ); Tue, 28 Jun 2022 06:44:29 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 491373137C; Tue, 28 Jun 2022 03:44:28 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25S8Aom7002616; Tue, 28 Jun 2022 05:44:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=QBEidroRw5+JD0Vl6jzELd5/Mgloypbq/UGjqMxx45w=; b=ch9/kbVJQm5QV1wgEMKkMrK3BxZOwh/+KlYuFRZf806EEtYO3g4tJR3qhccmoSp++63C HtJnHZEbqvbbRed+/pxizYCXSg9aAcVU6nv6+AL/tL73Oj/hU3CyOOGOBUVhwWzSK0QQ e/LARF+FgIm2+R/eDdygpIQCovF3lPUer/R6HTf7xmoxCFugTNZ6hsa2qai8oR9feOw8 OO6/JHERNvKRdD8W+8Q/4bgE2GTd5Mzn6fUrVpENXwDBelSsWfZOyjod29b6xtgapYQ4 mXWAKNaPyaFMLl55J4jbQJndfJ+bKqweZmyDMYEpmy6OxHMLqV4eyMF9V870cwfrG2IW YA== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3gwxsq3rut-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 28 Jun 2022 05:44:15 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Tue, 28 Jun 2022 11:44:14 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Tue, 28 Jun 2022 11:44:14 +0100 Received: from sbinding-cirrus-dsktp.ad.cirrus.com (unknown [198.90.238.163]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 6F88F2A1; Tue, 28 Jun 2022 10:44:13 +0000 (UTC) From: Stefan Binding To: "Rafael J . Wysocki" , Len Brown , Mark Brown , Liam Girdwood CC: , , , , Stefan Binding Subject: [PATCH v4 0/2] Read _SUB from ACPI to be able to identify firmware Date: Tue, 28 Jun 2022 11:44:09 +0100 Message-ID: <20220628104411.984551-1-sbinding@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: yKfBcfP_Cn5hX-1DIGltE_b4HOiU4-7n X-Proofpoint-ORIG-GUID: yKfBcfP_Cn5hX-1DIGltE_b4HOiU4-7n X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org CS35L41 has a DSP which is able to run firmware, as well as a tuning file. Different systems may want to use different firmwares and tuning files, and some firmwares/tunings may not be compatible with other systems. To allow a system to select the correct fimware/tuning, we can read an _SUB from the ACPI. This _SUB can then be used to uniquely identify the system in the firmware/tuning file name. Add a helper function which reads the _SUB, so this can be used by other parts in the future. Add support inside the CS35L41 ASoC driver to read this _SUB, and save it appropriately. Changes since v3: - Fix 32 bit format string warning Changes since v2: - Fix error in function prototype Changes since v1: - Add length validation for SSID String - Rename API - Allocate memory inside API - Use ACPI_HANDLE macro instead of ACPI_COMPANION - Improve error handling Stefan Binding (2): ACPI: utils: Add api to read _SUB from ACPI ASoC: cs35l41: Read System Name from ACPI _SUB to identify firmware drivers/acpi/utils.c | 38 ++++++++++++++++++++++++++++++++++++++ include/linux/acpi.h | 6 ++++++ sound/soc/codecs/cs35l41.c | 24 ++++++++++++++++++++++++ 3 files changed, 68 insertions(+) -- 2.25.1