From patchwork Wed May 16 17:01:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H. Nikolaus Schaller" X-Patchwork-Id: 914792 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) 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=goldelico.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=goldelico.com header.i=@goldelico.com header.b="NLmGj/LY"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40mLLy5vFxz9s3c for ; Thu, 17 May 2018 03:01:46 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750775AbeEPRBl (ORCPT ); Wed, 16 May 2018 13:01:41 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.82]:20529 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750772AbeEPRBk (ORCPT ); Wed, 16 May 2018 13:01:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1526490097; s=strato-dkim-0002; d=goldelico.com; h=References:In-Reply-To:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=yB32/U3GsjmzFVbGq1mlMifFR7/1Oi8iH+cz//uukRg=; b=NLmGj/LYZ5a1WpxbG6T4X+V1wOBs225NzEv/ftuKAhH73CVVH+l2vSh3m8G6ZRzUZY /NOVcueB2/7kZ4Vdj9QsIs3TwYo2Gp1AaPsDwGrOa9b69WLIuyicBbb8c4VhilvOmdun tHXa6nI/DyTywdBnmNWhjCF08x/zMluLzBv1XbCCAt/5G0hzm/ACW1zyF5nCxCtmyWZf POXREZpqhjTxEkMJDWz0A9zcfNt57Dxc+i2UioVbRbO791vx8VSnTIlBITAKMEjDzpAK e4saaUOA5P5lw1zB4TO41DCLpRpdD0SDKccM55dUIYMH7Tl4YT0A3PUeq3SgMLXsc7In Mrug== X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMhflhwDubTJ9o12DNO4Ij05fypFHKw==" X-RZG-CLASS-ID: mo00 Received: from iMac.fritz.box by smtp.strato.de (RZmta 43.8 DYNA|AUTH) with ESMTPSA id D0a232u4GH1SjcO (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Wed, 16 May 2018 19:01:28 +0200 (CEST) From: "H. Nikolaus Schaller" To: galak@codeaurora.org, andy.shevchenko@gmail.com, Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Linus Walleij , Alexandre Courbot Cc: devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org, kernel@pyra-handheld.com, "H. Nikolaus Schaller" Subject: [PATCH v6 2/3] gpio: pca953x: define masks for addressing common and extended registers Date: Wed, 16 May 2018 19:01:25 +0200 Message-Id: <314df7f911fda8f5584cc4384a26074848a2673b.1526490085.git.hns@goldelico.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: References: In-Reply-To: References: Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org These mask bits are to be used to map the extended register addreseses (which are defined for an unsupported 8-bit pcal chip) to 16 and 24 bit chips (pcal6524). Reviewed-by: Andy Shevchenko Signed-off-by: H. Nikolaus Schaller --- drivers/gpio/gpio-pca953x.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index 2b667166e855..c0eb679e60d4 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c @@ -56,6 +56,10 @@ #define PCAL6524_DEBOUNCE 0x2d #define PCA_GPIO_MASK 0x00FF + +#define PCAL_GPIO_MASK GENMASK(4, 0) +#define PCAL_PINCTRL_MASK (~PCAL_GPIO_MASK) + #define PCA_INT 0x0100 #define PCA_PCAL 0x0200 #define PCA_LATCH_INT (PCA_PCAL | PCA_INT)