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 X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D692DC4338F for ; Fri, 23 Jul 2021 07:59:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B507760E91 for ; Fri, 23 Jul 2021 07:59:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234030AbhGWHSq (ORCPT ); Fri, 23 Jul 2021 03:18:46 -0400 Received: from new2-smtp.messagingengine.com ([66.111.4.224]:59537 "EHLO new2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233291AbhGWHSp (ORCPT ); Fri, 23 Jul 2021 03:18:45 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id D53FB581634; Fri, 23 Jul 2021 03:59:18 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 23 Jul 2021 03:59:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=i8n9O+VsqDFXRYu9i7jNYyfCIp o8E9ZNcVeUyjwI2Ik=; b=WDJa/1k/SAJzvrhFOqBLwsyjc6kmpqly5/dkJBtjQZ Zja0AAC84IaQutQjU8Veo7ApUPkfH7EG0A1NZ6FwPLunySo1OMyzH5hb5px4v+c8 +JtQaeILb/fBKsHsMstZvyrcJVqV7lU3i6GVhjCitIc4u7PdNnl5Gz4ZVZqBNrCq 575LR3f7/SHGSJLbtaQGbALuIQb5DkNdNFoXl0SCpIGKQevdn9Tdutg94FF+qRE1 qjnZq6AcOELPGWrj6Xfs05fRlSy+dzwexmzRDl6/U0RVeHjOs9jZ9LAJDwHJv+eB Qflw4Ju7tpiCCuB9JXkbRff8I2QTcq4sSQ1482BA7+ew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=i8n9O+VsqDFXRYu9i 7jNYyfCIpo8E9ZNcVeUyjwI2Ik=; b=UpxeDh9CqUezIsciiyfavfJ8qQP0tAUzi 5MK0L6nKjDHMorgD0BJTkv5CvukVgu5sAnj67Hm+gw6R7eBf7+/t1GLkXiUddU5X R+Vg5N5SvUTaz6T5ZtIbmDp6++2CHrmXqQMgg+zxckh6b0R8e1LoFOsuCFAd5r93 /ozXWevK0lfvdqENXkht5E5qpzs29x2fCnSE5i9+lvm0gtGr8EWHNLZKcDC/dNZU QUHq0x56Rk3RMBX+fSncMbzcYZWWgPtlcPDzT0HVEjfeFLw8jMH8/kBaatE2jH0I BzgAFmjZKWWQdHZcymo+rkgpSp6Rc754nxtDyyDhJLh88iFeewllg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrfeejgdduvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegrjhdr ihgurdgruheqnecuggftrfgrthhtvghrnhepkefhieffjeevfeevhedtieeihfefvdejle dvvddthefftedujeethfeuueelfedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 23 Jul 2021 03:59:12 -0400 (EDT) From: Andrew Jeffery To: linux-leds@vger.kernel.org, linux-gpio@vger.kernel.org Cc: clg@kaod.org, robh+dt@kernel.org, joel@jms.id.au, pavel@ucw.cz, linus.walleij@linaro.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 0/6] leds: Fix pca955x GPIO pin mappings Date: Fri, 23 Jul 2021 17:28:52 +0930 Message-Id: <20210723075858.376378-1-andrew@aj.id.au> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Hello, 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! Andrew Andrew Jeffery (6): pinctrl: Add pinctrl_gpio_as_pin() pinctrl: Add hook for device-specific map parsing leds: pca955x: Relocate chipdef-related descriptors leds: pca955x: Use pinctrl to map GPIOs to pins ARM: dts: rainier: Add presence-detect and fault indictor GPIO expander pinctrl: Check get_group_pins callback on init arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts | 76 +++ drivers/leds/leds-pca955x.c | 554 +++++++++++++++---- drivers/pinctrl/core.c | 28 +- include/linux/pinctrl/pinctrl.h | 4 + 4 files changed, 566 insertions(+), 96 deletions(-) -- 2.30.2 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 X-Spam-Level: X-Spam-Status: No, score=-13.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1B01C4338F for ; Fri, 23 Jul 2021 08:01:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A820560EBD for ; Fri, 23 Jul 2021 08:01:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A820560EBD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=WD5/cGBRSSP/cfYx+HB18yAr8RJzTWM0H2MYROSjpF4=; b=MyOKcmwVwh01Wl 6vDJ318TWf91nYwKAv6+YPKJUtqikvJDABUHZ8ipywgrA4cGo9uGzQRjD0Vt8GuQV5kAzQVWxGblO mQrwmD6NCo2qH7lGdn1o+U0G+rKJg2t/9SJ6IdopcKSHYINpH3hjsn5DbZmdFx/8B5JtXZQF2xRUU WrTNWfIdJoq9B6rwM//8jtC900YaSxAQS/tPJW6xMg6NvuhEhRm3vj5QcRNXqqjgxf90k5KNp2/Dj bSeNw2m+WXisP0ZWa+LBgmv5PaApjj+vwYjg797BZlO7W2kOrbk748mt53KVHHIq+VYKrZ88yfnxT Jmwkj0C/DWmlcxBl7z+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m6q5d-003mU7-B1; Fri, 23 Jul 2021 07:59:25 +0000 Received: from new2-smtp.messagingengine.com ([66.111.4.224]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m6q5Z-003mPH-OP for linux-arm-kernel@lists.infradead.org; Fri, 23 Jul 2021 07:59:23 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id D53FB581634; Fri, 23 Jul 2021 03:59:18 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 23 Jul 2021 03:59:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=i8n9O+VsqDFXRYu9i7jNYyfCIp o8E9ZNcVeUyjwI2Ik=; b=WDJa/1k/SAJzvrhFOqBLwsyjc6kmpqly5/dkJBtjQZ Zja0AAC84IaQutQjU8Veo7ApUPkfH7EG0A1NZ6FwPLunySo1OMyzH5hb5px4v+c8 +JtQaeILb/fBKsHsMstZvyrcJVqV7lU3i6GVhjCitIc4u7PdNnl5Gz4ZVZqBNrCq 575LR3f7/SHGSJLbtaQGbALuIQb5DkNdNFoXl0SCpIGKQevdn9Tdutg94FF+qRE1 qjnZq6AcOELPGWrj6Xfs05fRlSy+dzwexmzRDl6/U0RVeHjOs9jZ9LAJDwHJv+eB Qflw4Ju7tpiCCuB9JXkbRff8I2QTcq4sSQ1482BA7+ew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=i8n9O+VsqDFXRYu9i 7jNYyfCIpo8E9ZNcVeUyjwI2Ik=; b=UpxeDh9CqUezIsciiyfavfJ8qQP0tAUzi 5MK0L6nKjDHMorgD0BJTkv5CvukVgu5sAnj67Hm+gw6R7eBf7+/t1GLkXiUddU5X R+Vg5N5SvUTaz6T5ZtIbmDp6++2CHrmXqQMgg+zxckh6b0R8e1LoFOsuCFAd5r93 /ozXWevK0lfvdqENXkht5E5qpzs29x2fCnSE5i9+lvm0gtGr8EWHNLZKcDC/dNZU QUHq0x56Rk3RMBX+fSncMbzcYZWWgPtlcPDzT0HVEjfeFLw8jMH8/kBaatE2jH0I BzgAFmjZKWWQdHZcymo+rkgpSp6Rc754nxtDyyDhJLh88iFeewllg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrfeejgdduvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegrjhdr ihgurdgruheqnecuggftrfgrthhtvghrnhepkefhieffjeevfeevhedtieeihfefvdejle dvvddthefftedujeethfeuueelfedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 23 Jul 2021 03:59:12 -0400 (EDT) From: Andrew Jeffery To: linux-leds@vger.kernel.org, linux-gpio@vger.kernel.org Cc: clg@kaod.org, robh+dt@kernel.org, joel@jms.id.au, pavel@ucw.cz, linus.walleij@linaro.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 0/6] leds: Fix pca955x GPIO pin mappings Date: Fri, 23 Jul 2021 17:28:52 +0930 Message-Id: <20210723075858.376378-1-andrew@aj.id.au> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210723_005921_888453_A7BE4253 X-CRM114-Status: GOOD ( 11.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello, 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! Andrew Andrew Jeffery (6): pinctrl: Add pinctrl_gpio_as_pin() pinctrl: Add hook for device-specific map parsing leds: pca955x: Relocate chipdef-related descriptors leds: pca955x: Use pinctrl to map GPIOs to pins ARM: dts: rainier: Add presence-detect and fault indictor GPIO expander pinctrl: Check get_group_pins callback on init arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts | 76 +++ drivers/leds/leds-pca955x.c | 554 +++++++++++++++---- drivers/pinctrl/core.c | 28 +- include/linux/pinctrl/pinctrl.h | 4 + 4 files changed, 566 insertions(+), 96 deletions(-) -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel