Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1282676pxf; Fri, 26 Mar 2021 05:06:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzW+uS9Og5INYLwkOsET0gDceIygxGL6K8EnkwMbWk+2/HzEeEjxorgZYG1lSH++xx8qkG6 X-Received: by 2002:a05:6402:888:: with SMTP id e8mr14357617edy.51.1616760390975; Fri, 26 Mar 2021 05:06:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616760390; cv=none; d=google.com; s=arc-20160816; b=md5530PNSXuUrFTKXiBSCocIJIPG8u95xQFdGUrQKc8LLoWvaM6aVbKiSC1BgOMtmz zHb+3lni/aHbpG3y9KL2iFMVkb+DVgsDk/rq9d2Qv5cYJTOcjD/ioObeAlkLbBwwFlE+ vM3DDUBVvfeLlYBj6ym3Njzax4+8bqDnKdEtXd5wtnA0+VrOLQUzc5ke6NKGuPZZKcLi WmQC+yCyTdDg2Jm+esTRiTm/Qq8flg6NL1ef6FW3izccl5q5B5cepnjxw4jyfrjni6gW jxUOEZQugleuH1PC9Jy2esGD2EbHZ8gj5EF4sBa27sturf7zp95byO7tjBkhqdMSteUu v1FA== 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=EVsmFVeEo1wlLuqCsgNHIjMoIql8i6Dle436XRDTZaE=; b=fOHKCmA2B6Yljms/bgF7LpoXexamC3ZTd12PGDwRIK2UgPDbeMeQ8HQP95MuHPyITb Q2PE9N0tRVJCDpMnK0ijCIOf7c9nx7y4pmTqyVlN1HJHsJNyd5G6PDLhtIosxbF/dRCG xh90svGRboWwZLBXWRnfwCQy9S4GhRGvZLoYv2BKlTSC97JXROdqL6VXsPKcNXai0tvu 39lByPSt074baPvic1xCVQgoiPt27Pb1fcAlTYPZN5i5TSQCDJLOKKmr74lP8niVcL3r EQ9R7TPgNPzqbhTYkyPkvJpfkbZO2z1x3+hrTJ9EXwL4h4kp+olKkI8DFUfap/e5qURu 5lIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@svanheule.net header.s=mail1707 header.b=vRIrMGip; 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 cn4si6590072edb.52.2021.03.26.05.06.08; Fri, 26 Mar 2021 05:06:30 -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=vRIrMGip; 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 S229915AbhCZMEi (ORCPT + 99 others); Fri, 26 Mar 2021 08:04:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229930AbhCZMEO (ORCPT ); Fri, 26 Mar 2021 08:04:14 -0400 Received: from polaris.svanheule.net (polaris.svanheule.net [IPv6:2a00:c98:2060:a004:1::200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E0BDC0613B1 for ; Fri, 26 Mar 2021 05:04:11 -0700 (PDT) Received: from terra.local.svanheule.net (unknown [IPv6:2a02:a03f:eaff:9f01:cce8:c5ff:8b8d:f8cb]) (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 77EAA1E5E51; Fri, 26 Mar 2021 13:04:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1616760247; 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=EVsmFVeEo1wlLuqCsgNHIjMoIql8i6Dle436XRDTZaE=; b=vRIrMGipd8yncEKpB5+KGmKkXgxgtYl2Aj6NzdMff5AjFI+UtrCJK7IxS+l7nNjPZjqLWN ZpNgSXmTWW2BLdfvfpDMNqffzAHK6Q4JnNOFzB7oh4EgWOjlxBe8XqXkVNyW4tMmpheyOf 8tPJkxBfV0g5Hmp7QBR7BhHSY4fqddhaSuk7VfbV/Qp5a4+zfnSqb+J7LaJO18nhJca4F5 gr86Qc+Af50USjkx5S6p0bzVSMAzEUlOPnFeVjF3LLo+xEaR+iJEnw07TG/qpyNKxf9NsW Jbs+/EsdMrJJ2U8DbtkaBy48lNZoD3ZYSULeHj8NoaiF0cO20eFy8k8CZdCkWg== 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, andy.shevchenko@gmail.com, Sander Vanheule Subject: [PATCH v4 0/2] Add Realtek Otto GPIO support Date: Fri, 26 Mar 2021 13:03:44 +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 v4: - Fix pointer notation style - Drop unused read_u16_reg() function - Drop 'inline' specifier from functions 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 | 330 ++++++++++++++++++ 4 files changed, 420 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml create mode 100644 drivers/gpio/gpio-realtek-otto.c -- 2.30.2