From patchwork Wed Aug 24 19:03:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 9298547 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7570A60757 for ; Thu, 25 Aug 2016 01:19:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A3C62914B for ; Thu, 25 Aug 2016 01:19:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4ED9229150; Thu, 25 Aug 2016 01:19:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81F182914B for ; Thu, 25 Aug 2016 01:19:37 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6F8BC266D1F; Thu, 25 Aug 2016 03:19:36 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 4F0292671D2; Thu, 25 Aug 2016 02:57:44 +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 69F242671D2; Thu, 25 Aug 2016 02:57:43 +0200 (CEST) Received: from mail-pa0-f68.google.com (mail-pa0-f68.google.com [209.85.220.68]) by alsa0.perex.cz (Postfix) with ESMTP id C707E268380 for ; Wed, 24 Aug 2016 21:03:37 +0200 (CEST) Received: by mail-pa0-f68.google.com with SMTP id ez1so1649246pab.3 for ; Wed, 24 Aug 2016 12:03:37 -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=RiaXY3vLpm6nXtiwGqQFZAdVpkboihM6YGPGq195i94=; b=CzAFAY6TE0x444ZifHgTx9vA7DnCMb93sWiOwYtNLCsuEFnm0HcliyGRo9ws7THc3Y zvnOnOIpDuDlVTzHuybEULtc/dsA+yJA81A6/WZGRVf4e8ij+yNDw4U86Lo8pm/xlQ+R kBPJULQKEkbhtRvZsRBf2xpJ00fpfWjDE2qeQ29tLyjf8MZaoObJYPiKGyLyAp0RBAqk ZS72+YsCt3abNMj2KqloOcZ+pU7Vnobb4zjlEcpN3GvXqaKVJT2vDZsOGnfgtWXm3E44 LZ/T0MpID2OmciyX6YP/coHosXvb0Yg9Tx9dEGXgr9XmEtOLdDYGGhu765W2GISDq7kY u2ag== 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; bh=RiaXY3vLpm6nXtiwGqQFZAdVpkboihM6YGPGq195i94=; b=Kl5Z/F/8XvT0KJP3OqIoX+CtGdM6xLQm5O1TICy800mb39R/OGCM2ljHcU4ZO0m45U +VLfaZJ0BSrhdifdEddD0X9a/MAZYrlnF+D90TQ1NN1tWHYghJV66vwzBr8PKct6u7GG o5L0ZI4v2blaiaHdQhtmTAJ+22URNoChBDQfPpIUrFm/gCWptYJFmLQh0+sJtgyw6Ia/ 8G1qzsGIgOzZ4Kq7BHJXDT+hiUckgGa2M/nqDUQeBPxr85mgjiYBwHGKF5iLX8Fammbm zFjax3sRIOyFcUhOhwoYk3ITZGrQvg63ZYk2hYmj9z0hC/+BGLD0HN1/oC2Q6fbaPXl0 o68Q== X-Gm-Message-State: AE9vXwNDIQtb8RUocEvlKAKN1R070azwh4wEmeEXWunRkfPJgEUCtbvMLUuNaAU47vV5QA== X-Received: by 10.66.81.200 with SMTP id c8mr8711608pay.70.1472065416413; Wed, 24 Aug 2016 12:03:36 -0700 (PDT) Received: from Asurada-Nvidia.nvidia.com (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id 132sm15484503pfu.6.2016.08.24.12.03.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Aug 2016 12:03:35 -0700 (PDT) From: Nicolin Chen To: broonie@kernel.org, bardliao@realtek.com, oder_chiou@realtek.com Date: Wed, 24 Aug 2016 12:03:39 -0700 Message-Id: <1472065419-22058-1-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.1.4 Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] ASoC: rt5659: Enable IRQ output for GPIO1 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 Since it's possible to have an IRQ without enabling JD3, the GPIO1 pin then would remain its default GPIO function which is set as an input direction (seeing from rt5659). Meanwhile, CPU would also listen this connection via its own GPIO input: [input] [input] CPU GPIO <--------> RT5659 GPIO1 The result for the IRQ on the CPU side will be unexpectable. So this patch enables the IRQ output for GPIO1 pin any way as long as there's an IRQ assigned from platform data or DT: [input] [IRQ output] CPU GPIO <--------< RT5659 GPIO1 Signed-off-by: Nicolin Chen --- sound/soc/codecs/rt5659.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c index 4c0d2b8..db54550 100644 --- a/sound/soc/codecs/rt5659.c +++ b/sound/soc/codecs/rt5659.c @@ -4189,6 +4189,9 @@ static int rt5659_i2c_probe(struct i2c_client *i2c, if (ret) dev_err(&i2c->dev, "Failed to reguest IRQ: %d\n", ret); + /* Enable IRQ output for GPIO1 pin any way */ + regmap_update_bits(rt5659->regmap, RT5659_GPIO_CTRL_1, + RT5659_GP1_PIN_MASK, RT5659_GP1_PIN_IRQ); } return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5659,