Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp350239pxm; Wed, 2 Mar 2022 17:04:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJzF437KupzVmC4iY9JOhrpMAo1Zl7vAtMgFsDZWXiUnxqe6RvKHHiroOCiAMIUH4pt8pRpz X-Received: by 2002:a63:d44:0:b0:36c:644e:791c with SMTP id 4-20020a630d44000000b0036c644e791cmr28174857pgn.417.1646269471188; Wed, 02 Mar 2022 17:04:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646269471; cv=none; d=google.com; s=arc-20160816; b=WAvbitlhn5QBt4lJetzjkB5j3cou661OA7ogZgBcbonU9CLunxd1ZuWBt6baggaDkJ tYEy/Gnu29q1VyaD9gcF7EdvQAexiNc935DLyxzOrKuZCwJ+M+c1W0Zx/nUia8gzJ2nB vMXXPqqipG/W80fEY4S+dlDKnp4SFDCHD+MzO/mvfdOJJnesT3hh/RaNO76FwHCu9pc/ InpKhqfUFviCRNK9AZ62ZuzU+z1XW7og03r/pJCe/DGy4QUs2no3k7nyKKt3Y0+JPxZC I0+1b72+/s6xhAooYC5ug1yEvQq+4EHOI24ox5jpZtYVOTrN9mo38PW6MlPI7gXGuDnS cugQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :dkim-signature:dkim-signature; bh=eiWLYfA4t1gGk/mdor81f7EceQWpUlzsDTwnD33Z67w=; b=YMk1KNCxKWE2gkM8QGck5IS+dzyprwEib4a6RH7zNynPXaP2hljUnozdL6mpALds3J HpYWQimCfVJrNZJvPxw/s9M/8NoMHDZ5BZ00+oe8AkpESrGBHX9eL8DsNofLh39nua5e 7lRLdRMXy1mUywQAW/pwltE9Zvruxsvzx2OVLxOETqresWroFb9hGcvFobcvyVphslMQ fiO+9yp6ueYpjiEmqAzIKo5F5anb6ZeyUDVav/uTCHqP0ci50gbyKcpAeP4M/IlbwUn4 ddveLFo8gspBJtP28QVMke0//Ct4iTpDFxKV/Ngf6PyoGrHUATKfYpppleILIYQtVsgE ZzXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm2 header.b=yQDCr14Q; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=EI7+Gdst; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s15-20020a056a0008cf00b004e1e38f1137si688082pfu.354.2022.03.02.17.04.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 17:04:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm2 header.b=yQDCr14Q; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=EI7+Gdst; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5BC956C970; Wed, 2 Mar 2022 16:36:19 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230422AbiCCAgx (ORCPT + 99 others); Wed, 2 Mar 2022 19:36:53 -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 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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