From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 872D3C4332F for ; Fri, 11 Nov 2022 09:00:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:CC: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=bXKfA/uCCZz0Hg9UGT+iwU/uhpY0cXa66lzRVvpKRg8=; b=AM5FjLnS41zsm/ ZBP8wB2jJPel7gFOfs0fP86k2vqFQZSitIje1S5yB4KNfxWxihVhOedvMGiJYIQeLIALLrX45AMB3 5HrPEkOcIvbU7/ZwQkkAibK8ZO0IM11uGK2Y2h/aWr7BDCa7RLbNB1lUPV87XQ7+N1Qaza97lm8OX HKp0mEsY5X4TNREyhSCYjvmbK5IYCEPAMTd2G49+eAN62SUZNPr4EGxRyAQ0RPKBHaBUd2RsKgNUI cIKJK4XUeU2mEuKW7yR74UgeohTEtxWm+yIHng493t8lmdi0Umm5NGKHRS0JU4YgbvjalvyZ4qRIY 0ZTqgrHTJOqVIMSRU34g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1otPsc-00ER4w-N4; Fri, 11 Nov 2022 08:59:18 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1otPsK-00EQrE-Fu for linux-arm-kernel@lists.infradead.org; Fri, 11 Nov 2022 08:59:04 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2AB8wk4g130327; Fri, 11 Nov 2022 02:58:46 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1668157126; bh=MzK939t1bZHhF1XE9KfYy0hyr4NI9NAbtTrJALGKJDc=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=XKoVv8/0jagy2y4ztuHR9d7Mdq95BiFUEsp5OvI+hbXBFiNPgJE0CBo/J+u2Cwnj6 HqSSjOTRIhqEQETPrvJjDWXP0I/f2xSM/2b07edh7+txQ/jvWS7uIAL53lk7FoKmVQ WrKUajDG1Hc4ycifOILf8jpGzNPc93eSCsmTZWS8= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2AB8wkUv028572 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 11 Nov 2022 02:58:46 -0600 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Fri, 11 Nov 2022 02:58:45 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Fri, 11 Nov 2022 02:58:45 -0600 Received: from ubuntu (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with SMTP id 2AB8wXWR105891; Fri, 11 Nov 2022 02:58:35 -0600 Date: Fri, 11 Nov 2022 00:58:32 -0800 From: Matt Ranostay To: Linus Walleij CC: Michael Walle , , , , , , , , , , , , , Keerthy Subject: Re: [PATCH v3 4/7] gpio: tps6594x: add GPIO support for TPS6594x PMIC Message-ID: References: <20221109065546.24912-1-mranostay@ti.com> <20221109065546.24912-5-mranostay@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221111_005901_533363_61464C32 X-CRM114-Status: GOOD ( 27.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Nov 10, 2022 at 11:15:22AM +0100, Linus Walleij wrote: > On Thu, Nov 10, 2022 at 11:12 AM Matt Ranostay wrote: > > On Wed, Nov 09, 2022 at 10:59:08AM +0100, Linus Walleij wrote: > > > On Wed, Nov 9, 2022 at 7:56 AM Matt Ranostay wrote: > > > > > > > Add support for TPS6594X PMICs GPIO interface that has 11 that can be > > > > configured as input or outputs. > > > > > > > > Tested-by: Keerthy > > > > Signed-off-by: Matt Ranostay > > > > > > (...) > > > > +config GPIO_TPS6594X > > > > + tristate "TI TPS6594X GPIO driver" > > > > + depends on MFD_TPS6594X > > > > + help > > > > + Select this option to enable GPIO driver for the TPS6954X > > > > + PMIC chip family. There are 11 GPIOs that can be configured. > > > > > > select GPIO_REGMAP > > > > > > This driver is an archetypical example of a driver that can make great > > > use of GPIO_REGMAP helpers, so rewrite it to use them. > > > Look in drivers/gpio/gpio-sl28cpld.c for an example. > > > > Linus, > > > > Those helpers look great for this usecase on the surface but however I think there could be some issues. > > For GPIO direction it isn't configured by a bitmap on a register(s) but by a bit on a range of > > registers (with a register for each GPIOx). > > > > For set/get values the gpio helper would work though. > > Isn't is possible to just use parts of the GPIO_REGMAP > helpers? I thought it's designed like such. > > Michael Walle will know what to do with your usecase, and > whether to use it or not, let's page him! > So after looking around a bit and digging into the helper code I found this drivers/pinctrl/bcm/pinctrl-bcm63xx.c which has a example on how to override the reg_mask_xlate function which could be used for changing the stride, and mask based on the base address. Currently have coded up using the gpio regmap helper. Will run through some testing first and then submit for review. - Matt > Yours, > Linus Walleij _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel