From patchwork Sun Jul 12 06:56:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatol Pomozov X-Patchwork-Id: 6771761 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 99957C05AC for ; Sun, 12 Jul 2015 06:57:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C257F2061A for ; Sun, 12 Jul 2015 06:57:27 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 760D220617 for ; Sun, 12 Jul 2015 06:57:26 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7B7292606A5; Sun, 12 Jul 2015 08:57: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=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 1040726065F; Sun, 12 Jul 2015 08:57:17 +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 414CC260663; Sun, 12 Jul 2015 08:57:16 +0200 (CEST) Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by alsa0.perex.cz (Postfix) with ESMTP id 05DA726064F for ; Sun, 12 Jul 2015 08:57:09 +0200 (CEST) Received: by pdjr16 with SMTP id r16so45250634pdj.3 for ; Sat, 11 Jul 2015 23:57:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=P0GP3zaxhXjif74pb//Dit1F9w7+Q8rmHg6Fo8oHhAw=; b=DyueHEqfvqCUgkiWIpRQKQt8kV8gHxR1SWQqX5VKb9AcnmPzcE1jK45b4s5HdXdqDW Z1uv2uSgGHMLUDI6U0ykL7WiqpmQfI5wZYF71zkz3HkwPFBqOoXCqnDUPqEqDuuDe0NU QGPP81EZgDgIof4v06s/K2cAYjzgLiJhJNoIMBUuqnuYlYfIFqsHckI9SDhppsVEXK0D pDcv3KpRmmIl8wZpb9LdHjBTEUItsQr+2v5k14my1uoIhUVTAQtADH3AWI8i5flAQfUf HvK0uVQqBEJZnVi7FmsLX6jFEwpMAgnpSG8GmMnB1JiMAm96ghni9JfJWaYsr0gmdHJf Iy7Q== X-Received: by 10.68.211.228 with SMTP id nf4mr58152108pbc.116.1436684227779; Sat, 11 Jul 2015 23:57:07 -0700 (PDT) Received: from argo.lan (76-198-28-160.lightspeed.sntcca.sbcglobal.net. [76.198.28.160]) by smtp.gmail.com with ESMTPSA id mb4sm14781012pdb.63.2015.07.11.23.57.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 11 Jul 2015 23:57:07 -0700 (PDT) From: Anatol Pomozov To: alsa-devel@alsa-project.org Date: Sat, 11 Jul 2015 23:56:40 -0700 Message-Id: <1436684202-16461-1-git-send-email-anatol.pomozov@gmail.com> X-Mailer: git-send-email 2.4.5 Cc: broonie@kernel.org, lars@metafoo.de, kwestfie@codeaurora.org, Anatol Pomozov Subject: [alsa-devel] [PATCH 1/3] ASoC: max98357a: Make 'sdmode-gpios' dts property optional 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 The option is not needed if chip is always on or managed by some other part of system like platform card driver. Signed-off-by: Anatol Pomozov --- Documentation/devicetree/bindings/sound/max98357a.txt | 6 +++++- sound/soc/codecs/max98357a.c | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/max98357a.txt b/Documentation/devicetree/bindings/sound/max98357a.txt index a7a149a..28645a2 100644 --- a/Documentation/devicetree/bindings/sound/max98357a.txt +++ b/Documentation/devicetree/bindings/sound/max98357a.txt @@ -4,7 +4,11 @@ This node models the Maxim MAX98357A DAC. Required properties: - compatible : "maxim,max98357a" -- sdmode-gpios : GPIO specifier for the GPIO -> DAC SDMODE pin + +Optional properties: +- sdmode-gpios : GPIO specifier for the chip's SD_MODE pin. + If this option is not specified then driver does not manage + the pin state (e.g. chip is always on). Example: diff --git a/sound/soc/codecs/max98357a.c b/sound/soc/codecs/max98357a.c index 3a2fda0..6d4246a 100644 --- a/sound/soc/codecs/max98357a.c +++ b/sound/soc/codecs/max98357a.c @@ -31,6 +31,9 @@ static int max98357a_daiops_trigger(struct snd_pcm_substream *substream, { struct gpio_desc *sdmode = snd_soc_dai_get_drvdata(dai); + if (!sdmode) + return 0; + switch (cmd) { case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: @@ -61,7 +64,7 @@ static int max98357a_codec_probe(struct snd_soc_codec *codec) struct gpio_desc *sdmode; sdmode = devm_gpiod_get(codec->dev, "sdmode", GPIOD_OUT_LOW); - if (IS_ERR(sdmode)) { + if (IS_ERR(sdmode) && (PTR_ERR(sdmode) != -ENOENT)) { dev_err(codec->dev, "%s() unable to get sdmode GPIO: %ld\n", __func__, PTR_ERR(sdmode)); return PTR_ERR(sdmode);