Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1833104imm; Thu, 23 Aug 2018 09:28:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYpDn2df30DG+tU2bSDAEut6p1jkW7uZR03db4ZIFD4i6m0HBS/7r7TqDlcnOyQXek2r2gJ X-Received: by 2002:a62:1d54:: with SMTP id d81-v6mr11314653pfd.139.1535041711307; Thu, 23 Aug 2018 09:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535041711; cv=none; d=google.com; s=arc-20160816; b=05F7mUskyE+xD4/p/9WZkMYkRE6VkWDmqJtmrHDGy2Y5y18OPKnSEnIAbLs42v8vMB QOT2Tf9AJLJV8OsIYuPref4pSiPorR24Ge/ssezQiGcf3CwsNgrqFup08XL/64/daTiY vMl2r6Tf7BElNyWFJt1iePoo51QAgt/6TZGpi/rQ5kT307YCU8d6wEuEsKWJXQ/YizG3 TmlByWo2P+IPX1vwG+1TWuyPB4ACrR+CyDb5vAKmnYMzoUnrYphh0wrnBYzeeItBuKXy FqAvixpSb57h1Fy8yhux0eVOmUqeXqdlKdc97+3FaCpzbOQRWZeH9w5hMkxBy155Cu0i AVng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=w+d2X8Vl2gzkA1Mx7OqZE+PLWF3VmV4jJWLaVgiVwtY=; b=uOwfLogBJhQOllcPlatIxabvsa+mS573vPNF8/yMF2OZBBarzzWtLGwEiyLLeXQg0J H8xzNsWgl+8bCDvWzmPtq3n/a4B/Edh2CaPBqlH9BaswyIf5QLEfdhRisKJTo52luicH Uuc7HbKNddkzC4el8cf/7sNCD1VH1uFI7GUdgHqGDZpVkDo4lWmXsiQe5/J0Tqpfr0gF rmDGMlZH5O4AVsCDDoloizu1w8eip7lWQAzGxCAz7pL5bTr72ocr4y4ftzX4CgGE02th u/CV77ZW+aTyhFxwYmfqD/aXmpfGJFVuKhyAQzqgY4Y6vkSabbn/xxfGphs9Q/HY3Px/ JUHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=k85BW7ge; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p15-v6si4603794pgh.281.2018.08.23.09.28.16; Thu, 23 Aug 2018 09:28:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=k85BW7ge; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732913AbeHWSa0 (ORCPT + 99 others); Thu, 23 Aug 2018 14:30:26 -0400 Received: from smtprelay2.synopsys.com ([198.182.60.111]:33722 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732888AbeHWSa0 (ORCPT ); Thu, 23 Aug 2018 14:30:26 -0400 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id 9EDD910C1B0B; Thu, 23 Aug 2018 08:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1535036423; bh=4mO+DG2HJvLMr9/h2Hb7UT1MV+4SD2+EjpVKOIYZAE8=; h=From:To:Cc:Subject:Date:From; b=k85BW7gel1oTzR/ZxVu+LNh27qC40/8k9xTBmhCwDKKq0mjvJN41XX3aBR+GFMMhP 8ApkP+ngbRnv41n8b6qOog21mlW/4elR+5Lbf/pzIKxpWN+KebjWm+s61DikY9st/F bv8GpCqbCBCTbN4AyCtJhw0asifGVg1656T5baq2sUa/6yvKQu1loynMEq7IKovsJB 93+9cL648ePKaA9wobGXjAcDKJE4spfAnydbTbhvvTWYHwpN+/aMUNb8JzkBxJFKNt n8CUII9/X16Qp1EdBxo+BUr4eW3XAEZGPASSNmaGLGPQXAYopjLf03UKZpjRGbqUDD Dm0mbZ9hx9Hzg== Received: from paltsev-e7480.internal.synopsys.com (paltsev-e7480.internal.synopsys.com [10.121.3.36]) by mailhost.synopsys.com (Postfix) with ESMTP id AE83D3EB1; Thu, 23 Aug 2018 08:00:19 -0700 (PDT) From: Eugeniy Paltsev To: linux-snps-arc@lists.infradead.org, linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Vineet Gupta , Alexey Brodkin , Linus Walleij , Rob Herring , devicetree@vger.kernel.org, Mark Rutland , Eugeniy Paltsev Subject: [PATCH 0/2] GPIO: add single-register gpio via creg driver Date: Thu, 23 Aug 2018 18:00:11 +0300 Message-Id: <20180823150013.21837-1-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.14.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add single-register MMIO gpio driver for complex cases where only several fields in register belong to GPIO and each GPIO owns field with different length and on/off values. Here is the example: 31 11 8 7 5 0 < bit number | | | | | | [ not used | gpio-1 | shift-1 | gpio-0 | shift-0 ] < 32 bit MMIO ^ ^ (3 bit) (2 bit) | | | | | write 0x2 == set output to "1" (on) | write 0x3 == set output to "0" (off) | write 0x1 == set output to "1" (on) write 0x4 == set output to "0" (off) This is different from gpio-reg, gpio-mmio and gpio-74xx-mmio: * They all don't support cases when GPIO output register have more than one bit per GPIO line. * They don't support holes in MMIO register. * They don't support cases when GPIO lines have different on/off values. This driver supports GPIOs via CREG on various Synopsys SoCs/boards. Eugeniy Paltsev (2): GPIO: add single-register gpio via creg driver dt-bindings: Document the Synopsys GPIO via CREG bindings .../devicetree/bindings/gpio/snps,creg-gpio.txt | 48 ++++ MAINTAINERS | 6 + drivers/gpio/Kconfig | 9 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-creg-snps.c | 242 +++++++++++++++++++++ 5 files changed, 306 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/snps,creg-gpio.txt create mode 100644 drivers/gpio/gpio-creg-snps.c -- 2.14.4