From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 89178200111; Tue, 18 Feb 2025 09:55:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.211.166.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739872548; cv=none; b=HeVONXgTDu7lm+TjIf347xyj/UhIVqDAu5qK/BgY7q+LIS//j0GeuKoIxoQwQ/viz5xxb107oiq06a3tbztg8gAj77dehh8a0n2j8A737TgWQnAgiQTC1iuR8YgymVvipTS9fjDTjKahnnwOKtOr7DwjE9jBe4MVTonhixwychE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739872548; c=relaxed/simple; bh=WuqhpzqD0eQ2AsQvz5im5Ud+8fEJv2LS6d10sJfVpis=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MXvfftGMkZY4Nc6nVBQFkiI+DBxGywtt334oMucoHtOI9tHQkZ4evhnmlxZb9bYcgLdV0xgrvtFqvWlBuueQmgvrWjGJkZl0pcQ0ABwQzg/Nu8o2Y+iof1eZ1VPgvdZEh4F4iLz/BAYyoYcD+XXnJCSahognh83XcoSItQ0nsAI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gentoo.org; spf=pass smtp.mailfrom=gentoo.org; arc=none smtp.client-ip=140.211.166.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gentoo.org Received: from localhost (unknown [180.172.76.141]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dlan) by smtp.gentoo.org (Postfix) with ESMTPSA id 0DE22343022; Tue, 18 Feb 2025 09:55:44 +0000 (UTC) Date: Tue, 18 Feb 2025 09:55:40 +0000 From: Yixun Lan To: Linus Walleij Cc: Rob Herring , Olof Johansson , Bartosz Golaszewski , Krzysztof Kozlowski , Conor Dooley , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Yangyu Chen , Jisheng Zhang , Jesse Taube , Inochi Amaoto , Icenowy Zheng , Meng Zhang , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v4 1/4] dt-bindings: gpio: spacemit: add support for K1 SoC Message-ID: <20250218095540-GYA29065@gentoo> References: <20250123113042-GYA38135@gentoo> <20250127181726.GA538260-robh@kernel.org> <20250128031712-GYB47737@gentoo> <20250206133156-GYA5687@gentoo> <20250214115410-GYA21743@gentoo> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Hi Linus: On 10:44 Tue 18 Feb , Linus Walleij wrote: > On Fri, Feb 14, 2025 at 12:54 PM Yixun Lan wrote: > > > thanks for this very detail prototype! it works mostly, with one problem: > > > > how to map gpio correctly to the pin from pinctrl subsystem? > > > > for example, I specify gpio-ranges in dts, then > > gpio0: gpio@d4019000 { > > compatible = "spacemit,k1-gpio"; > > reg = <0x0 0xd4019000 0x0 0x100>; > > ... > > gpio-ranges = <&pinctrl 0 0 96>; > > }; > > > > foo-gpios = <&gpio0 2 28 GPIO_ACTIVE_LOW>; > > > > It should get GPIO_92 ( 92 = 2 * 32 + 28), but turns out GPIO_28 > > > > Probably there is something I missed... > > No it's just me missing the complexity! > > > to make the gpio part work, we need additional custom gpio-ranges parser, > > which should similar to of_gpiochip_add_pin_range() in gpiolib-of.c > > (at least gpio core need to adjust to call custom this function) > > Let me send a patch set to bring threecell into the core instead, > and see if it works for you! > > I will post it real soon. > can you check the v5 of the patch here [1]? which I just sent out yesterday it does 1) implement xlate() 2) instroduce custom add_pin_page() the gpio part works as I tested, the gpio irq probably need more testing > Yours, > Linus Walleij [1] https://lore.kernel.org/spacemit/20250217-03-k1-gpio-v5-0-2863ec3e7b67@gentoo.org/ -- Yixun Lan (dlan) Gentoo Linux Developer GPG Key ID AABEFD55 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id E98CCC02198 for ; Tue, 18 Feb 2025 10:08:40 +0000 (UTC) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=b9fN9p50ro+qvvc040ESFI4ATgK+PvCVF1/wU4OSIzw=; b=3j8nYyAnCdrHgS 3KAzEGnIvztsnAZH4vjDbKpZgIOd6AYS4ZpN7+wqdWbEVmcWFk1zhLs1PS4gEwDFgJ+RWhvDxGaf0 kTBoCNL1UCg0yku46o+PzlNLZFoLcGchb3FLsg9NANdoENdOCEES4Y7zMK7hRUAAH2cVFEpi0Lt6l 3qvKUtyAxuWjSzzR9gD7uyK3WqzFjgGdInjXVJPIIteUfQyHN/q3eizmdh3KQVjoWFZOTHMQjKzvy 2CYHJNcGi3qMjuYOeJSwmGBWAVN4QKpLEY3Y73Im6MxBImRlZ4a24dBvtt2HqGtk5R18HibR97qc1 0Pe56pkuIoqocFLHl0sw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tkKWp-00000007fxB-2Zdy; Tue, 18 Feb 2025 10:08:35 +0000 Received: from woodpecker.gentoo.org ([140.211.166.183] helo=smtp.gentoo.org) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tkKKQ-00000007cas-23uM for linux-riscv@lists.infradead.org; Tue, 18 Feb 2025 09:55:47 +0000 Received: from localhost (unknown [180.172.76.141]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dlan) by smtp.gentoo.org (Postfix) with ESMTPSA id 0DE22343022; Tue, 18 Feb 2025 09:55:44 +0000 (UTC) Date: Tue, 18 Feb 2025 09:55:40 +0000 From: Yixun Lan To: Linus Walleij Subject: Re: [PATCH v4 1/4] dt-bindings: gpio: spacemit: add support for K1 SoC Message-ID: <20250218095540-GYA29065@gentoo> References: <20250123113042-GYA38135@gentoo> <20250127181726.GA538260-robh@kernel.org> <20250128031712-GYB47737@gentoo> <20250206133156-GYA5687@gentoo> <20250214115410-GYA21743@gentoo> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250218_015546_549464_F090E3F7 X-CRM114-Status: GOOD ( 21.65 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Conor Dooley , Meng Zhang , linux-gpio@vger.kernel.org, Bartosz Golaszewski , linux-kernel@vger.kernel.org, Conor Dooley , Yangyu Chen , devicetree@vger.kernel.org, Palmer Dabbelt , Jesse Taube , Jisheng Zhang , Paul Walmsley , Olof Johansson , Inochi Amaoto , Krzysztof Kozlowski , linux-riscv@lists.infradead.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org SGkgTGludXM6CgpPbiAxMDo0NCBUdWUgMTggRmViICAgICAsIExpbnVzIFdhbGxlaWogd3JvdGU6 Cj4gT24gRnJpLCBGZWIgMTQsIDIwMjUgYXQgMTI6NTTigK9QTSBZaXh1biBMYW4gPGRsYW5AZ2Vu dG9vLm9yZz4gd3JvdGU6Cj4gCj4gPiB0aGFua3MgZm9yIHRoaXMgdmVyeSBkZXRhaWwgcHJvdG90 eXBlISBpdCB3b3JrcyBtb3N0bHksIHdpdGggb25lIHByb2JsZW06Cj4gPgo+ID4gaG93IHRvIG1h cCBncGlvIGNvcnJlY3RseSB0byB0aGUgcGluIGZyb20gcGluY3RybCBzdWJzeXN0ZW0/Cj4gPgo+ ID4gZm9yIGV4YW1wbGUsIEkgc3BlY2lmeSBncGlvLXJhbmdlcyBpbiBkdHMsIHRoZW4KPiA+ICAg ICAgICAgICAgICAgICBncGlvMDogZ3Bpb0BkNDAxOTAwMCB7Cj4gPiAgICAgICAgICAgICAgICAg ICAgICAgICBjb21wYXRpYmxlID0gInNwYWNlbWl0LGsxLWdwaW8iOwo+ID4gICAgICAgICAgICAg ICAgICAgICAgICAgcmVnID0gPDB4MCAweGQ0MDE5MDAwIDB4MCAweDEwMD47Cj4gPiAgICAgICAg ICAgICAgICAgICAgICAgICAuLi4KPiA+ICAgICAgICAgICAgICAgICAgICAgICAgIGdwaW8tcmFu Z2VzID0gPCZwaW5jdHJsIDAgMCA5Nj47Cj4gPiAgICAgICAgICAgICAgICAgfTsKPiA+Cj4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