From patchwork Thu Oct 29 22:31:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatol Pomozov X-Patchwork-Id: 7521671 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 A5810BEEA4 for ; Thu, 29 Oct 2015 22:32:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C1BC2207BE for ; Thu, 29 Oct 2015 22:32:22 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 5C77520789 for ; Thu, 29 Oct 2015 22:32:21 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E8F10265A12; Thu, 29 Oct 2015 23:32:19 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 2904D265558; Thu, 29 Oct 2015 23:32:12 +0100 (CET) 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 27B3E2657FC; Thu, 29 Oct 2015 23:32:11 +0100 (CET) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by alsa0.perex.cz (Postfix) with ESMTP id 2CE4B2651A5 for ; Thu, 29 Oct 2015 23:32:04 +0100 (CET) Received: by padhk11 with SMTP id hk11so52972435pad.1 for ; Thu, 29 Oct 2015 15:32:03 -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=Ec7WtuAMBq+CgydPpfth0YRdzPDVgDThXgzwEubj2Zo=; b=ObcwFsGRnklHAhiNzPdxvDxwHH2qlkiMinjD2EINPQlauv+jxMyBidFV0OBzDD8o22 +mPtQiE2ZRfmZVSh2VMaSCvB5Md8Ap7F2afQcdSw3r7vBeZ2EQJbj1gNhDTcRPC+r/t9 f1+0AfxnWnFC+2LPjKaZJyXvCAROCMVYCASoAPHzJhQZQWF2vtsXVR5Us3m0zHsWRiV7 Y6g6+P6+m5+9x35j3r7Ez3iH2A5YrhFY/3YwyBrmgN6y7FN+la3fEHjdIwq4EisMZXIp D6/vWap57vp0D67bvUsmmuR4qohDcVWSKRBFk7BGPhTfKXCT+1Zy7VPI7w4el1NCRlQR V0EA== X-Received: by 10.66.253.197 with SMTP id ac5mr4650393pad.136.1446157923202; Thu, 29 Oct 2015 15:32:03 -0700 (PDT) Received: from anatol.mtv.corp.google.com ([172.22.64.197]) by smtp.gmail.com with ESMTPSA id it10sm4231120pbc.14.2015.10.29.15.32.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Oct 2015 15:32:02 -0700 (PDT) From: Anatol Pomozov To: alsa-devel@alsa-project.org, broonie@kernel.org Date: Thu, 29 Oct 2015 15:31:59 -0700 Message-Id: <1446157919-27151-1-git-send-email-anatol.pomozov@gmail.com> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 Cc: oder_chiou@realtek.com, Anatol Pomozov Subject: [alsa-devel] [PATCH] ASoC: rt5677: use 'active low' logic for reset pin 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 According to the datasheet RESET is active low pin, i.e. system goes to reset state when pin signal is low. The previous implementeation was assuming the pin is configured as 'active high' in DTS. Changle the gpio handling code and DTS configuration to 'active low'. Signed-off-by: Anatol Pomozov --- Documentation/devicetree/bindings/sound/rt5677.txt | 2 +- sound/soc/codecs/rt5677.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/rt5677.txt b/Documentation/devicetree/bindings/sound/rt5677.txt index f070789..1b3c13d 100644 --- a/Documentation/devicetree/bindings/sound/rt5677.txt +++ b/Documentation/devicetree/bindings/sound/rt5677.txt @@ -18,7 +18,7 @@ Required properties: Optional properties: - realtek,pow-ldo2-gpio : The GPIO that controls the CODEC's POW_LDO2 pin. -- realtek,reset-gpio : The GPIO that controls the CODEC's RESET pin. +- realtek,reset-gpio : The GPIO that controls the CODEC's RESET pin. Active low. - realtek,in1-differential - realtek,in2-differential diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index b4cd7e3..f73fd12 100644 --- a/sound/soc/codecs/rt5677.c +++ b/sound/soc/codecs/rt5677.c @@ -4766,7 +4766,7 @@ static int rt5677_remove(struct snd_soc_codec *codec) regmap_write(rt5677->regmap, RT5677_RESET, 0x10ec); gpiod_set_value_cansleep(rt5677->pow_ldo2, 0); - gpiod_set_value_cansleep(rt5677->reset_pin, 0); + gpiod_set_value_cansleep(rt5677->reset_pin, 1); return 0; } @@ -4781,7 +4781,7 @@ static int rt5677_suspend(struct snd_soc_codec *codec) regcache_mark_dirty(rt5677->regmap); gpiod_set_value_cansleep(rt5677->pow_ldo2, 0); - gpiod_set_value_cansleep(rt5677->reset_pin, 0); + gpiod_set_value_cansleep(rt5677->reset_pin, 1); } return 0; @@ -4793,7 +4793,7 @@ static int rt5677_resume(struct snd_soc_codec *codec) if (!rt5677->dsp_vad_en) { gpiod_set_value_cansleep(rt5677->pow_ldo2, 1); - gpiod_set_value_cansleep(rt5677->reset_pin, 1); + gpiod_set_value_cansleep(rt5677->reset_pin, 0); if (rt5677->pow_ldo2 || rt5677->reset_pin) msleep(10); @@ -5138,7 +5138,7 @@ static int rt5677_i2c_probe(struct i2c_client *i2c, return ret; } rt5677->reset_pin = devm_gpiod_get_optional(&i2c->dev, - "realtek,reset", GPIOD_OUT_HIGH); + "realtek,reset", GPIOD_OUT_LOW); if (IS_ERR(rt5677->reset_pin)) { ret = PTR_ERR(rt5677->reset_pin); dev_err(&i2c->dev, "Failed to request RESET: %d\n", ret);