From patchwork Tue Apr 25 22:43:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Greer X-Patchwork-Id: 9699997 X-Patchwork-Delegate: sameo@linux.intel.com 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 B34B860245 for ; Tue, 25 Apr 2017 22:44:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A920721E5A for ; Tue, 25 Apr 2017 22:44:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9DC872846B; Tue, 25 Apr 2017 22:44:19 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4712921E5A for ; Tue, 25 Apr 2017 22:44:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1953216AbdDYWoS (ORCPT ); Tue, 25 Apr 2017 18:44:18 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:50387 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1953168AbdDYWn7 (ORCPT ); Tue, 25 Apr 2017 18:43:59 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 3270B208ED; Tue, 25 Apr 2017 18:43:58 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Tue, 25 Apr 2017 18:43:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=animalcreek.com; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=YSK wwXu5lcxbJolFWxGDeKkU8K1x0TSRQxbYsHCjVpw=; b=ddbAxaSA2vrfNMNJqj/ eINsuwB2dlZGnHODaD1HhXY57fCvKzgDcB4ysumBhrmlzzGG6MiJDk0uWnlWdH6/ alJtq7yCICu53+C5D35CmKEbUCeWRhYQOq20N/bffnf1EhoHFu+aOXicw2YYOfYh Wo4xs6wCdPkVzHx+VfuofqK8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=YSKwwXu5lcxbJolFWxGDeKkU8K1x0TSRQxbYsHCjV pw=; b=YxC2fMt5mBva4s95ej0wl+WamXwqMuhgzntIv2LlUorNmUC8E1HM5b5/x bxNCwxeYdWg1KxFVT0hgQCwpeNGF8qR855m1CAy7cK2+FetLuSaEW44hLiFbWUh5 vkpH1zolc8U2avL5UdZg3FdV8uX9pndtRoxKOwTTpI3WlR0k+Ajfm1dM4vxF0MAf +JzFzY/A9C3APmk4YlmAZbjKhzEX+cB8wr4HJ4xNVaiT8b/7ZrtcCHU7heQF1hDU j113pAaOclunBsR/IvvXn/na2YWYMCtv60xp5xQaPkf8sxVfb2mwhrTYKWtm4fyp ep7kYQst0IW7bVIn/6Aygl1ZpVlqA== X-ME-Sender: X-Sasl-enc: /xlfHEqcoe114Sl61cNa+n52ZoWpB7W1ZRMIRjfa7dJL 1493160237 Received: from blue.animalcreek.com (ip68-2-86-89.ph.ph.cox.net [68.2.86.89]) by mail.messagingengine.com (Postfix) with ESMTPA id E0F2A24741; Tue, 25 Apr 2017 18:43:57 -0400 (EDT) Received: from blue.animalcreek.com (localhost [127.0.0.1]) by blue.animalcreek.com (Postfix) with ESMTP id 37B89A222E2; Tue, 25 Apr 2017 15:43:57 -0700 (MST) From: Mark Greer To: Samuel Ortiz Cc: linux-wireless@vger.kernel.org, linux-nfc@lists.01.org, devicetree@vger.kernel.org, Mark Greer Subject: [PATCH v5 2/9] NFC: trf7970a: Don't de-assert EN2 unless it was asserted Date: Tue, 25 Apr 2017 15:43:49 -0700 Message-Id: <20170425224356.11498-3-mgreer@animalcreek.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170425224356.11498-1-mgreer@animalcreek.com> References: <20170425224356.11498-1-mgreer@animalcreek.com> Organization: Animal Creek Technologies, Inc. Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When the trf7970a part has the bug related to 'en2-rf-quirk', the GPIO connected to the EN2 pin will not be asserted by the driver when powering up so it shouldn't be de-asserted when powering down. Signed-off-by: Mark Greer --- drivers/nfc/trf7970a.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c index 2d1c8ca6e679..1a87525a88cd 100644 --- a/drivers/nfc/trf7970a.c +++ b/drivers/nfc/trf7970a.c @@ -1940,8 +1940,10 @@ static int trf7970a_power_down(struct trf7970a *trf) } gpio_set_value(trf->en_gpio, 0); - if (gpio_is_valid(trf->en2_gpio)) - gpio_set_value(trf->en2_gpio, 0); + + if (!(trf->quirks & TRF7970A_QUIRK_EN2_MUST_STAY_LOW)) + if (gpio_is_valid(trf->en2_gpio)) + gpio_set_value(trf->en2_gpio, 0); ret = regulator_disable(trf->regulator); if (ret)