From patchwork Tue Nov 5 10:24:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 11227453 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B510D15AB for ; Tue, 5 Nov 2019 10:25:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 92B70206BA for ; Tue, 5 Nov 2019 10:25:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YIvBUG5U" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 92B70206BA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fi.rohmeurope.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uaNVL8kiHHKaXy1VEA7p7LBgmqeC6WbhUcbvKzzHB7g=; b=YIvBUG5UUxLw9L Cpa2GQGDhKtHcrqhHJJ3oKlNbuwqJT7jCpUe1e1MBUg+0JRZ3Z529mAtRc8ggI4E9ND6avBGKFLNP H8dYJLSgh23acS/37ulrF0Gh0lAlgDYVBa9MXm8CaqcPpSvW05e+7K5zdHOlTR7I4dLTj9hIvMxOK 3Rvo2BaN6932stnV2BYvmZlYZZYiDRD8zzUa79JWJU+GSo7YaCLYXV8r2+Yq5uVUq2SViK+rLm+DQ B5dujhdJ6noWT6dwcKg5oxi9TROh2oZLXsP3YFIeb4byulJuuFDoXFmWdhwO0NPkq4N2oA13K11HK t7KveE+H7unQoZpGAHtg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iRw1K-0001NT-Py; Tue, 05 Nov 2019 10:25:06 +0000 Received: from mail-lj1-f194.google.com ([209.85.208.194]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iRw1H-0000iv-Bs for linux-arm-kernel@lists.infradead.org; Tue, 05 Nov 2019 10:25:04 +0000 Received: by mail-lj1-f194.google.com with SMTP id l20so2491996lje.4 for ; Tue, 05 Nov 2019 02:25:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Bv+B7wRzEzNcU1QnMIvKDcqTaOyCGZVdxQ/FNOnMT1Y=; b=GLukPMEBq/y0Xc5LxSZCO8sRaxI9SkVIipamzlIRQInugEyy4H6BklaUyzHFzxmZ8O yJaQCVel7lrb9QKIvgUzKy0458QRn7Zpj3a+qOmwD4jkbNVd356isqK4dRfwpeJTH8ui kE7jDCEQcd62RHNwd9HmTaGmyakvPcdGmPjoY0kAGox3z4EWO1UGi4/yqNarasHdJBlb fPABPWQmalfeEX0rrvBQoRvn1swIsbNWP5uLwEE0Pujj4kaJ6l4Y9stx/T2Hsb27lZ2Y +OSKDX4CzdiPAhIqvPLvOBVrMyis45nOSN8qu/plQ8TDuaP5+hU7n0hflaThy7iauPWP 91mQ== X-Gm-Message-State: APjAAAW2lCYROaQXYzjGsGhODz+hcZkASClL76tOF4agJ9ogRFNjX/Bf xtc5Pd4YJmidu1i4ImD1ehI= X-Google-Smtp-Source: APXvYqzZ7jxkgUCp8oVkJ5xSQdMV9c3vS9yER47vq2zT2lEe8mlFrHp8mlWwkM4USZUxlTsllt+VMQ== X-Received: by 2002:a2e:998a:: with SMTP id w10mr10343701lji.66.1572949501943; Tue, 05 Nov 2019 02:25:01 -0800 (PST) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id f3sm2795260lfp.0.2019.11.05.02.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2019 02:25:01 -0800 (PST) Date: Tue, 5 Nov 2019 12:24:57 +0200 From: Matti Vaittinen To: matti.vaittinen@fi.rohmeurope.com, mazziesaccount@gmail.com Subject: [PATCH 27/62] gpio: gpio-mxs: Use new GPIO_LINE_DIRECTION Message-ID: <1c440ef37fb8bd690a62e4138028d0f41ebe76f4.1572945841.git.matti.vaittinen@fi.rohmeurope.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191105_022503_412300_75F1F5C2 X-CRM114-Status: GOOD ( 12.71 ) X-Spam-Score: 0.3 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.194 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.194 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (mazziesaccount[at]gmail.com) 0.1 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-gpio@vger.kernel.org, Shawn Guo , Linus Walleij , linux-kernel@vger.kernel.org, Bartosz Golaszewski , NXP Linux Team , Pengutronix Kernel Team , Fabio Estevam , Sascha Hauer , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 --- drivers/gpio/gpio-mxs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-mxs.c b/drivers/gpio/gpio-mxs.c index 5e5437a2c607..c4a314c68555 100644 --- a/drivers/gpio/gpio-mxs.c +++ b/drivers/gpio/gpio-mxs.c @@ -248,7 +248,10 @@ static int mxs_gpio_get_direction(struct gpio_chip *gc, unsigned offset) u32 dir; dir = readl(port->base + PINCTRL_DOE(port)); - return !(dir & mask); + if (dir & mask) + return GPIO_LINE_DIRECTION_OUT; + + return GPIO_LINE_DIRECTION_IN; } static const struct platform_device_id mxs_gpio_ids[] = { From patchwork Tue Nov 5 10:29:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 11227457 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4D8E816B1 for ; Tue, 5 Nov 2019 10:29:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 225D32190F for ; Tue, 5 Nov 2019 10:29:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YT+I+o2c" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 225D32190F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fi.rohmeurope.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IE90R+NHOBN68OQpWMgxOu/effyl4QiXmUxjk4Xcg70=; b=YT+I+o2cfX8wcG drkhl97bsCsOPM2PwpPLthoVso1WLRG2b3OeWh4Ik9iKRbIlTzEj1SM4WVTlG1ou56OL40MisD0My EFQjUWMmNMTvLc8AhdWGVMjVa51sXKRPz/KbVRxEzIArDkJy0B8uymGB1GcSOXaM3DMFBsyonekl0 BZhJ/QUDyCP8oozbMPyWeJZJC5zFJa8g74acVxqtJLiTm0/bzLrhapODQxYOptCse3MpanFzS/hMO ZVfw8bo5QG0RyRLHV3C8ZRfc08u65VPHrh4Ry2EWVsqWWLOjF0Q3y/6m/CX17VuDzwQfVBsae7vfJ XhXTSskGZBC9J6Qa5WmQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iRw5t-0003MH-PR; Tue, 05 Nov 2019 10:29:49 +0000 Received: from mail-lj1-f193.google.com ([209.85.208.193]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iRw5r-0003Lt-H5 for linux-arm-kernel@lists.infradead.org; Tue, 05 Nov 2019 10:29:48 +0000 Received: by mail-lj1-f193.google.com with SMTP id t5so21210165ljk.0 for ; Tue, 05 Nov 2019 02:29:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=T/zJmmC9BfN7o1sqvqhhANQRkLvNhk04+tink2hcu/o=; b=iz4ks55rkA3o2gyB8g8BNneK9QacBGyZhe2jN7AmO9cwTjN4mTXgGDAoTfEte/iOD1 UvEO4w3RGSQc6ImpVB2w7o0RpeWDdCSeBrx38WKe5kxyDO/7E/Ib0HyCIAYHROmrM82B 2qg+lE5mBBjCfRZFR48ZuV7/+3mgjjE1dAiQ6KdSCdsbdc39Elv2ld/i1n9eCIOQhwN1 MgcWEI/1ugJI0G3gLkKGvwAXAjGhvrkelQFn+z5FOpOXMapxaKaYxJjQy1vKwmlEy/zD gvEMBk4tsmVQV3Mmfva7BnXlw38ZVmupTPLMoA4lUROnrm5SMns8EsqCXUpcmFbqOqQy 5krw== X-Gm-Message-State: APjAAAUZhKSoF09R+cNeeqQWnlaQYWXsiF8iDkOkJX7mULPE82OPMe6E Rhjb4ky7SfmShx3Dbsu8oFs= X-Google-Smtp-Source: APXvYqwAiLmM1AWBNWgvSloHZxacz7vhjYQV56y3Fw7fttafgeaQyw/oMgcvECS8UnmExC/IFeNwWQ== X-Received: by 2002:a2e:874a:: with SMTP id q10mr23012443ljj.14.1572949785377; Tue, 05 Nov 2019 02:29:45 -0800 (PST) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id s7sm8246972ljo.98.2019.11.05.02.29.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2019 02:29:44 -0800 (PST) Date: Tue, 5 Nov 2019 12:29:36 +0200 From: Matti Vaittinen To: matti.vaittinen@fi.rohmeurope.com, mazziesaccount@gmail.com Subject: [PATCH 37/62] gpio: gpio-sama5d2-piobu: Use new GPIO_LINE_DIRECTION Message-ID: <4e20b399f7ef56a7df25f97a86b4e89e131083d0.1572945890.git.matti.vaittinen@fi.rohmeurope.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191105_022947_564066_0B597A34 X-CRM114-Status: GOOD ( 11.96 ) X-Spam-Score: 0.3 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.193 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (mazziesaccount[at]gmail.com) -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.193 listed in wl.mailspike.net] 0.1 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-gpio@vger.kernel.org, Linus Walleij , linux-kernel@vger.kernel.org, Bartosz Golaszewski , Ludovic Desroches , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 --- drivers/gpio/gpio-sama5d2-piobu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-sama5d2-piobu.c b/drivers/gpio/gpio-sama5d2-piobu.c index 7d718557092e..b04c561f3280 100644 --- a/drivers/gpio/gpio-sama5d2-piobu.c +++ b/drivers/gpio/gpio-sama5d2-piobu.c @@ -119,7 +119,8 @@ static int sama5d2_piobu_get_direction(struct gpio_chip *chip, if (ret < 0) return ret; - return (ret == PIOBU_IN) ? 1 : 0; + return (ret == PIOBU_IN) ? GPIO_LINE_DIRECTION_IN : + GPIO_LINE_DIRECTION_OUT; } /** @@ -154,9 +155,9 @@ static int sama5d2_piobu_get(struct gpio_chip *chip, unsigned int pin) /* if pin is input, read value from PDS else read from SOD */ int ret = sama5d2_piobu_get_direction(chip, pin); - if (ret == 1) + if (ret == GPIO_LINE_DIRECTION_IN) ret = sama5d2_piobu_read_value(chip, pin, PIOBU_PDS); - else if (!ret) + else if (ret == GPIO_LINE_DIRECTION_OUT) ret = sama5d2_piobu_read_value(chip, pin, PIOBU_SOD); if (ret < 0) From patchwork Tue Nov 5 10:31:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 11227459 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2516E1864 for ; Tue, 5 Nov 2019 10:31:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 026B321D7C for ; Tue, 5 Nov 2019 10:31:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Afe0kiGI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 026B321D7C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fi.rohmeurope.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fVKfujfrZSVd6V5Gx5BBsG3K5QMEXfXQGZVYSWWsUhU=; b=Afe0kiGIWWCfVt Hs3labKkSb0g3L3HvJAXROWzvcwUy5pDk/EYVKEapas/L1RAqBrD/JKDREUalMNmnvINxAo5Re6oj DibM0Iq6dQYpe9BmY4dhtDUnLo1jHr8GvdxNdt+8dHG8043pwK7Qs3pdNibgMl2gsiZKvMIMjan8t FcSQAv0UC2W4pRKtFSbLZ6p0Kic/5hghe4f6m9WVQWmAexzx8Wg3bMeM8xLB0pBhNxjRnb6mLIa8k KrCZUh/icn76/qYQkRDuUZSv6Dwj43vQEJ7Agl3rSQG/PzNseFlsWEfd9Csa+bGcHag50Lh2b2Nlq qNcK7vE5YVAHgaSmrWAg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iRw7k-0004wS-GN; Tue, 05 Nov 2019 10:31:44 +0000 Received: from mail-lj1-f194.google.com ([209.85.208.194]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iRw7i-0004vd-FW for linux-arm-kernel@lists.infradead.org; Tue, 05 Nov 2019 10:31:43 +0000 Received: by mail-lj1-f194.google.com with SMTP id m9so21149954ljh.8 for ; Tue, 05 Nov 2019 02:31:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=XvBRdkAyPv510oW/DoNbu2ek/YuJ4fUz43i4Kiqpz7Y=; b=iQFdStVJXaqh7D72vKgpkRWbpZqsF7NHmCxYbFYZ5P6qgmgc7thRnMZVcsDUqD3dBw JWpICvBf7B29MKc6ReQnJLJPajIzn6OE6qZEukzHOpy+POpIRckSmnYRF0BzGR0+E9+i 28+X8bRw26gyK2cf4to9ArWqDzoBqVlAQGRRxtELX3g5Ss6BmbEQzLNQepLERe2FPick cf52ABrhH1FttKJurF9yIL9DYEoY6anTCYVdIC5E1L1wO5KT75msDLjGcK1vAauB7Bmy IJNmr/xsLzDVZ/DR1F35yeQcXqD4fHnrcu5hp9OtyBAOTq4tpTdi/oL2TSos+hrxlIWh JPcw== X-Gm-Message-State: APjAAAWYF2Sdc9eQCbsKTzkFbirwGgoOtJ0uVRmNPrFnDYRH80Uty+kY 3BMh7WflROQMTHXJXTqm+Gw= X-Google-Smtp-Source: APXvYqwzcMTXY37jn+kevU5PVaRTL4Bx5Du38GnP8Dod/bvdxDLo0L2M/SRsDTpCtbdPGxLa8OU4Sg== X-Received: by 2002:a2e:5c09:: with SMTP id q9mr21797881ljb.22.1572949901044; Tue, 05 Nov 2019 02:31:41 -0800 (PST) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id y189sm13700469lfc.9.2019.11.05.02.31.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2019 02:31:40 -0800 (PST) Date: Tue, 5 Nov 2019 12:31:36 +0200 From: Matti Vaittinen To: matti.vaittinen@fi.rohmeurope.com, mazziesaccount@gmail.com Subject: [PATCH 41/62] gpio: gpio-stmpe: Use new GPIO_LINE_DIRECTION Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191105_023142_517564_EF3D8EE1 X-CRM114-Status: GOOD ( 11.99 ) X-Spam-Score: 0.3 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.194 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (mazziesaccount[at]gmail.com) -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.194 listed in wl.mailspike.net] 0.1 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Torgue , linux-gpio@vger.kernel.org, Linus Walleij , linux-kernel@vger.kernel.org, Bartosz Golaszewski , Maxime Coquelin , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 --- drivers/gpio/gpio-stmpe.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index 994d542daf53..542706a852e6 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c @@ -84,7 +84,10 @@ static int stmpe_gpio_get_direction(struct gpio_chip *chip, if (ret < 0) return ret; - return !(ret & mask); + if (ret & mask) + return GPIO_LINE_DIRECTION_OUT; + + return GPIO_LINE_DIRECTION_IN; } static int stmpe_gpio_direction_output(struct gpio_chip *chip,