From: Michael Walle Subject: Re: [PATCH 12/18] gpio: add support for the sl28cpld GPIO controller Date: Mon, 30 Mar 2020 13:48:21 +0200 Message-ID: <021f3add4b03b7a682832921a96ef85f@walle.cc> References: <20200317205017.28280-1-michael@walle.cc> <20200317205017.28280-13-michael@walle.cc> <9c310f2a11913d4d089ef1b07671be00@walle.cc> <22944c9b62aa69da418de7766b7741bd@walle.cc> <4d8d3bc26bdf73eb5c0e5851589fe085@walle.cc> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Bartosz Golaszewski Cc: Linus Walleij , linux-gpio , linux-devicetree , LKML , linux-hwmon-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-pwm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, LINUXWATCHDOG , arm-soc , Rob Herring , Jean Delvare , Guenter Roeck , Lee Jones , Thierry Reding , =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= , Wim Van Sebroeck , Shawn Guo , Li Yang , Thomas Gleixner , Jason Cooper , Marc List-Id: linux-pwm@vger.kernel.org Hi, Am 2020-03-30 13:21, schrieb Bartosz Golaszewski: > pt., 27 mar 2020 o 16:28 Michael Walle napisaƂ(a): >> >> Am 2020-03-27 11:20, schrieb Linus Walleij: >> > On Thu, Mar 26, 2020 at 9:06 PM Michael Walle wrote: >> >> Am 2020-03-25 12:50, schrieb Bartosz Golaszewski: >> > >> >> > In that case maybe you should use the disable_locking option in >> >> > regmap_config and provide your own callbacks that you can use in the >> >> > irqchip code too? >> >> >> >> But how would that solve problem (1). And keep in mind, that the >> >> reqmap_irqchip is actually used for the interrupt controller, which >> >> is not this gpio controller. >> >> >> >> Ie. the interrupt controller of the sl28cpld uses the regmap_irqchip >> >> and all interrupt phandles pointing to the interrupt controller will >> >> reference the toplevel node. Any phandles pointing to the gpio >> >> controller will reference the GPIO subnode. >> > >> > Ideally we would create something generic that has been on my >> > mind for some time, like a generic GPIO regmap irqchip now that >> > there are a few controllers like that. >> > >> > I don't know how feasible it is or how much work it would be. But >> > as with GPIO_GENERIC (for MMIO) it would be helpful since we >> > can then implement things like .set_multiple() and .get_multiple() >> > for everyone. >> >> For starters, would that be a drivers/gpio/gpio-regmap.c or a >> drivers/base/regmap/regmap-gpio.c? I would assume the first, >> because the stuff in drivers/base/regmap operates on a given >> regmap and we'd just be using one, correct? On the other hand >> there is also the reqmap-irq.c. But as pointed out before, it >> will add an interrupt controller to the regmap, not a device >> so to speak. >> >> -michael > > This has been on my TODO list for so long, but I've never been able to > find the time... I'd really appreciate any effort in that direction as > I believe it would allow us to slowly port a big part of the GPIO > expander drivers over to it and make large portions of our codebase > generic. I might have at least a first patch this week. So if you and Linus Walleij might have some time to help review and comment on that, it would be greatly appreciated. -michael > > Best regards, > Bartosz Golaszewski