From patchwork Tue Sep 19 22:59:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 9960465 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 94BCF60208 for ; Tue, 19 Sep 2017 23:00:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7430928F2F for ; Tue, 19 Sep 2017 23:00:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71D3A28E8C; Tue, 19 Sep 2017 23:00:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7396B28E8C for ; Tue, 19 Sep 2017 23:00:17 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B22612671EB; Wed, 20 Sep 2017 00:59:22 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id CAA8D26722A; Wed, 20 Sep 2017 00:59:21 +0200 (CEST) Received: from mail-qt0-f195.google.com (mail-qt0-f195.google.com [209.85.216.195]) by alsa0.perex.cz (Postfix) with ESMTP id 26929266D08 for ; Wed, 20 Sep 2017 00:59:17 +0200 (CEST) Received: by mail-qt0-f195.google.com with SMTP id b1so718005qtc.0 for ; Tue, 19 Sep 2017 15:59:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=N/POnfZhst3Y0aq2WXzzvWu2XEXWOu9lDQXIjrHoIN4=; b=DtHm86ul6MxQ2H36+t/Y/4ZpnGmunVNe8k+vL30nA8YV3W3Ff1fMT+WGVGVQ/aIgX5 uv2tzQjVDRRGgT3ufstV0VnCByj7KgkbZkW+Yk/Iim38CiQGh+OU7yw2SV5+RqCzZM99 jSJ9urJrFTF0W8fjh6B5J3lMXTTnPUaLVwcASxYQuqMo6WmzU34/JlTVeb+jlAFZxlix 77CUHMdEIhKWFecKdIHtW8WuraBqQnFHEsVToXi81sYhdDdGQgvLPZmnernU1RAMm24p QCViHrKyG8zldkLW4KHQxFWdklgqOZvygcgH6JRwW+6sps1wrh/wtkLO3TF30egkKq5w w24g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=N/POnfZhst3Y0aq2WXzzvWu2XEXWOu9lDQXIjrHoIN4=; b=Ww24k6W0kwHATv12GqkRJUcaBoDqMuoXqh4K+ZLmG8nLo8PSMPiwJhVrmaogn5gVuv +L3vAAatwpJHtLMSdhWSIUytw/JeVFb+ImcZzbh0+E/T/9WcBaTPemz/MUoZk/TpMmo4 CUPP5v0qm+F4sKrZYW1icUMfBhU0S4HhKTxWJikGzgyT87RQ/H8g3qYD7jgpURgm3Sr9 rJRLCuJFn8Nw0uQn+8mLVPbgyuZjpodxX9UNrqHr83IZ1Y5imMbtXnD6/4UCoL+R2Ivc /W1MEcpPtz89+G8XpNTVl7a4gwnB1nU9hYhuB+lnNMk5XhT4QgR3ZLqZk2HjA6YPu/uD SHfw== X-Gm-Message-State: AHPjjUh7LkXq7pRdWsmFz7PIJMgNokhcgeBn+/cAh2eFvO7VYZt0T/72 f0omUoYHoFPWTQTh2ckkbH8= X-Google-Smtp-Source: AOwi7QCA4YkqO+frku54NSWbcz2bGJaaeuMqeREq6kGKwkIQsjL12L63Da9RxgkXWvgi/AXFpHTYTg== X-Received: by 10.200.22.21 with SMTP id p21mr4558550qtj.104.1505861956576; Tue, 19 Sep 2017 15:59:16 -0700 (PDT) Received: from localhost.localdomain ([201.82.171.248]) by smtp.gmail.com with ESMTPSA id n34sm349103qtf.10.2017.09.19.15.59.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Sep 2017 15:59:15 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Date: Tue, 19 Sep 2017 19:59:04 -0300 Message-Id: <1505861944-32447-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 2.7.4 Cc: Fabio Estevam , devicetree@vger.kernel.org, alsa-devel@alsa-project.org, robh+dt@kernel.org, lukma@denx.de Subject: [alsa-devel] [PATCH] ASoC: tfa9879: Add device tree bindings X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam Even though the tfa9879 driver can probe via device tree trough the I2C core code, it is preferable to have explicit device tree bindings instead [1], so add this support. [1] https://www.spinics.net/lists/devicetree/msg195176.html Signed-off-by: Fabio Estevam Reviewed-by: Ɓukasz Majewski --- Hi Lukasz, Could you please test this on your hardware? .../devicetree/bindings/sound/tfa9879.txt | 23 ++++++++++++++++++++++ sound/soc/codecs/tfa9879.c | 6 ++++++ 2 files changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/tfa9879.txt diff --git a/Documentation/devicetree/bindings/sound/tfa9879.txt b/Documentation/devicetree/bindings/sound/tfa9879.txt new file mode 100644 index 0000000..731ffe8 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/tfa9879.txt @@ -0,0 +1,23 @@ +NXP TFA9879 class-D audio amplifier + +Required properties: + +- compatible : "nxp,tfa9879" + +- reg : the I2C address of the device + +Example: + +&i2c1 { + clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c1>; + status = "okay"; + + codec: tfa9879@6c { + #sound-dai-cells = <0>; + compatible = "nxp,tfa9879"; + reg = <0x6c>; + }; +}; + diff --git a/sound/soc/codecs/tfa9879.c b/sound/soc/codecs/tfa9879.c index 95e0a7a..f8dd67c 100644 --- a/sound/soc/codecs/tfa9879.c +++ b/sound/soc/codecs/tfa9879.c @@ -312,9 +312,15 @@ static const struct i2c_device_id tfa9879_i2c_id[] = { }; MODULE_DEVICE_TABLE(i2c, tfa9879_i2c_id); +static const struct of_device_id tfa9879_of_match[] = { + { .compatible = "nxp,tfa9879", }, + { } +}; + static struct i2c_driver tfa9879_i2c_driver = { .driver = { .name = "tfa9879", + .of_match_table = tfa9879_of_match, }, .probe = tfa9879_i2c_probe, .remove = tfa9879_i2c_remove,