From patchwork Thu Aug 13 12:23:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricard Wanderlof X-Patchwork-Id: 7008191 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E41A5C05AC for ; Thu, 13 Aug 2015 12:23:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 15F0A204FF for ; Thu, 13 Aug 2015 12:23:26 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id BA1FD203C0 for ; Thu, 13 Aug 2015 12:23:24 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 73F5D2625EA; Thu, 13 Aug 2015 14:23:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 2A4A7261A3B; Thu, 13 Aug 2015 14:23:20 +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 5BBF9261A3B; Thu, 13 Aug 2015 14:23:18 +0200 (CEST) Received: from bes.se.axis.com (bes.se.axis.com [195.60.68.10]) by alsa0.perex.cz (Postfix) with ESMTP id 32A7C261A03 for ; Thu, 13 Aug 2015 14:23:13 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by bes.se.axis.com (Postfix) with ESMTP id 04DA52E44F for ; Thu, 13 Aug 2015 14:23:13 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bes.se.axis.com Received: from bes.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bes.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id po9UmNmOgGa8 for ; Thu, 13 Aug 2015 14:23:12 +0200 (CEST) Received: from boulder.se.axis.com (boulder.se.axis.com [10.0.2.104]) by bes.se.axis.com (Postfix) with ESMTP id 4BA752E4DB for ; Thu, 13 Aug 2015 14:23:12 +0200 (CEST) Received: from boulder.se.axis.com (localhost [127.0.0.1]) by postfix.imss71 (Postfix) with ESMTP id 334E21400 for ; Thu, 13 Aug 2015 14:23:12 +0200 (CEST) Received: from thoth.se.axis.com (thoth.se.axis.com [10.0.2.173]) by boulder.se.axis.com (Postfix) with ESMTP id 2704010E5 for ; Thu, 13 Aug 2015 14:23:12 +0200 (CEST) Received: from xmail2.se.axis.com (xmail2.se.axis.com [10.0.5.74]) by thoth.se.axis.com (Postfix) with ESMTP id 2432334005 for ; Thu, 13 Aug 2015 14:23:12 +0200 (CEST) Received: from lnxricardw1.se.axis.com (10.88.7.2) by xmail2.se.axis.com (10.0.5.74) with Microsoft SMTP Server (TLS) id 8.3.342.0; Thu, 13 Aug 2015 14:23:11 +0200 Date: Thu, 13 Aug 2015 14:23:11 +0200 From: Ricard Wanderlof X-X-Sender: ricardw@lnxricardw1.se.axis.com To: "alsa-devel@alsa-project.org" Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Subject: [alsa-devel] [PATCH] Add rudimentary DT support to SSM2518 codec driver 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP For some reason, the SSM2518 codec driver has device tree bindings specified (Documentation/devicetree/bindings/sound/ssm2518.txt) but the actual driver doesn't seem to support DT. This patch adds rudimentary support for the compatible property so that the driver can be used in a DT based setup. --- sound/soc/codecs/ssm2518.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/ssm2518.c b/sound/soc/codecs/ssm2518.c index 67ea55a..ecf9996 100644 --- a/sound/soc/codecs/ssm2518.c +++ b/sound/soc/codecs/ssm2518.c @@ -811,6 +810,14 @@ static int ssm2518_i2c_remove(struct i2c_client *client) return 0; } +#ifdef CONFIG_OF +static const struct of_device_id ssm2518_dt_ids[] = { + { .compatible = "adi,ssm2518", }, + { } +}; +MODULE_DEVICE_TABLE(of, ssm2518_dt_ids); +#endif + static const struct i2c_device_id ssm2518_i2c_ids[] = { { "ssm2518", 0 }, { } @@ -821,6 +828,9 @@ static struct i2c_driver ssm2518_driver = { .driver = { .name = "ssm2518", .owner = THIS_MODULE, +#ifdef CONFIG_OF + .of_match_table = of_match_ptr(ssm2518_dt_ids), +#endif }, .probe = ssm2518_i2c_probe, .remove = ssm2518_i2c_remove,