Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp44538pxf; Wed, 24 Mar 2021 20:26:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBh72O2qmDdqJIK8JLER/dynANzSBLt8+nN8oKtZFlpL/CsjzjmwWCrX5vGvLjxXZOvuNa X-Received: by 2002:a17:906:753:: with SMTP id z19mr7085100ejb.447.1616642812656; Wed, 24 Mar 2021 20:26:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616642812; cv=none; d=google.com; s=arc-20160816; b=ggXiXgQUw1d2dJ++SnyrovqivRfBL/Zu2Kh9VKaYPpBVJ67IggF3M/Ml8LgVbAK2U4 c4m/x/JEIEeU5ZCFuMK83l/YFgRhYhClxt4Vu53Cz6DuVXN8msjSSCpaUm7/Wfqrp2bf CE891ASHy7xzR9QYltOUd8zzjYPbLpsLndEDUxBKCLYuzqTA/cAiqPZknKI8/hkv0LOP MSoSL+Z0EWBZsJWa9S5Eifgzj8Oft3VxMzVyZccuNeLR+AmKFb8ruQfaHLWDr0UZHMfw xKcjvOcd1WdC9lqSqIxmiM0UDDh+zg9eIXAdR1P0TKqWFztdr9QyeKu4hy7A3t5Ys7xq JV/Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+/KBan7pEXMk9C2eO4o+fG6N3X0BchEzJ4IMvWHgbgc=; b=p8Upj9E87S2KJEENwF120ZAUsCr+5OJPCAECd3a6MAhKg6hdR/GIg/ispEfiveI3NJ 6mX1N1CyElKz0ugXBHYmvSvWDf0AhVkAIybLQXmg31JHEE4hdAPkQo5Yrjk86xSjaJJb jci9z3w8JgamzJLrwMKN9w9tUT0DhpzHOlTFD+bKwpxvuCp3c0Y98rf4G1HbaDRdrmZB uBIuuRmBnMfVKXeC93eaVboMdI6EoPC/cv9TjWDhUqVNDyaz2ao2oF4zD0JGBamYWo+u GVGJVIZGwP4aYYmISfOv2AsoCStvK7Ge5OJv7XSknO5/llPebowXAs9xGCMBLtpLAsiK ih5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@svanheule.net header.s=mail1707 header.b="Cij5y/gx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svanheule.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y3si3191960edo.515.2021.03.24.20.26.30; Wed, 24 Mar 2021 20:26:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@svanheule.net header.s=mail1707 header.b="Cij5y/gx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svanheule.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238284AbhCXVXt (ORCPT + 99 others); Wed, 24 Mar 2021 17:23:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230048AbhCXVXa (ORCPT ); Wed, 24 Mar 2021 17:23:30 -0400 Received: from polaris.svanheule.net (polaris.svanheule.net [IPv6:2a00:c98:2060:a004:1::200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1844C061763 for ; Wed, 24 Mar 2021 14:23:29 -0700 (PDT) Received: from terra.local.svanheule.net (unknown [IPv6:2a02:a03f:eaff:9f01:9a93:b6b:1adc:3da7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id 2129D1E4FF5; Wed, 24 Mar 2021 22:23:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1616621007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+/KBan7pEXMk9C2eO4o+fG6N3X0BchEzJ4IMvWHgbgc=; b=Cij5y/gxGkQOHBR9umvh3CxND9QKD9qr6ZSpEWmU8w6KEYRtelP2GGO345I1JdGSQdti/g HM3JGm3uD9L/dvZjcCRSn799Qlg54lAqrJVefbY6ax0CWXbkWBPkzn5CG165kCCk/GAkvi /XLFBUhvkHlzsXRunDvqBt4e5Al1OxMNR6G1rdEkE16QpIuKSpBPLTKqx0wApDj8TFUoik ++Gv9ksfexuOcY6AUqpz6OG5401cpr4hu5ADNUflh+Nh4FZMCpvZW9kFJlblO4Bf06oAj8 9Oqq/GncIhVJSdLuRjxmmCyy77GxfhNNof1KafhftFZkXJtcLdU7c2ibQuPklA== From: Sander Vanheule To: devicetree@vger.kernel.org, linux-gpio@vger.kernel.org Cc: bert@biot.com, bgolaszewski@baylibre.com, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, maz@kernel.org, robh+dt@kernel.org, tglx@linutronix.de, Sander Vanheule Subject: [PATCH v3 0/2] Add Realtek Otto GPIO support Date: Wed, 24 Mar 2021 22:22:38 +0100 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315082339.9787-1-sander@svanheule.net> References: <20210315082339.9787-1-sander@svanheule.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for the GPIO controller employed by Realtek in multiple series of MIPS SoCs. These include the supported RTL838x and RTL839x. The register layout also matches the one found in the GPIO controller of other (Lexra-based) SoCs such as RTL8196E, RTL8197D, and RTL8197F. For the platform name 'otto', I am not aware of any official resources as to what hardware this specifically applies to. However, in all of the GPL archives we've received, from vendors using compatible SoCs in their design, the platform under the MIPS architecture is referred to by this name. The GPIO ports have been tested on a Zyxel GS1900-8 (RTL8380), and Zyxel GS1900-48 (RTL8393). Furthermore, the GPIO ports and interrupt controller have been tested on a Netgear GS110TPPv1 (RTL8381). Changes in v3: - Remove OF dependencies in driver probe - Don't accept IRQ_TYPE_NONE as a valid interrupt type - Remove (now unused) dev property from control structure - Use u8/u16 port registers, instead of raw u32 registers - Use 'line' name for gpiochip, 'port' and 'pin' names for hardware - Renamed DT bindings file - Dropped fallback-only DT compatible - Various code style clean-ups Changes in v2: - Clarify structure and usage of IMR registers - Added Linus' Reviewed-by tags Sander Vanheule (2): dt-bindings: gpio: Binding for Realtek Otto GPIO gpio: Add Realtek Otto GPIO support .../bindings/gpio/realtek,otto-gpio.yaml | 78 ++++ drivers/gpio/Kconfig | 11 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-realtek-otto.c | 335 ++++++++++++++++++ 4 files changed, 425 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml create mode 100644 drivers/gpio/gpio-realtek-otto.c -- 2.30.2