Received: by 10.192.165.148 with SMTP id m20csp1032024imm; Fri, 27 Apr 2018 11:26:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZruXTGx/OGT2p0dtBFHnpkbNr9mwl7sHI8leA665RAlOm08azZfosoMW8OlpaMuRndriUCn X-Received: by 2002:a17:902:680c:: with SMTP id h12-v6mr3251464plk.113.1524853565231; Fri, 27 Apr 2018 11:26:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524853565; cv=none; d=google.com; s=arc-20160816; b=fyW/Nh6g+aBqpj2dFqtYviGgwm+R/w+W9e84f7jYezg3ux5QbLGiTangsx8IrXjO0S x+InnpfLXr5rFcI4F5K760YNYlXX2CVrCtjLZbcIMt6/c+3RI90bRKVqNSnN07e637+t TiXW5CZYnDm0qGb7rsBgyREk7Ejb7U61IsYfjTXWdyiD/g8zwDIxPE0HaMsHFRq6ONER KBl2JR5Ge62s32anZJgOJ85VZ4BosO1OzxPu8QZPUyruYpsRF+dFJHwoEeNlmbSoANMC w4B0XOh+HJ6POD7P6ckic+2hkBWE6bEp7p0KaSyI/THGrJFJdY7nCKerNwBa2V1xt70Z VCDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=RRkAFkMuqOxWO/Lk3EklCIzEzyTF8Tww9Jskwql1uh4=; b=P9lggwuFAEqf4MAwfLAlH0rPzCZOF0nOdqjgR8cWOg+b97J/Q1hff2wy5IfjhvmoqX Tdt4Q5vY25j9DvJWMndVXJnWk1atM8zV7XVbOQ43R51Lyd0cdTbuWRV0vrVY4H86VcGN aPCdr70hBXjmv2ye/Ibf/Lw9W8e0r3FgVjtym/vjd+85Coa61JTwmVk7G/5UdZC3fLg3 Shh904ui5ZZL8qmSK/VHLZTQf/D1PNSdgl4rqc+GkSGEa8XX4iTZer3w2HcbztICQCeG xptpLvFiPhgPcc0e1rk/dnPcLtqAOCRUDS0Q7Q1segztfWCyHmQ9pBISXoQBAOXoM0Od LVyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=hHvstYmH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h67si1750005pfk.15.2018.04.27.11.25.51; Fri, 27 Apr 2018 11:26:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=hHvstYmH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758023AbeD0SY3 (ORCPT + 99 others); Fri, 27 Apr 2018 14:24:29 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:45276 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757954AbeD0SY0 (ORCPT ); Fri, 27 Apr 2018 14:24:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=RRkAFkMuqOxWO/Lk3EklCIzEzyTF8Tww9Jskwql1uh4=; b=hHvstYmHyxQR bzYc8KV2NZgxE2gRdAld6lWEZv8J0R8EXj+zF4gm/w3SlfE/gMPuZHaXS+q8TdzSwReceOKP043U4 mNRASaVSL8XmlWf2Q9BHGcbaNi2TfAFboZK0R5fZuFMBhkc7JPIPQPk/pd4TqrIb+kvfuJQpFlG5Y g57+Q=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fC82d-0008QN-SE; Fri, 27 Apr 2018 18:24:19 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1fC82d-0004JA-E2; Fri, 27 Apr 2018 19:24:19 +0100 From: Mark Brown To: Jean-Jacques Hiblot Cc: Mark Brown , broonie@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, perex@perex.cz, tiwai@suse.com, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, afd@ti.com, dannenberg@ti.com, alsa-devel@alsa-project.org Subject: Applied "ASoC: tas6424: Add support for the standby pin" to the asoc tree In-Reply-To: <1524837349-16350-2-git-send-email-jjhiblot@ti.com> Message-Id: Date: Fri, 27 Apr 2018 19:24:19 +0100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: tas6424: Add support for the standby pin has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From e3976aa6fb409aea3cea812f6a0beebb545e5996 Mon Sep 17 00:00:00 2001 From: Jean-Jacques Hiblot Date: Fri, 27 Apr 2018 15:55:47 +0200 Subject: [PATCH] ASoC: tas6424: Add support for the standby pin The standby pin can be connected to a GPIO. In that case we have to drive it to the correct values for the TAS6424 to operate properly. Signed-off-by: Jean-Jacques Hiblot Signed-off-by: Mark Brown --- .../devicetree/bindings/sound/ti,tas6424.txt | 1 + sound/soc/codecs/tas6424.c | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/ti,tas6424.txt b/Documentation/devicetree/bindings/sound/ti,tas6424.txt index 1c4ada0eef4e..df71e414dc5b 100644 --- a/Documentation/devicetree/bindings/sound/ti,tas6424.txt +++ b/Documentation/devicetree/bindings/sound/ti,tas6424.txt @@ -6,6 +6,7 @@ Required properties: - compatible: "ti,tas6424" - TAS6424 - reg: I2C slave address - sound-dai-cells: must be equal to 0 + - standby-gpios: GPIO used to shut the TAS6424 down. Example: diff --git a/sound/soc/codecs/tas6424.c b/sound/soc/codecs/tas6424.c index 4f3a16c520a2..5abb17f8d3dd 100644 --- a/sound/soc/codecs/tas6424.c +++ b/sound/soc/codecs/tas6424.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -43,6 +44,7 @@ struct tas6424_data { unsigned int last_fault1; unsigned int last_fault2; unsigned int last_warn; + struct gpio_desc *standby_gpio; }; /* @@ -627,6 +629,22 @@ static int tas6424_i2c_probe(struct i2c_client *client, return ret; } + /* + * Get control of the standby pin and set it LOW to take the codec + * out of the stand-by mode. + * Note: The actual pin polarity is taken care of in the GPIO lib + * according the polarity specified in the DTS. + */ + tas6424->standby_gpio = devm_gpiod_get_optional(dev, "standby", + GPIOD_OUT_LOW); + if (IS_ERR(tas6424->standby_gpio)) { + if (PTR_ERR(tas6424->standby_gpio) == -EPROBE_DEFER) + return -EPROBE_DEFER; + dev_info(dev, "failed to get standby GPIO: %ld\n", + PTR_ERR(tas6424->standby_gpio)); + tas6424->standby_gpio = NULL; + } + for (i = 0; i < ARRAY_SIZE(tas6424->supplies); i++) tas6424->supplies[i].supply = tas6424_supply_names[i]; ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(tas6424->supplies), @@ -671,6 +689,10 @@ static int tas6424_i2c_remove(struct i2c_client *client) cancel_delayed_work_sync(&tas6424->fault_check_work); + /* put the codec in stand-by */ + if (tas6424->standby_gpio) + gpiod_set_value_cansleep(tas6424->standby_gpio, 1); + ret = regulator_bulk_disable(ARRAY_SIZE(tas6424->supplies), tas6424->supplies); if (ret < 0) { -- 2.17.0