Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2138405pxy; Mon, 2 Aug 2021 21:12:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYxoy11g/vODkCMHJYUJ4XnMTYglkcxj4Jf57lyKzJiinYtFjBrJY7xB8TBPGKb+HS95Ow X-Received: by 2002:a17:906:8cd:: with SMTP id o13mr9803992eje.341.1627963972633; Mon, 02 Aug 2021 21:12:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627963972; cv=none; d=google.com; s=arc-20160816; b=T3etpZqKhPo5gFnec8O38Jbyup/DzDDjP8NQuLJmvLd3sCEHk+XL+DSEUFrHDcKTVR YbUPghaisrxK5VpEnXYsW9DRmMTW5E7CuftXH+h7BmFNwcxfkoLOMrVIEOe/g70iqcfS FVJtOzCiEQrZZix7c7rhaLHF5zTrSOb7iXey3HN9eYLdkjA4ULpnGylhPPVgpX/N3Kz+ IyMQ6Hd92GfYxLMOQWbRFu610/fpr60jYgzEE0p+3ZCT3xCofpBawNSoNFGdkl4r3FyI 2NXldb6rTrbU+DvZP6+AzQd5R996eSyDTDNMAW6wLddefbYIMVSj3UPArtmyFiBXyUqQ 1tJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:dkim-signature:dkim-signature; bh=Ppnjgn9uT3nmuKcO7tOFj+ln9O4wmRRNvfgdBYB7dI8=; b=JbCx6c4QbGuQMm+51QZZghnn5PkwTv0F92erORkpoJUQFGAvasKK4crmwzXINRZoDq H4PYLe3TDP1ywPI4w/XikcNsmX4vvVwQOj4Zi8ADindZdvXolu4iV50NuRCowjhTqExM 38iYPsLcE1YLZR1Rz5sNk4gsij2Aqr+qR3gRAP/fiaPaHzDqS+8kZjwLvQm9L1CzwQz3 Z1K2nvBQ++ww4q3lel5vGSJ0LODYyGPKMbEqYEB3Rjov3gie4OXoEpahD587dsg9fVBR DW6xaJZ888GqbuZ7dtjhD2yIsCkGG+54x6JVIBAAUZmsjvZepVUCzaDAGrZMH7fsnaBl qMBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm3 header.b=OKHYuR8Q; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=eaIYKV3Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si11590064edq.144.2021.08.02.21.12.11; Mon, 02 Aug 2021 21:12:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm3 header.b=OKHYuR8Q; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=eaIYKV3Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229846AbhHCEHm (ORCPT + 99 others); Tue, 3 Aug 2021 00:07:42 -0400 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:50127 "EHLO wnew4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbhHCEHl (ORCPT ); Tue, 3 Aug 2021 00:07:41 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.west.internal (Postfix) with ESMTP id E90DD2B0114E; Tue, 3 Aug 2021 00:07:29 -0400 (EDT) Received: from imap43 ([10.202.2.93]) by compute2.internal (MEProxy); Tue, 03 Aug 2021 00:07:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm3; bh=Ppnjgn9uT3nmuKcO7tOFj+ln9O4wmRR NvfgdBYB7dI8=; b=OKHYuR8QZZlGqTrvGubS+4e0MQo1R70rVcET9ytidu7sxph yJt4i/gOXrrca9QRlpLIr4NrWiEI+dNx6aWV9jbF+t1pifDlnWZWYwFWzq08FP6W JFnZJs+QcTR339vXltq9ATJN9WIS1nsQSOp+/2CVnsTDqxX14GwcVRVtjyw0y+7a MUZyOiTBN6/MpcHwhtwT4T8D14ZU3McUGXMZWwvr9A929IDxtdoUcu5aFh3A/B9E DD1EqRncPBaRp+nm9eevBS3dkRBzH2z0RcMm1rXrSaq7cEum+BYVbs2778qA9WWb CxNXl+f2uix6CeRXubuWw6FoDVLukJAbSkw47Qg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=Ppnjgn 9uT3nmuKcO7tOFj+ln9O4wmRRNvfgdBYB7dI8=; b=eaIYKV3Y5GoVbgReKh+RM2 JGBu+L4Afj8EUiBJI3cDyRe3Jryb23kYKJMZRIJGkEfYaGy1jhvCaSaJKdwRAjps nC6lYM4h37UnmrhFIZJk67D1AtRO4xDJcmwbQcUZw98bbv6tSBap2Jhw9oZc3ndD jG843fceNArsjNPKqsa89HzJ6gujxDdjLYPRP7AH1RDlGBjH5FqbWvyLl9PaK/qx oa3tPvSvToJc/T+uj5LO+NKzgnvi22EKyGxMIKuhS+sA6OqGd/QtzXSIFYNbsNsY DCri3zyPwqWOw26Nl434ybU6EeX3LB+PgEWBj4jgmryZugkwrhvglX3/VipwmYDA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrieefgdejtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedftehnughr vgifucflvghffhgvrhihfdcuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucggtffrrg htthgvrhhnpeehhfefkefgkeduveehffehieehudejfeejveejfedugfefuedtuedvhefh veeuffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvfiesrghjrdhiugdrrghu X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id EEF55AC0DD0; Tue, 3 Aug 2021 00:07:27 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-548-g3a0b1fef7b-fm-20210802.001-g3a0b1fef Mime-Version: 1.0 Message-Id: <50aaf381-8cda-4656-9222-f23fda75d3bc@www.fastmail.com> In-Reply-To: References: <20210723075858.376378-1-andrew@aj.id.au> <6cc64039-f82a-4c1e-ad2c-16fad7aa3178@www.fastmail.com> Date: Tue, 03 Aug 2021 13:37:07 +0930 From: "Andrew Jeffery" To: "Andy Shevchenko" Cc: "linux-leds@vger.kernel.org" , "linux-gpio@vger.kernel.org" , =?UTF-8?Q?C=C3=A9dric_Le_Goater?= , "Rob Herring" , "Joel Stanley" , "Pavel Machek" , "Linus Walleij" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-aspeed@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" Subject: Re: [RFC PATCH 0/6] leds: Fix pca955x GPIO pin mappings Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 29 Jul 2021, at 17:10, Andy Shevchenko wrote: > On Thu, Jul 29, 2021 at 3:39 AM Andrew Jeffery wrote: > > On Wed, 28 Jul 2021, at 18:43, Andy Shevchenko wrote: > > > On Wed, Jul 28, 2021 at 8:43 AM Andrew Jeffery wrote: > > > > However, userspace would never have > > > > got the results it expected with the existing driver implementation, so > > > > I guess you could argue that no such (useful) userspace exists. Given > > > > that, we could adopt the strategy of always defining a gpiochip > > > > covering the whole pin space, and parts of the devicetree binding just > > > > become redundant. > > > > > > I'm lost now. GPIO has its own userspace ABI, how does it work right > > > now in application to this chip? > > > > As above, it "works" if the GPIOs specified in the devicetree are > > contiguous from line 0. It's broken if they're not. > > So, "it never works" means there is no bug. Now, what we need is to > keep the same enumeration scheme, but if you wish to be used half/half > (or any other ratio), the driver should do like the above mentioned > PWM, i.e. register entire space and depending on the requestor either > proceed with a line or mark it as BUSY. > > Ideally, looking into what the chip can do, this should be indeed > converted to some like pin control + PWM + LED + GPIO drivers. Then > the function in pin mux configuration can show what exactly is enabled > on the certain line(s). So just to clarify, you want both solutions here? 1. A gpiochip that covers the entire pin space 2. A pinmux implementation that manages pin allocation to the different drivers In that case we can largely leave this series as is? We only need to adjust how we configure the gpiochip by dropping the pin-mapping implementation? I don't have a need to implement a PWM driver for it right now but that would make sense to do at some point. Andrew