From patchwork Wed Dec 11 14:32:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 1207691 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=fi.rohmeurope.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47Xzsz2SFYz9sR7 for ; Thu, 12 Dec 2019 01:32:39 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729879AbfLKOci (ORCPT ); Wed, 11 Dec 2019 09:32:38 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:36744 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729791AbfLKOci (ORCPT ); Wed, 11 Dec 2019 09:32:38 -0500 Received: by mail-lf1-f65.google.com with SMTP id n12so16880425lfe.3; Wed, 11 Dec 2019 06:32:37 -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=+LrjmXEDHAWD8D/nfsHsPfYpxxDVLV4SbgFUsF+OLNI=; b=B6AZYASLgmOqsETp85PWYQT/uXHDJ/DeF0ZEviUfZar35KhdFMu5ksr2DDESAW4WMZ 3hplK7PAPqNFCs+/WybVSa4BBf59j23Qg6Od7W6gcWmfDAsJFsd6lmB4Ez3Ihatn01PK 0Dsar4x35HDIEec2VsBCCpCJyU0iO1suF0dmxnJ8pJUBaD7DoqL15+6+jE6Pdfp2+nfx iZZbjzi8NUA4cdz0GgV4BMTEZTVSRuK8eWZkm7VynX9IA2WjlG3mVHiAlE15oxSYhH+j q/teh2anXJ9bVN70EsbEyF0+vq2RO4me5ArdTW0Xji5nzL9ULus8G+IENJIn/8btkCD+ 9udw== X-Gm-Message-State: APjAAAUx1rkIwfYZM1JDB0xoNqfIG6shbb9J3hvFPNkyGqyZ9Ae0gig5 CEPWAM/EIL2tdKk0NPYRvLg= X-Google-Smtp-Source: APXvYqy5kCCWhoHVOcEeKgXhF2Tk8x/uttuI9860O6BB82DMhQIMic6BIeM3gASU97uiuy0efWDNXQ== X-Received: by 2002:a19:dc1e:: with SMTP id t30mr2471646lfg.34.1576074756348; Wed, 11 Dec 2019 06:32:36 -0800 (PST) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id y11sm1474057lfc.27.2019.12.11.06.32.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2019 06:32:35 -0800 (PST) Date: Wed, 11 Dec 2019 16:32:24 +0200 From: Matti Vaittinen To: matti.vaittinen@fi.rohmeurope.com, mazziesaccount@gmail.com Cc: Mika Westerberg , Andy Shevchenko , Linus Walleij , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] pinctrl: pinctrl-intel: Use GPIO direction definitions Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Use new GPIO_LINE_DIRECTION_IN and GPIO_LINE_DIRECTION_OUT when returning GPIO direction to GPIO framework. Signed-off-by: Matti Vaittinen --- drivers/pinctrl/intel/pinctrl-intel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c index 4860bc9a4e48..821da94cfa6c 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -944,7 +944,8 @@ static int intel_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) if (padcfg0 & PADCFG0_PMODE_MASK) return -EINVAL; - return !!(padcfg0 & PADCFG0_GPIOTXDIS); + return padcfg0 & PADCFG0_GPIOTXDIS ? GPIO_LINE_DIRECTION_IN : + GPIO_LINE_DIRECTION_OUT; } static int intel_gpio_direction_input(struct gpio_chip *chip, unsigned int offset)