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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EEB86C64EC7 for ; Mon, 20 Feb 2023 10:16:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231407AbjBTKQK (ORCPT ); Mon, 20 Feb 2023 05:16:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbjBTKQH (ORCPT ); Mon, 20 Feb 2023 05:16:07 -0500 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88C6E16311 for ; Mon, 20 Feb 2023 02:16:03 -0800 (PST) Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id B269F3F71D for ; Mon, 20 Feb 2023 10:16:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1676888161; bh=fKd9fxybT9+hFfyTDDr2Mtw7ZX+21Hd2dT0jDnkibYM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=tRLcIaWxDCXwruIFB/pF04r4bvV/4oy8w/TsPsD9Ijd2oJTnkKEwyoKst2TayaiDr KQXCkpLvVl15Z3b+Yuu8XYA7S0ETBth6ZxrXSpbiC7ugTjElm8bH2g41d7xqdfnrb3 mYt0LotLWDCwKv365VpewV1YCVbFnT8NsYloMEO723uAwvgOCGsIsmzMAbijeDcWld 7EEFfs4MUM4xt855p8ojj9Kl4RqM3FuWtaJOF6o2YrqfNlt5NYa1vb21NfOg7zOAVS QZcERLcpISKslJUVCSQ0VborlhchrYRBPL4dgqASfO5iYzn0J/ed2y+KsFa0sXpXru EjwVnKRq5o83A== Received: by mail-qv1-f70.google.com with SMTP id pm5-20020ad446c5000000b0056eb3830243so207173qvb.16 for ; Mon, 20 Feb 2023 02:16:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fKd9fxybT9+hFfyTDDr2Mtw7ZX+21Hd2dT0jDnkibYM=; b=YCYSLHRh338ymTPYoCeO5w423VSW7lZNtHap6oM3N6mtv8k75B37a5P5OY00576/Z9 tGOGQUF/2jfk4ta0EVK6KozOa3ADgc6MAOSPtNs/tTE08S4M2lWgUjWl3XnxH6f6qDqt gSgldE2PQAOZmsvZWzg/2hgcWpVtGcs0JWmAdA8Y7KENMTUqaJpu3uObnHLtJgiuKtKj dRD2ktyLgMMoyfiz6PHXwYkQ1al4l0LMpVgpfY7EaR1mk34zeXTZIJuLox44TqmAOltl cJcEoGx6ayV+lNbQSFH7Bwu3gaa2XEFgcDhK7i86mDYekmHLNWQ+xr0BOolAt3Mo1WA4 p62A== X-Gm-Message-State: AO0yUKWJLOxR42fJbImxi6PtAx0rRngfZxkLzbYUC8ifeAvU0/sUN01c sn8TP9CV+PNZBS2FLpzY/GEWbv1GFoTpT9wDyMqSbgdSXRNDnYgzkXENBsT/LS4TSjLlZpMu+uH uEjWJuHXgAoz9QfdPD5pxPrmhVIsYXUjLhKBaC9fZJqVHBPR1kZ/PXAcrfQ== X-Received: by 2002:a0c:d990:0:b0:570:fc87:4f2c with SMTP id y16-20020a0cd990000000b00570fc874f2cmr203800qvj.83.1676888160751; Mon, 20 Feb 2023 02:16:00 -0800 (PST) X-Google-Smtp-Source: AK7set/YEwtnCc0MdoLEDmbY+Jh+bhbVGYGL0//BwQFePHm998lWNjLRhslfWc3fYUt397bZwhY8xJy7wcjRn5Bnl4Y= X-Received: by 2002:a0c:d990:0:b0:570:fc87:4f2c with SMTP id y16-20020a0cd990000000b00570fc874f2cmr203789qvj.83.1676888160500; Mon, 20 Feb 2023 02:16:00 -0800 (PST) MIME-Version: 1.0 References: <20230209143702.44408-1-hal.feng@starfivetech.com> <4211d93d-702c-6759-6f25-f86160c0be5d@starfivetech.com> In-Reply-To: <4211d93d-702c-6759-6f25-f86160c0be5d@starfivetech.com> From: Emil Renner Berthing Date: Mon, 20 Feb 2023 11:15:44 +0100 Message-ID: Subject: Re: [PATCH v5 0/4] Basic pinctrl support for StarFive JH7110 RISC-V SoC To: Hal Feng Cc: Linus Walleij , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, Andreas Schwab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Palmer Dabbelt , Jianlong Huang , 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 Sat, 11 Feb 2023 at 09:25, Hal Feng wrote: > On Fri, 10 Feb 2023 23:45:05 +0100, Linus Walleij wrote: > > On Thu, Feb 9, 2023 at 3:37 PM Hal Feng wrote: > > > > > This patch series adds basic pinctrl support for StarFive JH7110 SoC. > > > > This v4 version applied, the driver is in good shape and all bindings ACKed, > > nice work on this driver! > > v4? Is this a typo? This series is v5. > Anyway, thank you so much! Hi Hal and Linus I'm curious if there is a plan to address Icenowy's concerns here: https://lore.kernel.org/linux-gpio/52dcbe48dbf5f2561713a9642943353216fef15a.camel@icenowy.me/ The problem is that input from "GPIO" pins is configured a little differently on the StarFive SoCs. Instead of having a register pr. pin(grroup) there is a register pr. control line to the peripherals, and into these you write the pin number + 2 of the pin you want the peripheral to react to. Why +2? That's because 0 is a special "always low" signal and similarly 1 is a special "always high" signal. With the current bindings one hacky way to solve this is to treat those two special values as kind of "virtual pins" that will always be high or low. So that would be something like pinmux = ; ..but this means we might need to mux these two virtual pins to multiple peripherals. I'm not sure the pinmux framework is prepared for that. /Emil > Best regards, > Hal