Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp453924pxm; Wed, 2 Mar 2022 01:46:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhSn8ut9k2NmPskyHE0B6LP4b9B2ggv0fb5H4RT8Ue2EN8DLdTzElivgyxzSUrBC3lFVRp X-Received: by 2002:a50:da47:0:b0:410:a39a:c43b with SMTP id a7-20020a50da47000000b00410a39ac43bmr28919140edk.33.1646214385843; Wed, 02 Mar 2022 01:46:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646214385; cv=none; d=google.com; s=arc-20160816; b=Z53zdCGjwozSm6pq1lsj5QGbkIqujkj8u6h6paEYqW3YUX3Tj9RIaSGrIOWbL85eCi BMis+2qaHzGPX1hLHKYfZMFVHapdt6Z0zNZ8W1h6v9cmCiH14JNLVk0JQ3Q65HMe7Bhx kL3FvroOKn8VNbSQ/IQ0ft0uruqNcV1w2jbpBSYeMlUwyWvdpACeIZXK3FZSS3sKA8G9 /8JxjLZW6wWCandlj2VTKr/fZc7TSgtp3+/kp1LYhoq+wfJxTmvOhsGhSM27kyPHz1Ha x03c+5O2wJEeSGV1MT2CFHj7mrPOiK1fbHN45ep8MCPNAkhqdwiZ53TQFwtWffgo3QvL 4zdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=c2eBnrwzH8bzC+TjLDcHj/x74yAj+X4Gv+nM80oKW+o=; b=aNKZvkne5IQUZGAmukpYMk5HrSvpP90VyJuD40QiXnTApyLQnY9rvorrvmlXS6pMFJ PvQ7spGVHyz757+1iyXSb48ajUMJhkWFv71Xok7iZBaBydSOEfmLfC38+oWzh7GkZo/X ivIQaHWy1568lJwowhQf0+Sgn34dnWIEgWximprh/WNGVXgfvSgT+KA/sxfEJZ3DkJ9g jC/IUFwZHk0w5wr+d2ijX7bu8WsffvbWEPPlanfDxOqwQ9z/Ds0hwfjuf/XWSzgkHWt9 HE0LopHva/p/zqlMcrSy1rCd1gcg94m1+ayF5kbK+0f58ikog0gzrYx+5YVTTUorqG8q kcjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bn10-20020a170906c0ca00b006d1d6458f5asi9617862ejb.161.2022.03.02.01.46.02; Wed, 02 Mar 2022 01:46:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240262AbiCBIzS (ORCPT + 99 others); Wed, 2 Mar 2022 03:55:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235558AbiCBIzR (ORCPT ); Wed, 2 Mar 2022 03:55:17 -0500 Received: from jabberwock.ucw.cz (jabberwock.ucw.cz [46.255.230.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7508160062; Wed, 2 Mar 2022 00:54:34 -0800 (PST) Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 91B021C0B81; Wed, 2 Mar 2022 09:54:32 +0100 (CET) Date: Wed, 2 Mar 2022 09:54:32 +0100 From: Pavel Machek To: Joel Stanley Cc: Linus Walleij , =?iso-8859-1?Q?C=E9dric?= 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 Message-ID: <20220302085432.GA11054@duo.ucw.cz> References: <20210921043936.468001-1-andrew@aj.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zhXaljGHf11kAtnf" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 --zhXaljGHf11kAtnf Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > > Without these patches the driver limits the number of pins exposed on > > > the gpiochip to the number of pins specified as GPIO in the devicetre= e, > > > but doesn't map between the GPIO and pin number spaces. The result is > > > that specifying offset or interleaved GPIOs in the devicetree gives > > > 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 driver 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 dri= ver > > > 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 interactions > > > 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=E9dric 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, struct pca= 955x_chipdef *chip) int count; This really should be unsigned. Care to fix/submit a patch? Best regards, Pavel --=20 http://www.livejournal.com/~pavelmachek --zhXaljGHf11kAtnf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCYh8wyAAKCRAw5/Bqldv6 8oNLAJ96DjXmoElXBR+MSiaDzZLxaLlC0QCdGgbx+NMDlutN+emWDQPClInhLhc= =IHSy -----END PGP SIGNATURE----- --zhXaljGHf11kAtnf--