Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp302604rwb; Wed, 16 Nov 2022 00:22:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf4vvppS7SH0fI/4cgIyxLtKpeH2bK4seeVc96CC3WCOGdJWQdWgqORZiv5LLCgwgCOCWAcY X-Received: by 2002:a50:baab:0:b0:461:e2ab:912d with SMTP id x40-20020a50baab000000b00461e2ab912dmr18723278ede.93.1668586923387; Wed, 16 Nov 2022 00:22:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668586923; cv=none; d=google.com; s=arc-20160816; b=BKO0jdhxHs/vJnVS+/NRwDUMuRnOtLlt+33h09PYzPOe3a8yPujWF02MQmJuAe4w8V bVFHIO/PluhR2EHm4oZzvgshWG3w5aJ9iMrZV561KixzgmPYsi7YAlhFlbpUosPrR8Ff CM9kZ0dtQNlSPe4nz09NZ9uuyDYcRiWftwtlzr2DZSkzxl/pB3izak2bc2fX5h4sTG8M kYoeyG8uzHV3TGB8r4+cd7C4QdVRX6HAwWNoLIYEvEx5hB4g33sV3+B4XDADdca2qK2R GlUKLeeU/8XIa2m0tQHjVYRdcDH/on/xsAUsZHWTpXgJ+rVGtny0usa5frxN9JlnCiEu NQ6A== 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=mgGyuenVtFXuCVHks+5NNuVlkc2b6o69ZD4m/QGfTIs=; b=FjooFqQEA2H02zT+XKZaoJS0ejgmqVHhKteX/uDNwlxs0Qsu56tk2imxcBNITdaVBO AFTLQd6Vu1EJjyetTlfJ3M6pznl4KUap85Mzuz8/qSEG25DRzP+wmmf/QzsxcdLtMVaU fZnaKboOyMNrmwoYNRP2jTMJq9K4oI2R1MAqBTT8i2Co3qdT94VNqpsXk+y4iwlarPCL +MeFXJUi2ucJFeyiZHy4PPfnRmk0Le8l/gEgv4prLAvwW80DidLzD2ofoGFlpHDoQ71j wKC57Ynx4DomIeXnCcd2N5lJqZniUIgHFszsuG3zLOruFBVU9jVOmobIUahEUJ4mDRYx D5aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pu2FcKNn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l18-20020a056402029200b0045d5e3c7f44si11511073edv.180.2022.11.16.00.21.41; Wed, 16 Nov 2022 00:22:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pu2FcKNn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231829AbiKPH6e (ORCPT + 90 others); Wed, 16 Nov 2022 02:58:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233104AbiKPH6O (ORCPT ); Wed, 16 Nov 2022 02:58:14 -0500 Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5DE724BC9; Tue, 15 Nov 2022 23:58:11 -0800 (PST) Received: by mail-qv1-xf36.google.com with SMTP id mi9so11410072qvb.8; Tue, 15 Nov 2022 23:58:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=mgGyuenVtFXuCVHks+5NNuVlkc2b6o69ZD4m/QGfTIs=; b=pu2FcKNnKmYX8n8ReZH0BUxp8JnZXV8eos5dZGhtCG5CWtOBuPPD4F4nWNrYze0RR1 6y7cMVsZPR2aVAbxBEYu37bOWJKK7bDZyoyPjcFhxubcPGAzoosnfKviwCxF/Yp5nByO PWMZIuqzLGPKKDkf5HCP6Qfep9jh4rpSiivrZM/B3LtEAxH2v21PwLMubC72O0CeIAwQ ITchSaF6Dt++GaIS/lHpqxvs9cOryvVxazw+rlgdwz/kaYWakTJBcsIWAvuBFetWDWwi P0bl4++dn6PY46ZevmrDf6w+wKLv8iy5qrfR+9EIBjCN0FRgWmNZClMN9NJV9nLicbCP auLg== 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=mgGyuenVtFXuCVHks+5NNuVlkc2b6o69ZD4m/QGfTIs=; b=5KkIwMhEYw7LzLrPBeZjFSJGL7hl+ls7coYuW9TRk5EOUzjxlWhP2odja5B+x/F/4j yfJbvhVEjMjqUqvWXGhay7YaSLofs5Lz0TzHwZyNFOkWa1/BHx+/e3zN1kV8OZwM07ZH y82VCdMAMlNLLD1prq8VNoXX+eTq248puXmHMM8sRC3vD7xtoF0L7G5C1WyS/+PWX+34 TuVKBmdD++Atvy0bja20FBz+yzr+M8EllbnANzAk2Gg0OMGL9dHDRyoJkSEeU2MjCqqr Mlxhb1FWvPNLEwQO2NLxGHQ8sbjnOU5JEN49HPt1+G9yOHfvi17zP6Lr6c3vuU9A5Su4 Zfzg== X-Gm-Message-State: ANoB5pmxq+jRMqvJWwvMZJ65sqSbxbUOo5ehPD2gFstKaoWf3+qUOe6W 6AW/2g7CMRoeRm0RhWtR7SBoMHJcR8sRUxs3Jkg= X-Received: by 2002:a0c:ed34:0:b0:4bb:73a4:c1dc with SMTP id u20-20020a0ced34000000b004bb73a4c1dcmr20026016qvq.41.1668585491008; Tue, 15 Nov 2022 23:58:11 -0800 (PST) MIME-Version: 1.0 References: <20221108092840.14945-1-JJLIU0@nuvoton.com> <20221108092840.14945-4-JJLIU0@nuvoton.com> <168ed6e6-21bf-f034-504e-6da36842f4bc@linaro.org> In-Reply-To: <168ed6e6-21bf-f034-504e-6da36842f4bc@linaro.org> From: Jim Liu Date: Wed, 16 Nov 2022 15:57:59 +0800 Message-ID: Subject: Re: [PATCH v2 3/3] dt-bindings: gpio: Add Nuvoton NPCM750 serial I/O expansion interface(SGPIO) To: Krzysztof Kozlowski Cc: Linus Walleij , JJLIU0@nuvoton.com, KWLIU@nuvoton.com, brgl@bgdev.pl, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, openbmc@lists.ozlabs.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Krzysztof Thanks for your reply. Our sgpio has 8 regs to control output and 8 regs to control input. Each reg size is one byte. and the sgpio interface has 4 pins(s_clk, d_out, d_in, LDSH). The clock is generated by APB3, and one operation cycle includes input and output beginning the signal, the LDSH is low and now will send output serial data , after finished output serial data the LDSH will be high and get serial input data. The in/out serial data size is byte * ports , and direct to update the regs. > the driver will open the ports to use. > ex: if i set d_out=9 and d_in=20 The Soc is controlled by port, not by each bit. So if users need 9 output pins, the driver needs to open two ports, because each reg is one byte. if users need 20 input pins ,the driver needs to open three ports. The list has some rules for use, The first half is the output and the second half is the input. the example as below: if i set d_out=8 d_in=8 root@buv-runbmc:~# gpioinfo 8 gpiochip8 - 16 lines: line 0: unnamed unused output active-high line 1: unnamed unused output active-high line 2: unnamed unused output active-high line 3: unnamed unused output active-high line 4: unnamed unused output active-high line 5: unnamed unused output active-high line 6: unnamed unused output active-high line 7: unnamed unused output active-high line 8: unnamed unused input active-high line 9: unnamed unused input active-high line 10: unnamed unused input active-high line 11: unnamed unused input active-high line 12: unnamed unused input active-high line 13: unnamed unused input active-high line 14: unnamed unused input active-high line 15: unnamed unused input active-high the line0~line7 will map to output reg1 and line8~line15 will map to input reg1 and so on. and thanks again for your suggestions and information for dts naming. So I need to modify it from sgpio1 to gpio8 am i correct? Best regards, Jim On Tue, Nov 15, 2022 at 5:58 PM Krzysztof Kozlowski wrote: > > On 15/11/2022 10:21, Jim Liu wrote: > > Hi Linus and Krzysztof > > > > Thanks for your understanding and your suggestion. > > I will follow your suggestion to modify the yaml file. > > -> nuvoton,input-ngpios = <...> > > -> nuvoton,output-ngpios = <...> > > > > And I don't think the node name needs to use gpio. > > because it's not a general gpio, so I reference aspeed dts and use sgpio. > > Could I use the sgpio node name or could you provide some suggestions? > > Aspeed DTS has poor code readability (not following several common DT > conventions), so using it as an example or argument is not correct > approach. Nodes have name "gpio" for GPIO controllers or one of > pinctrl.yaml for pin controllers. > > Best regards, > Krzysztof >