Received: by 10.192.165.148 with SMTP id m20csp1032187imm; Fri, 27 Apr 2018 11:26:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqx2bi09z20wHl1yhe8R4crMtTWd3Fqe6UylXgFSnnb//qrOsA3Shrwh5dMeqzLT5iZQ/1T X-Received: by 2002:a17:902:d681:: with SMTP id v1-v6mr3203259ply.16.1524853577408; Fri, 27 Apr 2018 11:26:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524853577; cv=none; d=google.com; s=arc-20160816; b=eJ4Ci0oygAWEEurGjehnW6V90ebBHFR+BLRpGlHNv5++o8P/ucTj5o8SSu1dF1Zic+ oLY61Ku8jjoFpv1FqI8Zi99SjUdgKbIU7capLbqqk0AVz+QIfg/GDQHuNZQb6OLlsJh+ tYCNjOkX6l9EiqGY6aal3YQRtaAXABmRW0QwuxQx8TdHjtaAsFEYP8fBEPxbVPXwq2P8 yezdNit7adGLzqhTe2Av0kEwFm8lI0XQvwfv+uwLwjlFUvEuDAtivxR71SxjepvJ4x2d Y9hB1rVIPHThPrObBWdBUiyNL7o3c8H3AwGloc2+MP1wmptiA5sLoaao8mh63FJT6AHU ENNw== 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=+5fqLbs9fZCyLOYxhwWikSdsRoWMHcfhmh0tip3wNUM=; b=npamgYbJmDpXKdmjmzzB+P5SJt1kjtMqvM43QwhCRsRu3Uh9CegcctTb9i6gAU1HEj anR3R5xMKfUU1DFGNs+c4B5EloopnfZW8Z3Pp35iVAr6Rc0ZSRzEkkdTUufMoY2YWmoY 5ll6/YUvsOzstvu020lDElpztwQAO8G4Mg6UFhGO5+4Quqj+ntyJLi1hUzl1+EKlIF+c WFc0aFKE/COm1+3uL+ZuS0nvhpO3/AktGtJG7HiD5S0gQr2Q5ZLU2fpRkv5wj5sxjIUZ Y1aODbB5TGhZZJuEaEz0+CC8yriSOkv8apSPcwDGVjRz/mteJ4MYxN7pAgkqQRV7CXf5 qS7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=RwTOPUbS; 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 i11-v6si1617466pgv.220.2018.04.27.11.26.03; Fri, 27 Apr 2018 11:26:17 -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=RwTOPUbS; 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 S932489AbeD0SY2 (ORCPT + 99 others); Fri, 27 Apr 2018 14:24:28 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:45246 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757523AbeD0SY0 (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=+5fqLbs9fZCyLOYxhwWikSdsRoWMHcfhmh0tip3wNUM=; b=RwTOPUbSPD4d gmCHWDJ4NvXC1L/6Nd4AqkJylxeQjlKi+PbTs8zAOzvF42yy0mzzWYMrkmX40ic4xseWeuLipGf4k 842nNH7SyoV4OXGLteYMTVoNKgidgig13YydCdleVdfkVLoJr/VrrtE8Yp4aCw240YfnWQ3Rt1W9w YAAOM=; 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 1fC82a-0008QI-Lb; Fri, 27 Apr 2018 18:24:16 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1fC82Z-0004Hf-PP; Fri, 27 Apr 2018 19:24:15 +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 mute pin" to the asoc tree In-Reply-To: <1524837349-16350-3-git-send-email-jjhiblot@ti.com> Message-Id: Date: Fri, 27 Apr 2018 19:24:15 +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 mute 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 e969a6d222c9da87c6b5978674788faf5c58a07d Mon Sep 17 00:00:00 2001 From: Jean-Jacques Hiblot Date: Fri, 27 Apr 2018 15:55:48 +0200 Subject: [PATCH] ASoC: tas6424: Add support for the mute pin mute can be connected to GPIO. In that case we have to drive it to the correct value Signed-off-by: Jean-Jacques Hiblot Signed-off-by: Mark Brown --- .../devicetree/bindings/sound/ti,tas6424.txt | 1 + sound/soc/codecs/tas6424.c | 37 ++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/sound/ti,tas6424.txt b/Documentation/devicetree/bindings/sound/ti,tas6424.txt index df71e414dc5b..eacb54f34188 100644 --- a/Documentation/devicetree/bindings/sound/ti,tas6424.txt +++ b/Documentation/devicetree/bindings/sound/ti,tas6424.txt @@ -7,6 +7,7 @@ Required properties: - reg: I2C slave address - sound-dai-cells: must be equal to 0 - standby-gpios: GPIO used to shut the TAS6424 down. + - mute-gpios: GPIO used to mute all the outputs Example: diff --git a/sound/soc/codecs/tas6424.c b/sound/soc/codecs/tas6424.c index 5abb17f8d3dd..89fd0c1b3903 100644 --- a/sound/soc/codecs/tas6424.c +++ b/sound/soc/codecs/tas6424.c @@ -45,6 +45,7 @@ struct tas6424_data { unsigned int last_fault2; unsigned int last_warn; struct gpio_desc *standby_gpio; + struct gpio_desc *mute_gpio; }; /* @@ -251,10 +252,16 @@ static int tas6424_set_dai_tdm_slot(struct snd_soc_dai *dai, static int tas6424_mute(struct snd_soc_dai *dai, int mute) { struct snd_soc_component *component = dai->component; + struct tas6424_data *tas6424 = snd_soc_component_get_drvdata(component); unsigned int val; dev_dbg(component->dev, "%s() mute=%d\n", __func__, mute); + if (tas6424->mute_gpio) { + gpiod_set_value_cansleep(tas6424->mute_gpio, mute); + return 0; + } + if (mute) val = TAS6424_ALL_STATE_MUTE; else @@ -289,6 +296,7 @@ static int tas6424_power_on(struct snd_soc_component *component) { struct tas6424_data *tas6424 = snd_soc_component_get_drvdata(component); int ret; + u8 chan_states; ret = regulator_bulk_enable(ARRAY_SIZE(tas6424->supplies), tas6424->supplies); @@ -305,7 +313,18 @@ static int tas6424_power_on(struct snd_soc_component *component) return ret; } - snd_soc_component_write(component, TAS6424_CH_STATE_CTRL, TAS6424_ALL_STATE_MUTE); + if (tas6424->mute_gpio) { + gpiod_set_value_cansleep(tas6424->mute_gpio, 0); + /* + * channels are muted via the mute pin. Don't also mute + * them via the registers so that subsequent register + * access is not necessary to un-mute the channels + */ + chan_states = TAS6424_ALL_STATE_PLAY; + } else { + chan_states = TAS6424_ALL_STATE_MUTE; + } + snd_soc_component_write(component, TAS6424_CH_STATE_CTRL, chan_states); /* any time we come out of HIZ, the output channels automatically run DC * load diagnostics, wait here until this completes @@ -645,6 +664,22 @@ static int tas6424_i2c_probe(struct i2c_client *client, tas6424->standby_gpio = NULL; } + /* + * Get control of the mute pin and set it HIGH in order to start with + * all the output muted. + * Note: The actual pin polarity is taken care of in the GPIO lib + * according the polarity specified in the DTS. + */ + tas6424->mute_gpio = devm_gpiod_get_optional(dev, "mute", + GPIOD_OUT_HIGH); + if (IS_ERR(tas6424->mute_gpio)) { + if (PTR_ERR(tas6424->mute_gpio) == -EPROBE_DEFER) + return -EPROBE_DEFER; + dev_info(dev, "failed to get nmute GPIO: %ld\n", + PTR_ERR(tas6424->mute_gpio)); + tas6424->mute_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), -- 2.17.0