From patchwork Fri Sep 18 20:11:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Cormier X-Patchwork-Id: 7220601 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 60A9D9F380 for ; Fri, 18 Sep 2015 20:13:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 843832093B for ; Fri, 18 Sep 2015 20:13:27 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 5DF1D20935 for ; Fri, 18 Sep 2015 20:13:26 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6BF9226609B; Fri, 18 Sep 2015 22:13:25 +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 B1AD6265DFC; Fri, 18 Sep 2015 22:12:42 +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 6D6AE265E89; Fri, 18 Sep 2015 22:12:41 +0200 (CEST) Received: from mail-qk0-f169.google.com (mail-qk0-f169.google.com [209.85.220.169]) by alsa0.perex.cz (Postfix) with ESMTP id C2680265DC6 for ; Fri, 18 Sep 2015 22:12:30 +0200 (CEST) Received: by qkap81 with SMTP id p81so24174602qka.2 for ; Fri, 18 Sep 2015 13:12:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=F6TCwtptKqS2Wcrxuo1i138ripoS6QYl6+yQiRJg02w=; b=kadC4g97p15w8iGjMGtGq5gzPb5mH9Mm/uNCZX82SpDNhUAF0AKCUMDa4dfAGSL6Bg 5sNUdrXaHwznvTvZtjf+QcTLhK7iRbZh/ovaX974FvOVIH7cuqqjQJY5ut2SWnhJCz5x fvq9sUpGis7TPcaaJRQyAJQrlLkN5fARzPlgIz3z4/ad44grGkaDCfUuCWx2M2uyH24A uqC7UJl0wQnPKNck0cLAhxi34B7Zjp4mNaq2CclCdRlTKfaA2qqU/HCuMz3UCq7zaCRo /d1jfVUz1EZ7t0sYEmAl/jtt12+CEtICqlTaDL4rGqRgruX0nczejdGNQ3ZMvWep1gAM nIFg== X-Gm-Message-State: ALoCoQmCU/ZxqpQqqdPD+2ipQIBGB7+yWO8BndSBP6/cSeQBDz3Cd4VqWG+uKtpDaWzreVTANeS5 X-Received: by 10.55.221.8 with SMTP id n8mr8661438qki.85.1442607149853; Fri, 18 Sep 2015 13:12:29 -0700 (PDT) Received: from jcormier-desktop.syr.criticallink.com (static-72-90-70-106.syrcny.fios.verizon.net. [72.90.70.106]) by smtp.gmail.com with ESMTPSA id b16sm4328443qkj.1.2015.09.18.13.12.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Sep 2015 13:12:29 -0700 (PDT) From: "Cormier, Jonathan" To: Liam Girdwood Date: Fri, 18 Sep 2015 16:11:10 -0400 Message-Id: <1442607076-26681-2-git-send-email-jcormier@criticallink.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442607076-26681-1-git-send-email-jcormier@criticallink.com> References: <1442607076-26681-1-git-send-email-jcormier@criticallink.com> Cc: "Cormier, Jonathan" , alsa-devel@alsa-project.org, Bob Duke , Mark Brown , linux-kernel@vger.kernel.org, Takashi Iwai , Jyri Sarha , Peter Ujfalusi , Mike Williamson , Greg Gluszek , Misael Lopez Cruz Subject: [alsa-devel] [PATCH RFC 1/7] ASoC: tlv320aic26: Add device tree binding 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 Signed-off-by: Cormier, Jonathan --- .../devicetree/bindings/sound/tlv320aic26.txt | 65 ++++++++++++++++++++++ sound/soc/codecs/tlv320aic26.c | 10 ++++ 2 files changed, 75 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/tlv320aic26.txt diff --git a/Documentation/devicetree/bindings/sound/tlv320aic26.txt b/Documentation/devicetree/bindings/sound/tlv320aic26.txt new file mode 100644 index 000000000000..93aa0f76ec0d --- /dev/null +++ b/Documentation/devicetree/bindings/sound/tlv320aic26.txt @@ -0,0 +1,65 @@ +Texas Instruments - tlv320aic26 Codec module + +The tlv320aic26 serial control bus communicates through I2C protocols + +Required properties: + +- compatible - "string" - One of: + "ti,tlv320aic26" - TLV320AIC26 +- reg - - SPI chip select + +CODEC input pins: + * MICIN + * AUX + +CODEC output pins: + * HPL + * HPR + +The pins can be used in referring sound node's audio-routing property. + +Example: + +tlv320aic26: tlv320aic26@0 { + compatible = "ti,tlv320aic26"; + reg = <0>; +}; + +&spi0 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&spi0_pins>; + pinctrl-1 = <&spi0_sleep_pins>; + + status = "okay"; + ti,pindir-d0-out-d1-in = <1>; + + tlv320aic26: tlv320aic26@1 { + compatible = "ti,tlv320aic26"; + reg = <0x1>; + status = "okay"; + + spi-max-frequency = <2000000>; + spi-cpha; + }; +}; + +sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "AM335x_SND"; + simple-audio-card,format = "dsp_b"; + /* SND_SOC_DAIFMT_CBM_CFM */ + simple-audio-card,bitclock-master = <&tlv320aic26_codec>; + simple-audio-card,frame-master = <&tlv320aic26_codec>; + /* SND_SOC_DAIFMT_IB_NF */ + simple-audio-card,bitclock-inversion; + + simple-audio-card,cpu { + sound-dai = <&mcasp1>; + system-clock-frequency = <24576000>; + }; + + tlv320aic26_codec: simple-audio-card,codec { + sound-dai = <&tlv320aic26>; + system-clock-frequency = <24576000>; + }; +}; diff --git a/sound/soc/codecs/tlv320aic26.c b/sound/soc/codecs/tlv320aic26.c index 620ab9ea1ef0..91fdd96648bd 100644 --- a/sound/soc/codecs/tlv320aic26.c +++ b/sound/soc/codecs/tlv320aic26.c @@ -370,10 +370,20 @@ static int aic26_spi_remove(struct spi_device *spi) return 0; } +#if defined(CONFIG_OF) +static const struct of_device_id tlv320aic26_of_match[] = { + { .compatible = "ti,tlv320aic26", }, + {}, +}; +#endif + static struct spi_driver aic26_spi = { .driver = { .name = "tlv320aic26-codec", .owner = THIS_MODULE, +#if defined(CONFIG_OF) + .of_match_table = of_match_ptr(tlv320aic26_of_match), +#endif }, .probe = aic26_spi_probe, .remove = aic26_spi_remove,