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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E75CCC433F5 for ; Thu, 3 Mar 2022 00:36:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230429AbiCCAgy (ORCPT ); Wed, 2 Mar 2022 19:36:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229664AbiCCAgw (ORCPT ); Wed, 2 Mar 2022 19:36:52 -0500 X-Greylist: delayed 328 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 02 Mar 2022 16:36:05 PST Received: from wnew1-smtp.messagingengine.com (wnew1-smtp.messagingengine.com [64.147.123.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B6614667E; Wed, 2 Mar 2022 16:36:05 -0800 (PST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.west.internal (Postfix) with ESMTP id 2A8542B00248; Wed, 2 Mar 2022 19:30:34 -0500 (EST) Received: from imap49 ([10.202.2.99]) by compute3.internal (MEProxy); Wed, 02 Mar 2022 19:30:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; bh=eiWLYfA4t1gGk/ mdor81f7EceQWpUlzsDTwnD33Z67w=; b=yQDCr14Q8vFd8Vhl2mpgM/1hWafyyc ZnMCn0SfsF+PTDm74K1cEXva4K6RLAEPRM4ylBbgIYHO88HYJA3N3D8SpJFMaUYu Ey4ZvPi9EAi3BlxWTcSCKL0R/dsPChEZ9UZkeTQbutnY8G3eMls+P59QIngpwwY5 TiTMprrDj2LRpXIyXntMIFT6spzAFRn+B56UoSoiDaFYCJ+ybkT2/7GtJGjfuQVk +tjqFKihAfKNA5kLdWoJ4rVpWW5sDZF1PSYv3aS9Qj19Tz4d5aA79MhI1UDjQv7z R+9DMFTStMw87Xhs7VY6o99jtEvh/FGwcOolOUAd7cbDr5FzBkoHeTpg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=eiWLYfA4t1gGk/mdor81f7EceQWpUlzsDTwnD33Z6 7w=; b=EI7+GdstVl79yq9Fm3hvRTD1YZ66On6ZvCyB53SB/KQSa9RXa3DBnRbCb PTei6GReqFjZ1/vOUq4R9aOzx1rr5XsGHiNRZtYr31ZkZwnwGmSomkFDW/60vxcr BH/tVQixKpfHx+vwSob7ciWRp2AuACf7dl85tYxnXp/qt40xOg5bup2ZOWxjvhXb UVJbPfRbKTgnZqTgqQKw5DSkC6qJHsfjOfZSy7Olt7aUaF3c7KQE0KaIQvyNPCYI lConQVqasVzznECBA2PE4dE/0kRbz64BKUVBu4jzdzjpBcqiaVJBAO0kAD+QMd4Y W/5KOkb1B+WAO9mLkjxTfC+8jGP6w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddthedgvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpedftehn ughrvgifucflvghffhgvrhihfdcuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucggtf frrghtthgvrhhnpeekheejieeigfefvdffheevveekfeejgffgvdeuueegjeeghfffhffg ieelffdvfeenucffohhmrghinhepudekrdhithenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfiesrghjrdhiugdrrghu X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 8700FF6007E; Wed, 2 Mar 2022 19:30:32 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-4778-g14fba9972e-fm-20220217.001-g14fba997 Mime-Version: 1.0 Message-Id: In-Reply-To: <20220302085432.GA11054@duo.ucw.cz> References: <20210921043936.468001-1-andrew@aj.id.au> <20220302085432.GA11054@duo.ucw.cz> Date: Thu, 03 Mar 2022 11:00:11 +1030 From: "Andrew Jeffery" To: "Pavel Machek" , "Joel Stanley" Cc: "Linus Walleij" , =?UTF-8?Q?C=C3=A9dric_Le_Goater?= , linux-leds@vger.kernel.org, "open list:GPIO SUBSYSTEM" , "Rob Herring" , devicetree , "Linux ARM" , linux-aspeed , "Linux Kernel Mailing List" , "Andy Shevchenko" Subject: Re: [PATCH 0/2] leds: pca955x: Expose GPIOs for all pins Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2 Mar 2022, at 19:24, Pavel Machek wrote: > Hi! > >> > > Without these patches the driver limits the number of pins expose= d on >> > > the gpiochip to the number of pins specified as GPIO in the devic= etree, >> > > but doesn't map between the GPIO and pin number spaces. The resul= t is >> > > that specifying offset or interleaved GPIOs in the devicetree giv= es >> > > unexpected behaviour in userspace. >> > > >> > > By always exposing all pins as GPIOs the patches resolve the lack= of >> > > mapping between GPIO offsets and pins on the package in the drive= r by >> > > ensuring we always have a 1-to-1 mapping. >> > > >> > > The issue is primarily addressed by patch 1/2. Patch 2/2 makes it >> > > possible to not expose any pins as LEDs (and therefore make them = all >> > > accessible as GPIOs). This has a follow-on effect of allowing the= driver >> > > to bind to a device instantiated at runtime without requiring a >> > > description in the devicetree. >> > > >> > > I've tested the series under qemu to inspect the various interact= ions >> > > between LEDs vs GPIOs as well as conflicting GPIO requests. >>=20 >> > > Please review! >> > >> > This is simpler than the 'ngpio' business we had before. >> > >> > Reviewed-by: C=C3=A9dric Le Goater >>=20 >> I saw that you recently merged some LED patches. I was wondering if >> you could consider this series for v5.18. It still applies cleanly, >> and we've been running it for a while now, so it's very well tested. > > Thanks, applied. I must say this is really ninja-mutant driver, but I > see no better way. > > +++ b/drivers/leds/leds-pca955x.c > @@ -429,7 +429,7 @@ pca955x_get_pdata(struct i2c_client *client, struc= t=20 > pca955x_chipdef *chip) > int count; > > This really should be unsigned. Care to fix/submit a patch? I'll send a fix. Andrew