Received: by 10.213.65.68 with SMTP id h4csp1758975imn; Mon, 19 Mar 2018 12:28:17 -0700 (PDT) X-Google-Smtp-Source: AG47ELtEf0EeJVG5noP51WnboQYSdYCX3mA+5FlEk1FzgoRAdcSP4XvxmtAkM2yn66+BK4kT1Yr/ X-Received: by 10.98.105.2 with SMTP id e2mr7105709pfc.1.1521487696884; Mon, 19 Mar 2018 12:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521487696; cv=none; d=google.com; s=arc-20160816; b=tlm15qmcgaimDN4RhbhELrFNMKyHyVwTbM4ZZ5Y9U8o+BvGePhShbo+Oe/NUv5YzwX TAm1W+X+ZVfLIYySgrgRoJdGjfifsSyAXDUBuM4UJMMIeagI3GYzU7WGRsWQjcF18G4L aMThOL7NVYmdn5VDWb8oK+eeCdT1a6WeAlcr98/7bGqtUU2C6AWzgWg37MXUVvmxpCeT iXxpr0xF8LDaePC2VU9+rag9CHv4YvFC4H8v68xgJ/+Oz9ZOejErJubQhap4GwsDd2Gk gEa9B6gwOQimRf6MppQoJy88iiMILfvmTH5e6BBT87dXCVv0yd+q/XIURBfCKRBvDj7q 9n3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=XkGKSS3NP0Uy3m6D6Px1BrUOExPT+ORsGngyvWbLLRM=; b=tTsMZPgV+sP/62RZurtcC3QxYmPHO+40pttJpb3FFVSlhhq5q9MtT1uhnIBlnSEtVw F0/tEwCXO/h2ETiBT4Q31/SuJRw2E9cOTcRuRGUtbZkaFQzR5zCWef4d5ZXbpH5jXYdT cO0JCLXTGJU8NlM5Lxab+8Xk11q8QfSm9wO63/5EBV+sHg63K8a5BKfFVsps1LyIUGF9 xRSUJ57/BQhnCEhmDdgCMlv7qfuZs4nPmq3J/Mu0+WynkPVIbB6wP6jBH0UkBI3yLvYk xb2IwdPpE76QuF6Fbu0EvSY8FVTy1uT/+eUTdRd3hLs0/kNf715bX+yTE7FYsCV91ouP 8DgQ== 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 5-v6si517593plt.371.2018.03.19.12.28.02; Mon, 19 Mar 2018 12:28:16 -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 S935988AbeCST0k (ORCPT + 99 others); Mon, 19 Mar 2018 15:26:40 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49912 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969631AbeCSSYX (ORCPT ); Mon, 19 Mar 2018 14:24:23 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8CBE6F97; Mon, 19 Mar 2018 18:24:22 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Javier Martinez Canillas , Mark Brown , Sasha Levin Subject: [PATCH 4.9 108/241] ASoC: rt5677: Add OF device ID table Date: Mon, 19 Mar 2018 19:06:13 +0100 Message-Id: <20180319180755.666233581@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Javier Martinez Canillas [ Upstream commit 7b87463edf3e2c16d72eeea3d1cf3c12bb5487c6 ] The driver doesn't have a struct of_device_id table but supported devices are registered via Device Trees. This is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID and that the MODALIAS reported will always be of the form i2c:. But this could change in the future so the correct approach is to have an OF device ID table if the devices are registered via OF. Before this patch: $ modinfo sound/soc/codecs/snd-soc-rt5677.ko | grep alias alias: i2c:RT5677CE:00 alias: i2c:rt5676 alias: i2c:rt5677 After this patch: $ modinfo sound/soc/codecs/snd-soc-rt5677.ko | grep alias alias: of:N*T*Crealtek,rt5677C* alias: of:N*T*Crealtek,rt5677 alias: i2c:RT5677CE:00 alias: i2c:rt5676 alias: i2c:rt5677 Signed-off-by: Javier Martinez Canillas Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- sound/soc/codecs/rt5677.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/sound/soc/codecs/rt5677.c +++ b/sound/soc/codecs/rt5677.c @@ -5035,6 +5035,12 @@ static const struct i2c_device_id rt5677 }; MODULE_DEVICE_TABLE(i2c, rt5677_i2c_id); +static const struct of_device_id rt5677_of_match[] = { + { .compatible = "realtek,rt5677", }, + { } +}; +MODULE_DEVICE_TABLE(of, rt5677_of_match); + static const struct acpi_gpio_params plug_det_gpio = { RT5677_GPIO_PLUG_DET, 0, false }; static const struct acpi_gpio_params mic_present_gpio = { RT5677_GPIO_MIC_PRESENT_L, 0, false }; static const struct acpi_gpio_params headphone_enable_gpio = { RT5677_GPIO_HP_AMP_SHDN_L, 0, false }; @@ -5294,6 +5300,7 @@ static int rt5677_i2c_remove(struct i2c_ static struct i2c_driver rt5677_i2c_driver = { .driver = { .name = "rt5677", + .of_match_table = rt5677_of_match, }, .probe = rt5677_i2c_probe, .remove = rt5677_i2c_remove,