From patchwork Mon Jun 10 17:10:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 166350 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1273667ilk; Mon, 10 Jun 2019 10:13:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfE7KIRorlpeFN8uJaYb96X9xG7/Zm5lR3iMzsl/WqWcymHi8HVoYTVqoRlD3dERatAV4X X-Received: by 2002:a62:1a8e:: with SMTP id a136mr37355703pfa.22.1560186783624; Mon, 10 Jun 2019 10:13:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560186783; cv=none; d=google.com; s=arc-20160816; b=h0NshNS7+asJ320kTmdWFfLpmwFBjgSkjHyn4y9xhoFJH03WtDSBb1kxGsGK4AXkIB xswtW1gw0rnUyzL9KHIr7VwEd5S3rVynSYgE4BoCL/RgX40SvSVdJNscZLp30tUxNqUD nSuGIwPnkcdblun0cKb/YbgmggdzTKsGPvPYB9DsH7yu0pc4heXZ8viySDNLJr2v5QlO 5eAYsDxmVWMrNl5CLetAQVSE0Uc8Z2bDyil+RX7EserCL9h3PBRbBLgcS6HUyfYp68K3 aYEUJ876TW7h5YXjxOAjX53wkeiPPYgNdSZqEZdUJbKtNL9IunsEI8qk91GI5v4A/msz Sg4Q== 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; bh=xjRoLjnZEnJ71XstATMS/Qw07MjkUWg7z73ux8r3eP4=; b=IsKxvnTRj3cnfLRiVZSerOg7q/NcT7yk83Ua3aLPniAVbei1uiJVSom19eIPZVKHlS 3j4je7K9dIDNtTW08Kmy/IuECVnhHhw4dwFJ/+0vpj0hUxn4clzNZBW389jVVVRn9xXK DiP0E1Qox9cgfwZbJoAuFKH/dMABLPHFwgL2OYaHaHdYe8w4TJ3Yi23YhDYAuUjAyinK B/7esUasbUJqgw94Rd11N7tzKz1q/yaRDMtTdVOpLiR09nMeUK/K8B+dG6mpK/ZfXRyy +L7NfVvlZRv1Sklk38nXVhyapQQgarE5OWkPOYfSrukCvsOYbx+xTF1AlauFjsuPhqbD 6V0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=hKs2ui5x; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-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 q65si8334215pga.325.2019.06.10.10.13.03; Mon, 10 Jun 2019 10:13:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-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=hKs2ui5x; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-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 S2387860AbfFJRNC (ORCPT + 5 others); Mon, 10 Jun 2019 13:13:02 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:44568 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387500AbfFJRNC (ORCPT ); Mon, 10 Jun 2019 13:13:02 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x5AHCqad121864; Mon, 10 Jun 2019 12:12:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1560186772; bh=xjRoLjnZEnJ71XstATMS/Qw07MjkUWg7z73ux8r3eP4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=hKs2ui5xVlE0RGBLpR5vSl8TSEXRTmLazxkxMa6607ZggvtbLK+6GpS+rd1qDHsLQ EfxfuJq/2pG+85yrxvFltTycXKGIX0/2MJTDD7VUWCfeIFPlYTT2EZOdJHvIvJa+pU SGB1S2vPr6j/B1YgbMegGZIbaAyQz6/xUc0tAEl8= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x5AHCqSO011507 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 10 Jun 2019 12:12:52 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 10 Jun 2019 12:12:52 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Mon, 10 Jun 2019 12:12:52 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x5AHCp2L067873; Mon, 10 Jun 2019 12:12:52 -0500 From: Grygorii Strashko To: Russell King , Linus Walleij , Tony Lindgren CC: Bartosz Golaszewski , , , , Santosh Shilimkar , Russell King , Grygorii Strashko Subject: [PATCH-next 15/20] gpio: gpio-omap: remove dataout variation in context handling Date: Mon, 10 Jun 2019 20:10:58 +0300 Message-ID: <20190610171103.30903-16-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190610171103.30903-1-grygorii.strashko@ti.com> References: <20190610171103.30903-1-grygorii.strashko@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Russell King When a GPIO block has the set/clear dataout registers implemented, it also has the normal dataout register implemented. Reading this register reads the current GPIO output state, and writing it sets the GPIOs to the explicit state. This is the behaviour that we want when saving and restoring the context, so use the dataout register exclusively. Signed-off-by: Russell King Signed-off-by: Grygorii Strashko --- drivers/gpio/gpio-omap.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index a90e27d7ce5e..c24a91b2df97 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1087,11 +1087,7 @@ static void omap_gpio_init_context(struct gpio_bank *p) p->context.fallingdetect = readl_relaxed(base + regs->fallingdetect); p->context.irqenable1 = readl_relaxed(base + regs->irqenable); p->context.irqenable2 = readl_relaxed(base + regs->irqenable2); - - if (regs->set_dataout && p->regs->clr_dataout) - p->context.dataout = readl_relaxed(base + regs->set_dataout); - else - p->context.dataout = readl_relaxed(base + regs->dataout); + p->context.dataout = readl_relaxed(base + regs->dataout); p->context_valid = true; } @@ -1109,11 +1105,7 @@ static void omap_gpio_restore_context(struct gpio_bank *bank) bank->base + bank->regs->risingdetect); writel_relaxed(bank->context.fallingdetect, bank->base + bank->regs->fallingdetect); - if (bank->regs->set_dataout && bank->regs->clr_dataout) - writel_relaxed(bank->context.dataout, - bank->base + bank->regs->set_dataout); - else - writel_relaxed(bank->context.dataout, + writel_relaxed(bank->context.dataout, bank->base + bank->regs->dataout); writel_relaxed(bank->context.oe, bank->base + bank->regs->direction);