Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3201848rdb; Thu, 16 Nov 2023 03:15:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IE8/aYCNNPtTu3U57g+ZNdONp/OxZSxizTW37xVv3VTxe4gvJ8FCRW9j7spWFQsVFdeq5Kt X-Received: by 2002:a17:903:18e:b0:1ce:1674:fd15 with SMTP id z14-20020a170903018e00b001ce1674fd15mr9843221plg.65.1700133320503; Thu, 16 Nov 2023 03:15:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700133320; cv=none; d=google.com; s=arc-20160816; b=XZ733DIm8DmJYzK5XLH9BFYLk/h9oB3Uj5Tgy2TijGvb48X9NIDhJD7az5/Lws82MG U4/2SxeRTTNN2UDV0jOY8C1UNyfEWQHQDMAn3D3vydR9lM63RSb6FE+XSlZY7rBTNmD/ J0eRQGUeeT2LyfEYhF5ttpHgV5JMfELnNOBjvcmXrukGxeBv32muwRcjGpgJk6E6UfnN 8VI5vFYGEBsNngyUJi1FgvoVtgMIeFjUjFYH/dFJqCUHEtKuB9ej7S02ycnnCVHKB8MT uTKpmq/bqh5qv9pwdelCtR/FcLNqLtfW7b7rLMP+w701mDC4lTOgrt1OF4MATwDxiiVs Fstw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=XwHsg61rMg2KBsI9G4HLsVPXZM9Cu36/BSjN/NQnWK4=; fh=4x4CVoEVJ/qmUij6PguRWMnP5yWSWHxwDunzVsvJyrM=; b=PKm9/qPxl1r3Py0N+TORiUnEXwFiQcsYzKFKy9dO1W6TuIUD/w1Y/Eo8FCiWq8bwJI mQhzi2lfDVCwL0CdEL/FADH6GmUbIm0Y7jZLvqmAplVS+o1RL9QDugzfgmSq7p5mg7dR a6gZVd5E4qgHp0q21ce2Q4fjdchAVczGOBDyCyy4ESCMJ+dhhdFDuqIGjlLefafUp9+r X5+aPfuX6uj/BJETLRja7iRlyO4AW/g7tUSn1u76fbt9S8YoLgdDtGxA3WB2hqc6GEVm PqieRwUHS/yUFut9q2NW5x8FXrOs+8BNpPj0SpY/i4tMvuPnlU5nkxfI8HWP+OL1hpQa 7qqg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id i2-20020a170902cf0200b001c0c79b3869si13353734plg.578.2023.11.16.03.15.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 03:15:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id DB57981CEB0D; Thu, 16 Nov 2023 03:15:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345094AbjKPLPL (ORCPT + 99 others); Thu, 16 Nov 2023 06:15:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344987AbjKPLPE (ORCPT ); Thu, 16 Nov 2023 06:15:04 -0500 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8075DA8; Thu, 16 Nov 2023 03:15:00 -0800 (PST) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 3AGBElcS62392432, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.95/5.92) with ESMTPS id 3AGBElcS62392432 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Nov 2023 19:14:47 +0800 Received: from RTEXDAG01.realtek.com.tw (172.21.6.100) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 16 Nov 2023 19:14:47 +0800 Received: from RTEXH36506.realtek.com.tw (172.21.6.27) by RTEXDAG01.realtek.com.tw (172.21.6.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Thu, 16 Nov 2023 19:14:47 +0800 Received: from localhost.localdomain (172.21.252.101) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 16 Nov 2023 19:14:47 +0800 From: Tzuyi Chang To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: , , , TY Chang Subject: [PATCH v2 0/2] Add gpio driver support for Realtek DHC SoCs Date: Thu, 16 Nov 2023 19:14:38 +0800 Message-ID: <20231116111441.2339-1-tychang@realtek.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-KSE-ServerInfo: RTEXDAG01.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 16 Nov 2023 03:15:19 -0800 (PST) These patches add the bindings and the gpio driver for Realtek DHC(Digital Home Center) RTD SoCs, including RTD1295, RTD1395, RTD1619, RTD1319, RTD1619B, RTD1319D and RTD1315E. Change log: v1->v2: 1. Add description for DHC RTD SoCs in the bindings. 2. Revise the compatible names in the bindings. 3. Transitioned from OF API to platform_device API. 4. Use u8 for the offset array within the rtd_gpio_info structure. 5. Record the size of each array within the rtd_gpio_info structure and implement checks to prevent out-of-bounds access. 6. Use GPIOLIB_IRQCHIP helpers to register interrupts. 7. Use dynamic allocation for GPIO base. Tzuyi Chang (2): dt-bindings: gpio: realtek: Add realtek,rtd-gpio Add GPIO support for Realtek DHC(Digital Home Center) RTD SoCs. .../bindings/gpio/realtek,rtd-gpio.yaml | 74 ++ drivers/gpio/Kconfig | 9 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-rtd.c | 736 ++++++++++++++++++ 4 files changed, 820 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/realtek,rtd-gpio.yaml create mode 100644 drivers/gpio/gpio-rtd.c -- 2.42.0