Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5069084pxv; Wed, 28 Jul 2021 02:16:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCFzeeVjk0wg9/EbFw1lGFGoxeP7Zp3vYVfM1pSj6V7GEC5HskEl+DIIHKaL8g8DNWEFRE X-Received: by 2002:a05:6402:10d7:: with SMTP id p23mr32784193edu.74.1627463764998; Wed, 28 Jul 2021 02:16:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627463764; cv=none; d=google.com; s=arc-20160816; b=Oo6y2KWwdJfkAcRAE0wsxNZC9wQ5iWz5FVfIYagkGnvlIjUpiM/hvbjdF6p7L0sKPX 8wvAf3U+W/RVGMhQWPzhgQMGeoTu2rZknMPyoXLGukm6u97oRgBc2D3VtZrMxdauKkiX ug7NaKEYhh624aD1smhkJoTVqNfe9+ctOEvQZZv2p297GVfybnppw86ZST0EycEbX85f Oit/+oBbbLV/n8+ldyYg+VSPKxjhZ0B+DLC1/IyjSDUR14ZRNHgwLUYNeipFaGmmU7pv l112McfWK0TXQizgugUD/ZPJkbNPxmB17dV8U/GMSEP5tzqoyfPOhuu20xrmABVh2cJt qglw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=6m4UZEx/kYzeDD67ywCPsN6+L14vcm0XjCn8vgnR0gs=; b=ZyAjJLPD8r8yOeD8xSLPixhrSlTRiuc1cFB9nzWQNeChhYTVoZYGW/GS3ckHDZkVGS 2mli1GT7BHbt/8R80gql1VgEi8S9bQUmgr4W9WinxvwHAsufv2XqMSBRdRyXg84f3ZRr 6tXorzhIg7WbJEVeRHO5KQg7I2ZpLLY1fbQoofo0Pt2fQdIoXRlbmBMzdMdlHGr6TD6A VLw5uOQfx4aVcmmfIa3VgK597AaBAR8n4itmXwL+RuotR5h11VeY1cC+6L9Ki9Us6+1B zgJ7RxNn0hYvcxwsgqe1YfQJxvuN70Pclc88T0gLvCAA47fwGoG7dE4jydC1AhsGDNd9 S7eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iC6z8Qct; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb16si5200695ejb.396.2021.07.28.02.15.42; Wed, 28 Jul 2021 02:16:04 -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=@gmail.com header.s=20161025 header.b=iC6z8Qct; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235580AbhG1JNq (ORCPT + 99 others); Wed, 28 Jul 2021 05:13:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235520AbhG1JNo (ORCPT ); Wed, 28 Jul 2021 05:13:44 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F88BC0613CF; Wed, 28 Jul 2021 02:13:43 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id f13so1923304plj.2; Wed, 28 Jul 2021 02:13:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6m4UZEx/kYzeDD67ywCPsN6+L14vcm0XjCn8vgnR0gs=; b=iC6z8Qctytr3DWMW26XBlXyJXmcX9mHqtGYg7L6xD94wbl7ajzQi5zIilGaoIAsNBu ZN7L0JWLQB0NsyAQiW+JqWlOT1mTbK4f+uOaBNUne3qrnSByPi9LK4eaUGHE6oXAo+tw 7gXczYP9K2NW9xgp4RU0Wn0tG7xRBm8dvpW/t/+zJk+V0r1Lb6GZzxN+922cNAK3aV+j lKtMq4xZPZfiDze9gJjeELttGZiHW7K0jpIUX7aPHQVSLXgmQga/VBWMx7C7W9UDTxml zt0rZuogVBn8QhRnDgl2my8YDzXxJUe2Cy1wtm27Z5pRU6koXTuaHQgUeJXb1z/uUgVX Qrbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6m4UZEx/kYzeDD67ywCPsN6+L14vcm0XjCn8vgnR0gs=; b=PUjkq5B1sWa0E3dOPmT2GEukvgq/pSjuUldr3TjQu3lRiIwYQxuPURmRXaZ0DogowA zrW/T0LEZRAi54f3kqG57fP+eDcFwOuBP1LbtbTKmD82awpzp+juGaD83SO8WnkoIRTo zGl/kIjF8f8/6TghFUMa2+veeVAHguLPspshtfF9fRAor+3WX6Avu7CLof1XAhkzJ4XC 8dWcg8duXeBi4Sx2KvIEemb+fAHszFyIwWIy8/zjt/vKgKZTfw0aQc0OXuyNybN9qrcu q4w9+p7ySHJpxDpQIRt6nDVmPDVzi1yqBaEWS8zD3oS4ZxtUyIhaZ0seXb1cVk1ql4ur gRug== X-Gm-Message-State: AOAM532ZDkGtX55k0RKd7AfriGSxKt6icOHLQj4q/j4k6fyD2VPWq4au TF5zKbF+0ENBPH7Huhv1sqMC/hrZQhsx4ksxs/8= X-Received: by 2002:a17:902:ac90:b029:12c:e7a:c183 with SMTP id h16-20020a170902ac90b029012c0e7ac183mr14859743plr.21.1627463622505; Wed, 28 Jul 2021 02:13:42 -0700 (PDT) MIME-Version: 1.0 References: <20210723075858.376378-1-andrew@aj.id.au> In-Reply-To: From: Andy Shevchenko Date: Wed, 28 Jul 2021 12:13:06 +0300 Message-ID: Subject: Re: [RFC PATCH 0/6] leds: Fix pca955x GPIO pin mappings To: Andrew Jeffery 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" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 28, 2021 at 8:43 AM Andrew Jeffery wrote: > On Fri, 23 Jul 2021, at 17:45, Andy Shevchenko wrote: > > On Friday, July 23, 2021, Andrew Jeffery wrote: > > > This series does a bunch of crimes, so it's an RFC. I'm cross-posting to the > > > pinctrl/GPIO and LEDs lists because the PCA955x devices impact all of them. What > > > needs fixing is the leds-pca955x driver's failure to map the GPIO numberspace to > > > the pin numberspace of the PCA955x devices. The series solves that by > > > implementing pinctrl and pinmux in the leds-pca955x driver. > > > > > > Things I'm unsure about: > > > > > > 1. Patch 1: The pinctrl_gpio_as_pin() API feels a bit dirty, not sure what > > > others thoughts are on that (Linus?). > > > > > > 2. Patch 2: I've added a new callback to hook the entirety of the pinctrl map > > > parsing rather than supplying a subnode-specific callback. This was necessary > > > to handle the PCA955x devicetree binding in a backwards compatible way. > > > > > > 3. Patch 4: The PCA955x devices don't actually have any pinmux hardware, but the > > > properties of the pinctrl/pinmux subsystems in the kernel map nicely onto the > > > problem we have. But it's quite a bit of code... > > > > > > 4. Patch 6: I also lost a bunch of time to overlooking the get_group_pins() > > > callback for pinctrl, and it seems odd to me that it isn't required. > > > > > > Please review! > > > > > > Sounds like a hack. > > Yes, possibly. Feedback like this is why I sent the series as an RFC. > > > I was briefly looking into patches 1-4 and suddenly > > realized that the fix can be similar as in PCA9685 (PWM), I.e. we > > always have chips for the entire pin space and one may map them > > accordingly, requested in one realm (LED) in the other (GPIO) > > automatically is BUSY. Or I missed the point? > > No, you haven't missed the point. I will look at the PCA9685 driver. > > That said, my goal was to implement the behaviour intended by the > existing binding (i.e. fix a bug). Okay, so it implies that this used to work at some point. What has changed from that point? Why can't we simply fix the culprit commit? > 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? -- With Best Regards, Andy Shevchenko