From patchwork Mon Jul 31 10:34:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brent Lu X-Patchwork-Id: 12836 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1770723vqg; Sun, 30 Jul 2023 20:13:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlEju5Wck21VZQ6AUvuqfpppBWgKXDT/RbVvfc+fvBxjxbfN3UvwB85wDaJd+OBwwpKp9vxC X-Received: by 2002:a17:907:7605:b0:99b:e243:9ecc with SMTP id jx5-20020a170907760500b0099be2439eccmr6419693ejc.36.1690773199221; Sun, 30 Jul 2023 20:13:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690773199; cv=none; d=google.com; s=arc-20160816; b=I4//agQq2C2I+//QKXpnhvW6MZu7JPiQUV6kbyaEs6V2a50lpAbxgQmVJ/S/2S3Ykv gQq5W2xJHNDz5EcqlhMK/V3FA1qwCHUefcrJsWCruwTDD8qMb2rivdlKx3KCeTamzoW+ 2+0S+VJzTRgPx+bXZjH9NQYStQeISPg2ZRQ0GQ5c6bxNdR4n6BA9vAQNf4GIVV6XtY9r ogPMvUmIxBgnR5F0rhhfvPS/mTndbO9OrxrzfYwXWruO/HPtgsVrK6VAPTvPvEa1HFrD Hcn+OT2EavMLXFFItwjA9EDBFWQzE1p+mspN0DDHM53tMaCu11RDhuHLtvhHTQ/bJCX1 SYSA== 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=MoHKgcsPO3HHVpoh27uQzYKTVSmcG5kjaQ1LNSZ2Z+c=; fh=Lz5/hqROUpcBQKAp9YzBGY+SBeOpUnHmW51VPPw0uQw=; b=kyj2yeCKMb9yCdB7nGewFRtDZbLFajy8nMn82yBXip9WNWs2fGboLRrBRsoeDYRd3E dPqVtv2LxOX5HRv8V4RyeFX51p2wRGSbp+QkhDgsjU/PbegWSXU8YjebMA1w9+CnCtbR TuKcUGR2Ykat39PeO3hVjKIOWmofyptfVlKO86pFv1YXZl7ergFjB9q/0p3ELfGPh9sG 7REpW8LFYp3MrNM7AjTkuHBa5xTo/mg0JCIWgt0gV7U2u41STz4g/ihNQ4CGLUVwYgqG ++THhbldKEc2GpgfuwDll6UgSZVcrrojlJOtXTVi//X/bV82s7qzaUQRLL0ia4gyIfyW Hd5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=O1dJ2FMY; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gg10-20020a170906e28a00b009888aa1da13si6294308ejb.752.2023.07.30.20.12.54; Sun, 30 Jul 2023 20:13:19 -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=@intel.com header.s=Intel header.b=O1dJ2FMY; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229664AbjGaCka (ORCPT + 99 others); Sun, 30 Jul 2023 22:40:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229521AbjGaCk2 (ORCPT ); Sun, 30 Jul 2023 22:40:28 -0400 Received: from mgamail.intel.com (unknown [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABBD2E1 for ; Sun, 30 Jul 2023 19:40:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690771227; x=1722307227; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=/zCvpUO3+yntTjDh38Ej4kXqiMhmp7yIaO7/Tr0CFyE=; b=O1dJ2FMYHZsYruY90aoFv+qlFXMbBSekH1cIuE4uu8ZROQ0w0SjCCec/ hSZVZx6Ll5as3slBzW9w5VfeawbBB/NRuwA1LmT6MH9Iy/FXqItquXVzZ xMLiscTFhmjzvDW+Xcj6uIebsw5QkTj/uWjITk+zlLe+KO+BtGntA0OMI TByMpoRPZwycsp0pV8j1aVyjsg6nvzRSf0xLr8eOK/+mP6PGi+frCN8QE yx33Eudqsr0mhmj0IH0zSa/6rdxcob/J56kWPccUGtpqEVYprcs6jtKZ/ y4RjM/LPf+6VShMtF+GpQVcK88h2QZQ6WHfdsNEE7KbpKiuj8KjavSsY8 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="349205989" X-IronPort-AV: E=Sophos;i="6.01,243,1684825200"; d="scan'208";a="349205989" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2023 19:40:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="678158299" X-IronPort-AV: E=Sophos;i="6.01,243,1684825200"; d="scan'208";a="678158299" Received: from brentlu-desktop.itwn.intel.com ([10.5.252.92]) by orsmga003.jf.intel.com with ESMTP; 30 Jul 2023 19:40:22 -0700 From: Brent Lu To: alsa-devel@alsa-project.org Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Jaroslav Kysela , Takashi Iwai , Brent Lu , linux-kernel@vger.kernel.org, Ajye Huang , Yong Zhi , Terry Cheong , Uday M Bhat , Mac Chiang , "Dharageswari . R" , Kuninori Morimoto , ye xingchen , Andy Shevchenko Subject: [PATCH v4 0/1] Intel: sof_rt5682: remove quirk flag Date: Mon, 31 Jul 2023 18:34:18 +0800 Message-Id: <20230731103419.2536036-1-brent.lu@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772904197797111646 X-GMAIL-MSGID: 1772904197797111646 We add a helper function to detect amplifier number according to device instance in ACPI table so the SOF_MAX98390_TWEETER_SPEAKER_PRESENT flag and a dmi quirk for 4-amplifier configuration could be safely removed. Also refactor the max_98390_hw_params() function to use an array to handle the TDM parameter. Amplifier number detection and TDM parameter are tested on two Chromebooks. One with 2 MAX98390 and one with 4 MAX98390 amplifier. V2 Changes: - fix some typos in cover letter - use for_each_acpi_dev_match() macro to simplify the codec - use 'unsign int' for codec number variable V3 Changes: - replace pr_err() with dev_err() V4 Changes: - merge two patches to avoid build break - remove redundant assignment in max_98390_hw_params() - refactor MAX_98390_DEVX_NAME macros Brent Lu (2): ASoC: Intel: maxim-common: get codec number from ACPI ASoC: Intel: sof_rt5682: remove SOF_MAX98390_TWEETER_SPEAKER_PRESENT flag Brent Lu (1): ASoC: Intel: maxim-common: get codec number from ACPI table sound/soc/intel/boards/sof_maxim_common.c | 170 +++++++++++++--------- sound/soc/intel/boards/sof_maxim_common.h | 21 ++- sound/soc/intel/boards/sof_rt5682.c | 37 +---- 3 files changed, 111 insertions(+), 117 deletions(-)