Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2225809ybi; Mon, 1 Jul 2019 08:19:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwI+4NwbJH4SiJ0e5GVgoCYEd1IntNO5mdBZ6Nmz9TZtnPIoT9rgB32Ha16RNvl2XMEOX1E X-Received: by 2002:a17:902:e30d:: with SMTP id cg13mr29351544plb.173.1561994352152; Mon, 01 Jul 2019 08:19:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561994352; cv=none; d=google.com; s=arc-20160816; b=C38Mfq4xQWNdeGnG3Upy2lIS5uFnWNM5vYdOok4JYhW99Vt5o3i6DgrpPfoDT4N7oG Z/IAVE/bKLc28mUQPLe80hsiT+1shXE1LSfDNAjhrEmO1TGnDxuPLqJhPJCSmY6t3SsM pht2CFZ4oVcqwDt2UJz2DfvdBvNgUBkga2Z5pBdfghYxRzBKj+SJvypsD7CoYSbiwzKe RnSE/H7aatii6pFQe0KULzqhxlerhnZQXsNMiVY33pOkuRQPPgwpqTWLWIEIj0VrLe9R AtUzsthDx/FgRlZ9R8h32sJXbyOZI68mv00elEh2Ee8cMJoLFSATlN/rRjjtOjQhdC6j nkHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from; bh=sC5wUo00pXv72br9eVS/KalQoysdVpflO5hpx8Ygb9E=; b=FWy0LZPKQI+owLX+aEd7bWWtMMJMZJ+NrRy8D+dfrrBG/L+HEEIX+FOvi3vWH5EIUB aVuCyVmDBe1rlVoQrMQHpoe4Vr1guOFlQOXfVZf8FSWCUxB/haxHIpCpM+Cu8364I/Or ZGmtTQU4+4eTdVDfH+MYLrsJKdKjMU7Dbmjj8yfqlj22t4tAIx2/oExmeuk1rEGaoWsB UB4i3vmSmi+saD6I1ta+Ghy7Jsh1FEhZEYITqeMu9fJSm8f9ieUloS267TzmOuqVreBi 6NDSnDQ7jCd8JmlUxu3SzB3gqdFjOu98+Cs7G7aPweI9U3d0YsvXI5uPdDnrDkLhNFG8 Re7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k12si10217602pgh.263.2019.07.01.08.18.56; Mon, 01 Jul 2019 08:19:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729174AbfGANnO (ORCPT + 99 others); Mon, 1 Jul 2019 09:43:14 -0400 Received: from mail.steuer-voss.de ([85.183.69.95]:53010 "EHLO mail.steuer-voss.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727268AbfGANnN (ORCPT ); Mon, 1 Jul 2019 09:43:13 -0400 X-Virus-Scanned: Debian amavisd-new at mail.steuer-voss.de X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from pc-niv.weinmann.com (localhost [127.0.0.1]) by mail.steuer-voss.de (Postfix) with ESMTP id 48E854D130; Mon, 1 Jul 2019 15:43:09 +0200 (CEST) From: Nikolaus Voss To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Andreas Dannenberg , "Andrew F. Davis" , Kate Stewart Cc: Nikolaus Voss , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, nv@vosn.de Subject: [PATCH v2 2/2] ASoC: tas5720.c: add ACPI enumeration support Date: Mon, 1 Jul 2019 15:42:52 +0200 Message-Id: <24afd89b00bfba84d31083e6455baf1f3ad3f362.1561988282.git.nikolaus.voss@loewensteinmedical.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: <20190628143037.GH5379@sirena.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add ACPI IDs for tas5720 and tas5722 and use device match API to determine the variant. Signed-off-by: Nikolaus Voss --- sound/soc/codecs/tas5720.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/tas5720.c b/sound/soc/codecs/tas5720.c index b2e897f094b4..e3f85926cac4 100644 --- a/sound/soc/codecs/tas5720.c +++ b/sound/soc/codecs/tas5720.c @@ -7,6 +7,7 @@ * Author: Andreas Dannenberg */ +#include #include #include #include @@ -631,7 +632,9 @@ static int tas5720_probe(struct i2c_client *client, data->tas5720_client = client; - data->variant = (const struct tas5720_variant *)id->driver_data; + data->variant = device_get_match_data(&client->dev); + if (!data->variant) + data->variant = (const struct tas5720_variant *)id->driver_data; data->regmap = devm_regmap_init_i2c(client, data->variant->reg_config); if (IS_ERR(data->regmap)) { @@ -687,10 +690,20 @@ static const struct of_device_id tas5720_of_match[] = { MODULE_DEVICE_TABLE(of, tas5720_of_match); #endif +#if IS_ENABLED(CONFIG_ACPI) +static const struct acpi_device_id tas5720_acpi_match[] = { + { "10TI5720", (kernel_ulong_t)&tas5720 }, + { "10TI5722", (kernel_ulong_t)&tas5722 }, + { } +}; +MODULE_DEVICE_TABLE(acpi, tas5720_acpi_match); +#endif + static struct i2c_driver tas5720_i2c_driver = { .driver = { .name = "tas5720", .of_match_table = of_match_ptr(tas5720_of_match), + .acpi_match_table = ACPI_PTR(tas5720_acpi_match), }, .probe = tas5720_probe, .id_table = tas5720_id, -- 2.17.1