Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp5881682ybx; Sun, 10 Nov 2019 23:45:34 -0800 (PST) X-Google-Smtp-Source: APXvYqymuEh45ur9Fvyz4XURPp9NDOqRU1dsHt8OPZCTXkN+MxjrRYunircKCk181+DeGkr5mhqx X-Received: by 2002:a50:e68c:: with SMTP id z12mr25755169edm.53.1573458334193; Sun, 10 Nov 2019 23:45:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573458334; cv=none; d=google.com; s=arc-20160816; b=tWoRur+8NBOa1AyVWJwKfTyROvPP7U2zFYZK2XEP3Rr6TmNT0dzm3dmEzawBm+aF79 PzIhQJbpG3rgxYipLNKjh3IlWWdvDwK1kaH/mRDqLdYqnQ1qxnkQiL0G0voHdCdIbFza yb/KWVcyqPe6qJIQlsWRFH2oFPH0q30zUfz/zXN4wk0a2qW3bCTZr5YoazcSqsWRmBBb N4moXyHU9qWGUs3cxUzMkLqtlJ/SW8ML4EF2sC39QAACoW+Ejt5cuJoGwJqB2BDQnM25 Qk97AR/zXkbDPFHNmMRzyWUOPPwN7ObQ9iVEGo1Z9+3+V26Zsts8PLBfehoyBTHDagQz Tw1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=3OUPFlXK9tKzPMh2Pafs9OmQN7jKlBIP9AozsyMwcFw=; b=gPBAcY0kEBcexy7yjbddyxXq482llwT3EeMkwseWgQyAVoOtGE9fqyZP62dECnHKjh 6+mpmw7cNZtW0i/snSIhCak7PtAHqvEblSu7jrUviLxQnDV9JhVFza/JVa2WNnjhhU36 6yS5I9xRwtCFU71VkYFlIlHi7pQZgr4W0AA6+w1jVpoqv67vHcwI9qIoEJtlpWxkXf/p VyUhLrJbWcXIaN9GgQjfWUIiY/5LDI5ab5gJvCEFVwGnwEYrTGQ1fZnbTLvJq4k1HmPc iqKAJ4hAPZRr63lXk1WSKRjUq/xb1dGrYqd/8YOIfdxy9YDVkdg2LswV3POVgfGoPlcC Si2Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b22si9246316ejv.159.2019.11.10.23.45.11; Sun, 10 Nov 2019 23:45:34 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726913AbfKKHmW (ORCPT + 99 others); Mon, 11 Nov 2019 02:42:22 -0500 Received: from smtp.eckelmann.de ([217.19.183.80]:6068 "EHLO smtp.eckelmann.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726845AbfKKHmW (ORCPT ); Mon, 11 Nov 2019 02:42:22 -0500 X-Greylist: delayed 902 seconds by postgrey-1.27 at vger.kernel.org; Mon, 11 Nov 2019 02:42:20 EST Received: from ws067.eckelmann.group (2a00:1f08:4007:5c00:1a60:24ff:fe97:84c9) by EX-SRV2.eckelmann.group (2a00:1f08:4007:e035:172:18:35:5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1591.10; Mon, 11 Nov 2019 08:27:16 +0100 Date: Mon, 11 Nov 2019 08:27:15 +0100 From: Thorsten Scherer To: Matti Vaittinen CC: , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Pengutronix Kernel Team , Linus Walleij , "Bartosz Golaszewski" , , Subject: Re: [PATCH 40/62] gpio: gpio-siox: Use new GPIO_LINE_DIRECTION Message-ID: <20191111072715.GB4117@ws067.eckelmann.group> References: <91a796dd2811b58f4be30875f5ef644f0e43f241.1572945896.git.matti.vaittinen@fi.rohmeurope.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <91a796dd2811b58f4be30875f5ef644f0e43f241.1572945896.git.matti.vaittinen@fi.rohmeurope.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Originating-IP: [2a00:1f08:4007:5c00:1a60:24ff:fe97:84c9] X-ClientProxiedBy: EX-SRV2.eckelmann.group (2a00:1f08:4007:e035:172:18:35:5) To EX-SRV2.eckelmann.group (2a00:1f08:4007:e035:172:18:35:5) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Tue, Nov 05, 2019 at 12:30:58PM +0200, Matti Vaittinen wrote: > It's hard for occasional GPIO code reader/writer to know if values 0/1 > equal to IN or OUT. Use defined GPIO_LINE_DIRECTION_IN and > GPIO_LINE_DIRECTION_OUT to help them out. > > Signed-off-by: Matti Vaittinen for SIOX gpio: Acked-by: Thorsten Scherer > --- > drivers/gpio/gpio-siox.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpio/gpio-siox.c b/drivers/gpio/gpio-siox.c > index 006a7e6a75f2..311f66757b92 100644 > --- a/drivers/gpio/gpio-siox.c > +++ b/drivers/gpio/gpio-siox.c > @@ -203,9 +203,9 @@ static int gpio_siox_direction_output(struct gpio_chip *chip, > static int gpio_siox_get_direction(struct gpio_chip *chip, unsigned int offset) > { > if (offset < 12) > - return 1; /* input */ > + return GPIO_LINE_DIRECTION_IN; > else > - return 0; /* output */ > + return GPIO_LINE_DIRECTION_OUT; > } > > static int gpio_siox_probe(struct siox_device *sdevice) > -- > 2.21.0 > > Quoted from > [PATCH 00/62] Add definition for GPIO direction > > > Patches are compile-tested only. I have no HW to really test them. Thus > I'd appreciate carefull review. This work is mainly about converting > zeros and ones to the new defines but it wouldn't be first time I > get it wrong in one of the patches :) Applied the patch(es) and tested them with SIOX device Tested-by: Thorsten Scherer > > -- > Matti Vaittinen, Linux device drivers > ROHM Semiconductors, Finland SWDC > Kiviharjunlenkki 1E > 90220 OULU > FINLAND > > ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ > Simon says - in Latin please. > ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ > Thanks to Simon Glass for the translation =]