From patchwork Thu Apr 4 16:57:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 161805 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1836670jan; Thu, 4 Apr 2019 09:57:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwauVtrj7kxKhdSG0ztF3xzNZRuPrBqQFIvX0ijRhjvoagesqNK0sbUXyjlTySZ8n07xvGG X-Received: by 2002:aa7:92c4:: with SMTP id k4mr7033463pfa.183.1554397045333; Thu, 04 Apr 2019 09:57:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554397045; cv=none; d=google.com; s=arc-20160816; b=jPK0FLA5LlDMjZWOjYbKkWRBPbsRaZHJ4ik1ArUwMc0p2EpiCBEC33ujjcaXND3xSd CLOM4ushdIcSTYttFWstQASyklVS9c+jdXJtTVXVII+5TbO8Lm5V6cXxIJYTplgJBGKI pZVnVuHYKkVBzPZyzgEUTXCT5YKWINbRz1kcAOCXCOnqT5lqfUMZkkGH1Qop8M/6SeZj Eu3SCOs7x0+xGYi6xWL1v/uCMtgyAWrW/tCT0aFffMFUdbCZzccaRNJumhmN5EX140sR WKVxepEzaZLd9HN8+bfv6dXQs3t8LKmVeHSeRlx0J99YdvOqb/OOBSvvbrJrE5t6sDoa 0n1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=yjMQ9Vlvs5BEfZfWVqNoaGRTvRqqyHx6lQcQNTKCxFc=; b=CBbBvOjBRClYhnhUKdVPTjeFDN+9C6pECUb6Z1xuf+Ljeh+CYipCTEg0h07yJrEgUA 4sNE3iMVfwr7th3YlPrj9llfFOFYJ5283hKo/y1Xf0VZ6OegWl9aQ7Y4ZFlF5H7kcFUq 8fI0GKo+eL67ZOkjeVbl7RMEwUleVonwa7OyZgPrvmyGaRXXlMvQqAk/TFQ7lVFG18Rh eY0oQSZSBoddVvHTnDRRqV7ep+hicc/apqULcVNsCJriJvezM8daBZyvSwtDhiDWcaU2 1IelVVuSk1kYgJ64vS8J8XIy+sHRHzTP0NGhEmeA7fuJIGn1OFO9sSowNyvtB8dDEue2 1v8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jzQyPa81; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cn16si17510922plb.174.2019.04.04.09.57.25; Thu, 04 Apr 2019 09:57:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-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=@linaro.org header.s=google header.b=jzQyPa81; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728762AbfDDQ5Y (ORCPT + 5 others); Thu, 4 Apr 2019 12:57:24 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:40732 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727415AbfDDQ5Y (ORCPT ); Thu, 4 Apr 2019 12:57:24 -0400 Received: by mail-pl1-f193.google.com with SMTP id b3so1451881plr.7 for ; Thu, 04 Apr 2019 09:57:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yjMQ9Vlvs5BEfZfWVqNoaGRTvRqqyHx6lQcQNTKCxFc=; b=jzQyPa81/h/ReQ0/TBDjpDvuzreYyHSjXUB0OOnoM2OcInElewp6wZu7AQL4k5ol5P 0AVYY+9IYmYBFDJYlG9IhqyydAk8SvPj56FIQR6zxPsFF9iWe0i+ymd5vNG9KsppKIBT Erb0XHYIa/qbHZltIupsoTnnl+rx4a4uKmfXQQF6d+YkOZ7sRMPC/H4IC0zcBP+4aRZe CHfijFRKeYvcRgE1yhRR4kw/6RzDK/3VYrpXn1bZN3AJQ5VYW7GU8fk8apBZjoFM0xgG VmRRX9MpOqp67+Y6l6zwgEd+PeueI8EiEjWXbrCZjEBKono4KUtk+lNF+aigNyN5DMnx eL/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yjMQ9Vlvs5BEfZfWVqNoaGRTvRqqyHx6lQcQNTKCxFc=; b=CHbhY3qfvx/4C6sAfkPjJdNvdtkET7NgPF+lQ92qwUKRyOKdncVefvBiqhCtxLI+cA TC2sBCW1KmGl3qBAHze9bff+ACGQG8OSiY2CFunV9H3B8XNimWdBxZ70AoEz40UTpl/J LbdIrjwsclZlJ3V9jiXRJeirOvbCeiRO94rlU3TiYFlmNrN48duMQoWuuG1lomje031f MMZmeTyOD9EvWm8TObzDIsrihTVWn7G0yDWnX4r08lY3aTOwhazn5a9RFULxI1oBwlzE l7uHwjQlV6IwMM79fAjPtX6kafzIbUvSfWPi/3H1a8AQKUHWQ0XMmjryJptEOXcHnmtR wiIw== X-Gm-Message-State: APjAAAWQs/M58wiXbveZTGmqpivrWeVIC3ZzCanEK1D4IUR6C4T7CbOL 8jgoFaK8IzMAD/WydLSz76xq8dVt49w= X-Received: by 2002:a17:902:28a7:: with SMTP id f36mr7151372plb.169.1554397043418; Thu, 04 Apr 2019 09:57:23 -0700 (PDT) Received: from genomnajs.imgcgcw.net ([147.50.13.10]) by smtp.gmail.com with ESMTPSA id e123sm32002398pgc.14.2019.04.04.09.57.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Apr 2019 09:57:22 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Bartosz Golaszewski , Linus Walleij , Jan Kotas Subject: [PATCH] gpio: mmio: Drop bgpio_dir_inverted Date: Thu, 4 Apr 2019 23:57:15 +0700 Message-Id: <20190404165715.4237-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The direction inversion semantics are now handled by simply using the registers for in/out available, no need to keep track of inversion semantics exmplicitly anymore. Cc: Jan Kotas Signed-off-by: Linus Walleij --- drivers/gpio/gpio-mmio.c | 7 ------- include/linux/gpio/driver.h | 4 ---- 2 files changed, 11 deletions(-) -- 2.20.1 Reviewed-by: Bartosz Golaszewski diff --git a/drivers/gpio/gpio-mmio.c b/drivers/gpio/gpio-mmio.c index 04be18b95485..6f904c874678 100644 --- a/drivers/gpio/gpio-mmio.c +++ b/drivers/gpio/gpio-mmio.c @@ -533,13 +533,6 @@ static int bgpio_setup_direction(struct gpio_chip *gc, gc->direction_output = bgpio_dir_out; gc->direction_input = bgpio_dir_in; gc->get_direction = bgpio_get_dir; - /* - * If only dirin is available, this means we need - * inverted semantics when handling get/set registers - * so detect this here. - */ - if (dirin && !dirout) - gc->bgpio_dir_inverted = true; } else { if (flags & BGPIOF_NO_OUTPUT) gc->direction_output = bgpio_dir_out_err; diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 95a51794c24a..4d69d458cf9f 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -229,9 +229,6 @@ struct gpio_irq_chip { * @reg_clr: output clear register (out=low) for generic GPIO * @reg_dir_out: direction out setting register for generic GPIO * @reg_dir_in: direction in setting register for generic GPIO - * @bgpio_dir_inverted: indicates that the direction register is inverted - * (gpiolib private state variable) this means @reg_dir_in is - * available but not @reg_dir_out. * @bgpio_dir_unreadable: indicates that the direction register(s) cannot * be read and we need to rely on out internal state tracking. * @bgpio_bits: number of register bits used for a generic GPIO i.e. @@ -305,7 +302,6 @@ struct gpio_chip { void __iomem *reg_clr; void __iomem *reg_dir_out; void __iomem *reg_dir_in; - bool bgpio_dir_inverted; bool bgpio_dir_unreadable; int bgpio_bits; spinlock_t bgpio_lock;