From patchwork Thu Aug 23 15:00:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugeniy Paltsev X-Patchwork-Id: 961434 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=synopsys.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MPfFfy5f"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.b="k85BW7ge"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41x7072vYwz9s4v for ; Fri, 24 Aug 2018 01:01:11 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=5qOsYY99SbBdbUzk17xQ55tIAlviw6r9XJ1KhZ8YKCE=; b=MPf Ffy5fFyPNoNt2HK+i7gaIviL+ehxqsQ5iGPvLZbjLP3p2kM0AXPZidKyym95AIycFrJm+YUxmCt9Z lzk+f3fSBMs/k5IVl1OO+9WR+mY7W+yVBLd7bBWNA6Nz6mfQ4d4sFknfGr66jxbD6EzOFWday2obH URKWj3tB6RnWrafCyeERy4Hh/rDNeowFZpay9g6MPQ53dEL+hnHTe8xK8/ldIiYFA56LM7ruGr085 6EycUVfvueSWmkkdItAZMFSIGAb2+qswhM9nGJVlscYe7PAug9ycJ8JiaNVqsZa4+lCe3R7pzRKrq xPUFAMR0ElKJKdevA2CIo4uPQGNeBRQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fsr6j-0002MB-5w; Thu, 23 Aug 2018 15:01:09 +0000 Received: from smtprelay.synopsys.com ([198.182.60.111]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fsr6C-00025O-EQ for linux-snps-arc@lists.infradead.org; Thu, 23 Aug 2018 15:00:37 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180823_080036_506797_187FB4CA X-CRM114-Status: GOOD ( 11.18 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.60.111 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Vineet Gupta , Alexey Brodkin , linux-kernel@vger.kernel.org, Rob Herring , Eugeniy Paltsev , Linus Walleij MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.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