Received: by 10.192.165.156 with SMTP id m28csp1485417imm; Wed, 11 Apr 2018 20:59:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx48J/F4j4JbrVIknPVFsxOk4t9h0QurgFaV+p6+xwwmOkRuJoGGc/jvhH5TF7LHCTJclajJ4 X-Received: by 10.101.87.138 with SMTP id b10mr5375157pgr.241.1523505547324; Wed, 11 Apr 2018 20:59:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523505547; cv=none; d=google.com; s=arc-20160816; b=RxNgrlnkgUz6aJFvpQ+JZ7l9eRv3ThqmcRat73sfLHoHsm6ufgOOx4Xmggf/6Rt4+4 cjmAU+l+zhaJ6rAACmckEzW1dUOaswixpkwkl1RjxnwowqbYsKV59w3C3Yh/NhHv64DS jTMHQ1Ce2LecPkmxaIkN3FZ2qIqdJrdCjknk2yfPpoIfMQsLZZUeRYB314enNQRoeOD5 0vqxq0zFidg32GWLettUI1zNZLn45EsoNSl7TfZRn/Hf72KKxj/irZtFE5HfVUTnCSIR CDG2dJqU0gBjAfNzrTJ3hClqNexlRRO8abrrfmZg0fIEywTOItIGJCf20lLDp40YDGXC ojbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=8YfNehC/pFV7UeGss9eNYS8JB8z09GvRfE1o1Z5AyU8=; b=JyPSTli5bHuKAoKPyvAFg8LZ8C3mba6ioC1CyEqlOb0THD1YIeqt3EqmarHSbMtJ/y hBK6JR6KZa1sSwsb71U93oWa+4IqRPt+ivNNzw2r1r8azs3KPgs7cv4Yzb/HKPPuF5GW gx6mWorylNKdxVbXDv5VYYteH7eNAUbbVPaaW/OCG3UAoTfMWS1QXE5dYUexJ/3KYZBo 8ESdJJHMZdGXCMmdtPtUHE9p8w52BiJJXJNWbBLjKydIhTKYExhio2HSd9pyQ0mLvobk DGjgc6DJNIqFKTiz3aLGP7UC7RT46Pq1SZQR4fn352l2+zamhySXKSfofQK1E6VwtSo0 UnpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Eh72VP0b; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6-v6si2557711plz.562.2018.04.11.20.58.30; Wed, 11 Apr 2018 20:59:07 -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=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Eh72VP0b; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752930AbeDLDzb (ORCPT + 99 others); Wed, 11 Apr 2018 23:55:31 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:58133 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752866AbeDLDz1 (ORCPT ); Wed, 11 Apr 2018 23:55:27 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3C3t7a9027045; Wed, 11 Apr 2018 22:55:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1523505308; bh=yTkHgUpxuXn28EzmlY/L9Gt0W3PHDXkH/3KxP7vAiHQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Eh72VP0bN7ss0ghj25VbloDKSua2n5EP/dR1caizKaqhlneRf7BAdDp0VeKVa+5Of Kjtty/AVS32OEqDtaU7ruEavXjbbxBHF/oY129lL4EbefT9p7KXlGL3STu+uCgFh7Q alwFSy/MkMnvZJlI0Edd4UWdarwx7K04MlUKQ0EU= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3C3t7jE027126; Wed, 11 Apr 2018 22:55:07 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Wed, 11 Apr 2018 22:55:07 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Wed, 11 Apr 2018 22:55:07 -0500 Received: from ula0393675.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3C3sQpr010150; Wed, 11 Apr 2018 22:55:04 -0500 From: Keerthy To: , , CC: , , , , , , , , Subject: [PATCH 10/14] gpio: omap: Drop the concept of gpio banks not being able to lose context. Date: Thu, 12 Apr 2018 09:23:55 +0530 Message-ID: <1523505239-16229-11-git-send-email-j-keerthy@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1523505239-16229-1-git-send-email-j-keerthy@ti.com> References: <1523505239-16229-1-git-send-email-j-keerthy@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Russ Dill It isn't much of a win, and with hibernation, everything loses context. Signed-off-by: Russ Dill Signed-off-by: Keerthy --- drivers/gpio/gpio-omap.c | 38 ++++++++++++--------------------- include/linux/platform_data/gpio-omap.h | 1 - 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 35971a3..34fde30 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -68,7 +68,7 @@ struct gpio_bank { bool dbck_enabled; bool is_mpuio; bool dbck_flag; - bool loses_context; + bool context_valid; int stride; u32 width; @@ -1198,15 +1198,9 @@ static int omap_gpio_probe(struct platform_device *pdev) #ifdef CONFIG_OF_GPIO bank->chip.of_node = of_node_get(node); #endif - if (node) { - if (!of_property_read_bool(node, "ti,gpio-always-on")) - bank->loses_context = true; - } else { - bank->loses_context = pdata->loses_context; - - if (bank->loses_context) - bank->get_context_loss_count = - pdata->get_context_loss_count; + if (!node) { + bank->get_context_loss_count = + pdata->get_context_loss_count; } if (bank->regs->set_dataout && bank->regs->clr_dataout) @@ -1365,7 +1359,7 @@ static int omap_gpio_runtime_resume(struct device *dev) * been initialised and so initialise it now. Also initialise * the context loss count. */ - if (bank->loses_context && !bank->context_valid) { + if (!bank->context_valid) { omap_gpio_init_context(bank); if (bank->get_context_loss_count) @@ -1386,17 +1380,13 @@ static int omap_gpio_runtime_resume(struct device *dev) writel_relaxed(bank->context.risingdetect, bank->base + bank->regs->risingdetect); - if (bank->loses_context) { - if (!bank->get_context_loss_count) { - omap_gpio_restore_context(bank); - } else { - c = bank->get_context_loss_count(dev); - if (c != bank->context_loss_count) { - omap_gpio_restore_context(bank); - } else { - raw_spin_unlock_irqrestore(&bank->lock, flags); - return 0; - } + if (!bank->get_context_loss_count) { + omap_gpio_restore_context(bank); + } else { + c = bank->get_context_loss_count(bank->chip.parent); + if (c != bank->context_loss_count) { + raw_spin_unlock_irqrestore(&bank->lock, flags); + return 0; } } @@ -1468,7 +1458,7 @@ void omap2_gpio_prepare_for_idle(int pwr_mode) struct gpio_bank *bank; list_for_each_entry(bank, &omap_gpio_list, node) { - if (!BANK_USED(bank) || !bank->loses_context) + if (!BANK_USED(bank)) continue; bank->power_mode = pwr_mode; @@ -1482,7 +1472,7 @@ void omap2_gpio_resume_after_idle(void) struct gpio_bank *bank; list_for_each_entry(bank, &omap_gpio_list, node) { - if (!BANK_USED(bank) || !bank->loses_context) + if (!BANK_USED(bank)) continue; pm_runtime_get_sync(bank->chip.parent); diff --git a/include/linux/platform_data/gpio-omap.h b/include/linux/platform_data/gpio-omap.h index 8612855..77eb187 100644 --- a/include/linux/platform_data/gpio-omap.h +++ b/include/linux/platform_data/gpio-omap.h @@ -193,7 +193,6 @@ struct omap_gpio_platform_data { int bank_width; /* GPIO bank width */ int bank_stride; /* Only needed for omap1 MPUIO */ bool dbck_flag; /* dbck required or not - True for OMAP3&4 */ - bool loses_context; /* whether the bank would ever lose context */ bool is_mpuio; /* whether the bank is of type MPUIO */ u32 non_wakeup_gpios; -- 1.9.1