From patchwork Tue Mar 14 09:23:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Liu X-Patchwork-Id: 6593 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1653564wrd; Tue, 14 Mar 2023 02:31:28 -0700 (PDT) X-Google-Smtp-Source: AK7set9DiGpAIH4bX2cMlsAZZGGBsWG4I5zhlXd+UZKhwVHvGqKRbWhYYgiHmCfaB4FQTEoFSJw9 X-Received: by 2002:a17:902:868c:b0:1a0:6690:d3d1 with SMTP id g12-20020a170902868c00b001a06690d3d1mr1579793plo.6.1678786288602; Tue, 14 Mar 2023 02:31:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678786288; cv=none; d=google.com; s=arc-20160816; b=ZoFFFJmwHibLKy5N9e1hzDonOWvVxNF09YSLyBIYb2G0QK3Aq11x7qUoXTzEgzZesj Qn7fepXASsRcvxSzzjxUW62V5K32/8H6Eu4yAAOr2/skUOKS32LRDOe7SQNXzv6fEmdl ZIcN3jsnQ6x0CRzJNny3HuEseGZgqLC37OzuOGJeaxWP+t5eJD0ZdfsWgrEQXUES0SYO mhCngkIppBzTVYXQe9+Oj3b2pxT0PgxOYYrE9s5Mfm2Giws23bSIjEjAbRTFasJg++SJ OZ4oNBboKjK22G8jtMeg77iDDHUN182nY3kFurC5ofrQeem3GziErvCeVb/QnrrwVxJx kk6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=WkRcazuJb7v9nTIQ0dhQR/wIjE8fenM+pHebExHfSRc=; b=vkh6fuk56Mz/4a3KJzflDiNFngRtsW/pZAHNcsvPUodsyhD863Ta4w3T/1fCG/nvMk oKRRFWp/hnbWz9Jqpbm5LnQuuuo0hSDgBO08NvV9FKBcgW6bmMdPrmVk5Ib4wf49785r ilL9Z1AEj4otnNRDxO+gBtJiFrXICXXC8Q7h6j2pUqcc3A4VUDwdCU4aIgbK1oTtYScZ /MXBlp0YrgD2opKqedr6fRVmGC+IAWBdSgSSJe0kYOsHlFcx/B8OnGN690rAOiQo/ZIC TA0s1l12qRui8SRUU972vPfqADcS4fc7tSHYDy8Lt8/+GQfPXliLZBxUFrWw5KhOKmTh KHpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gDFXjIII; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v3-20020a1709029a0300b0019abec982c2si2048425plp.77.2023.03.14.02.31.16; Tue, 14 Mar 2023 02:31:28 -0700 (PDT) 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=gDFXjIII; 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 S230188AbjCNJX4 (ORCPT + 99 others); Tue, 14 Mar 2023 05:23:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231148AbjCNJXv (ORCPT ); Tue, 14 Mar 2023 05:23:51 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B6B481CE1; Tue, 14 Mar 2023 02:23:41 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id qa18-20020a17090b4fd200b0023750b675f5so19713673pjb.3; Tue, 14 Mar 2023 02:23:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678785821; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WkRcazuJb7v9nTIQ0dhQR/wIjE8fenM+pHebExHfSRc=; b=gDFXjIIIBxk2rJLz6BEGVWRZGsY0bEHGcvQtoBp9I0YSbhTwhuzE4loJTzLmLMA1d3 YzwiWWsJw7t2R3r39B/Ny0SwHfhP5vywYBCfuyZZDHV56KddrQlh90Y7Z1MOyjDV/XSK W3rdzBR/KrF8lRu5DQmtd01Dn//M3xIDf/iFMDGVnVE7tYC3NzMxJQcklE52wFB4OR88 yNd9dMyngc5sQeMhK655/nTL50O9fQwqFfMFGvkFeyzJvIGo6ufBLe0k1qfmKHo4c5ig Bg4BFzP2oZV5dRc0OJVrVmCxgWV0slzuU8YEusvOqHxN5DmW3FldGQxrB2cvfrBbt6/d i7BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678785821; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WkRcazuJb7v9nTIQ0dhQR/wIjE8fenM+pHebExHfSRc=; b=xjoJEjKqqzZMYGIW5hGW9FjkMx6KzAL5OKd8h1Mu9Q1dWFcrVkRo12379yqSY+iycj QZCpqbS5Zn48CI9If9bGHT6RN8YTbE9jTDjSkMY4SGxLQtJyKQHh9hUH9hVb0WbJ/vM9 yCPMO+atCvCsDzC3MCCBulytXfEnLyACb4pt29QOQyOQSlzC43Z5QkH1fOzoOlMpFpI8 sj4FHVj8m31r6M4NOFNJ2UqsbwIGt0ukd3koEyaL5/pOy5j52YkEbhEu02dicAvxePDt 7PvI39eIxreP3Ra9x9gE3xcBydRKSK96vKMu1tbUct8ptpjeCwZQMxwbOh90DpukE5ZB Wycw== X-Gm-Message-State: AO0yUKXXCh1KETe5MGlhioeZKDJgM5TTBKc0TBl/ueJfwD07YvQ8Gqfw jB2eOCuhERvKgWi7tdXh44b8omVBD+Q= X-Received: by 2002:a05:6a20:8e0a:b0:c7:6a98:5bd8 with SMTP id y10-20020a056a208e0a00b000c76a985bd8mr23210905pzj.0.1678785820982; Tue, 14 Mar 2023 02:23:40 -0700 (PDT) Received: from localhost.localdomain ([1.200.129.193]) by smtp.gmail.com with ESMTPSA id f21-20020aa782d5000000b00592626fe48csm1120898pfn.122.2023.03.14.02.23.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Mar 2023 02:23:40 -0700 (PDT) From: Jim Liu To: JJLIU0@nuvoton.com, KWLIU@nuvoton.com, linus.walleij@linaro.org, brgl@bgdev.pl, jim.t90615@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org Subject: [PATCH v5 0/3]Add Nuvoton NPCM SGPIO feature Date: Tue, 14 Mar 2023 17:23:08 +0800 Message-Id: <20230314092311.8924-1-jim.t90615@gmail.com> X-Mailer: git-send-email 2.17.1 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760335011332622501?= X-GMAIL-MSGID: =?utf-8?q?1760335011332622501?= This SGPIO controller is for NUVOTON NPCM7xx and NPCM8xx SoC. Nuvoton NPCM SGPIO module is combine serial to parallel IC (HC595) and parallel to serial IC (HC165), and use APB3 clock to control it. This interface has 4 pins (D_out , D_in, S_CLK, LDSH). NPCM7xx/NPCM8xx have two sgpio module each module can support up to 64 output pins,and up to 64 input pin, the pin is only for gpi or gpo. GPIO pins have sequential, First half is gpo and second half is gpi. Jim Liu (3): gpio: nuvoton: Add Nuvoton NPCM sgpio driver arm: dts: nuvoton: npcm: Add sgpio feature dt-bindings: gpio: add NPCM sgpio driver bindings .../bindings/gpio/nuvoton,sgpio.yaml | 87 +++ arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi | 30 + drivers/gpio/Kconfig | 8 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-npcm-sgpio.c | 648 ++++++++++++++++++ 5 files changed, 774 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/nuvoton,sgpio.yaml create mode 100644 drivers/gpio/gpio-npcm-sgpio.c