From patchwork Thu Jul 21 16:28:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 3026 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 9C76A23F4D for ; Thu, 21 Jul 2011 16:16:43 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id 66869A186E1 for ; Thu, 21 Jul 2011 16:16:43 +0000 (UTC) Received: by qwb8 with SMTP id 8so1012641qwb.11 for ; Thu, 21 Jul 2011 09:16:42 -0700 (PDT) Received: by 10.229.25.212 with SMTP id a20mr401225qcc.148.1311265002758; Thu, 21 Jul 2011 09:16:42 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.217.78 with SMTP id hl14cs144723qcb; Thu, 21 Jul 2011 09:16:42 -0700 (PDT) Received: by 10.68.8.132 with SMTP id r4mr567665pba.151.1311265001757; Thu, 21 Jul 2011 09:16:41 -0700 (PDT) Received: from mail-pv0-f178.google.com (mail-pv0-f178.google.com [74.125.83.178]) by mx.google.com with ESMTPS id d5si1195627pbj.89.2011.07.21.09.16.40 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jul 2011 09:16:40 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.83.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=74.125.83.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.83.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: by mail-pv0-f178.google.com with SMTP id 7so1491307pvg.37 for ; Thu, 21 Jul 2011 09:16:40 -0700 (PDT) Received: by 10.68.66.133 with SMTP id f5mr492147pbt.240.1311264999821; Thu, 21 Jul 2011 09:16:39 -0700 (PDT) Received: from localhost.localdomain ([121.228.79.244]) by mx.google.com with ESMTPS id x2sm983975pbn.13.2011.07.21.09.16.26 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jul 2011 09:16:36 -0700 (PDT) From: Shawn Guo To: alsa-devel@alsa-project.org Cc: devicetree-discuss@lists.ozlabs.org, patches@linaro.org, Shawn Guo , Grant Likely , Zeng Zhaoming , Liam Girdwood , Mark Brown Subject: [PATCH] ASoC: sgtl5000: add device tree probe support Date: Fri, 22 Jul 2011 00:28:51 +0800 Message-Id: <1311265731-23318-1-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 It adds device tree probe support for sgtl5000 driver. Signed-off-by: Shawn Guo Cc: Grant Likely Cc: Zeng Zhaoming Cc: Liam Girdwood Cc: Mark Brown Acked-by: Grant Likely --- .../bindings/sound/soc/codecs/fsl-sgtl5000.txt | 11 +++++++++++ sound/soc/codecs/sgtl5000.c | 8 ++++++++ 2 files changed, 19 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/soc/codecs/fsl-sgtl5000.txt diff --git a/Documentation/devicetree/bindings/sound/soc/codecs/fsl-sgtl5000.txt b/Documentation/devicetree/bindings/sound/soc/codecs/fsl-sgtl5000.txt new file mode 100644 index 0000000..2c3cd41 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/soc/codecs/fsl-sgtl5000.txt @@ -0,0 +1,11 @@ +* Freescale SGTL5000 Stereo Codec + +Required properties: +- compatible : "fsl,sgtl5000". + +Example: + +codec: sgtl5000@0a { + compatible = "fsl,sgtl5000"; + reg = <0x0a>; +}; diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 76258f2..cf6eea8 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -1494,10 +1495,17 @@ static const struct i2c_device_id sgtl5000_id[] = { MODULE_DEVICE_TABLE(i2c, sgtl5000_id); +static const struct of_device_id sgtl5000_dt_ids[] = { + { .compatible = "fsl,sgtl5000", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(i2c, sgtl5000_dt_ids); + static struct i2c_driver sgtl5000_i2c_driver = { .driver = { .name = "sgtl5000", .owner = THIS_MODULE, + .of_match_table = sgtl5000_dt_ids, }, .probe = sgtl5000_i2c_probe, .remove = __devexit_p(sgtl5000_i2c_remove),