Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1546103rdb; Thu, 7 Dec 2023 02:08:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHC0DDro1v2bgosKrIzbpqsGJPXHaNJ75S3+5VDPI96eafp8qXlqVAwTfLzxLI2tdb69txU X-Received: by 2002:a05:6a20:a303:b0:18f:97c:5b74 with SMTP id x3-20020a056a20a30300b0018f097c5b74mr1459332pzk.66.1701943698009; Thu, 07 Dec 2023 02:08:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701943697; cv=none; d=google.com; s=arc-20160816; b=tHBEhKTtNjJOukRbAyTkaveeOrnlPSLs3xj6LD5EBB9t08b/yUKmIf9hZS/mWpq4G/ hdbaQGclkofEF7Gu5q8bPkhkkSKZf4Wf2EKuGds2T+jIVBWyluxgRQA9zGMVrPRH5PXx otqxf/d8WFYpTTXYl/gujnv6rBdcaZriQwh1ka+oPONjyoX3VQNIvIpM2vTPaHLwY4+q ji3YatL9ISAmwWQqXC1f5wxS60g5svHIfjxWh0xhhrfCZvvvvTRhmKymYQ9xZoBQrCE5 p1H3dYO/C3L6ylSZLLz2WMIFiA3FhbQkcf+mP1SmKJtW6oJy8IzAkPG7om9rOVt2rm2+ g24Q== 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=SDrl2FNcezpIMp/PW5071jxMhFEKAb0JwGqSnE36jiU=; fh=4x4CVoEVJ/qmUij6PguRWMnP5yWSWHxwDunzVsvJyrM=; b=qhlqYNiPBIjk5eSW4L+LWSGCO4LhcG0Xiu2a984CU2MgVtCmkM+8T06Ah49Boe2574 FLweEMAt38K4klajU1+xyY67x//nZ5YjGYqE6Cb3+puTqFBvaEcQ823H7MLzoFr2Z6Qw 8UngtheTWA3sKEVbgNfozAcSQWalIw3UkDFnLbOsP0tEFyagzCl/b+j1tkPCbfff12Pg n1ckm/NP76xqgPJIbXj0oBiFUAQ0L841X3EMGYddNWFjLaq8Ui3mvU/LDjGDPxZ/APXr Cqb87vQy0Wq2Ec3LoWnxQzS8uc5WujYU7ICO0hm09EAcjUVYF8cdYDxzCww9N25OlJLI NJVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id w11-20020a17090abc0b00b002886d99b09csi860609pjr.73.2023.12.07.02.08.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 02:08:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id DF50C80C9A68; Thu, 7 Dec 2023 02:08:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232507AbjLGKH6 (ORCPT + 99 others); Thu, 7 Dec 2023 05:07:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232066AbjLGKH4 (ORCPT ); Thu, 7 Dec 2023 05:07:56 -0500 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFCB8193; Thu, 7 Dec 2023 02:08:02 -0800 (PST) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 3B7A7mB32077970, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.95/5.92) with ESMTPS id 3B7A7mB32077970 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 Dec 2023 18:07:48 +0800 Received: from RTEXMBS01.realtek.com.tw (172.21.6.94) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.32; Thu, 7 Dec 2023 18:07:48 +0800 Received: from RTEXH36506.realtek.com.tw (172.21.6.27) by RTEXMBS01.realtek.com.tw (172.21.6.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Thu, 7 Dec 2023 18:07:48 +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, 7 Dec 2023 18:07:48 +0800 From: TY Chang To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: , , , TY Chang Subject: [PATCH v3 0/2] Add gpio driver support for Realtek DHC SoCs Date: Thu, 7 Dec 2023 18:07:21 +0800 Message-ID: <20231207100723.15015-1-tychang@realtek.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-KSE-ServerInfo: RTEXMBS01.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-ServerInfo: RTEXH36505.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=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Thu, 07 Dec 2023 02:08:14 -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: v2->v3: 1. Remove generic compatible and use SoC-specific compatible instead. 2. Add the missing descriptions for the rtd_gpio_info structure members. 3. Assign gpio_chip fwnode. 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 | 69 ++ drivers/gpio/Kconfig | 9 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-rtd.c | 748 ++++++++++++++++++ 4 files changed, 827 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/realtek,rtd-gpio.yaml create mode 100644 drivers/gpio/gpio-rtd.c -- 2.43.0