From patchwork Tue Aug 28 11:27:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugeniy Paltsev X-Patchwork-Id: 962871 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="j5esq76+"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.b="G2j6AlXr"; 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 42061Y2X99z9s3Z for ; Tue, 28 Aug 2018 21:27:45 +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=3eii/lbIyAF2EcrtFp3Ehj7lBUeIfCFikcU3Lr1vygg=; b=j5e sq76+WlHrtxUgqy4hV0tF/dTiGPkrT4CFCygcw1HzP+rXQWBJQ2OaAbf7Dwo4GIuBpGkl7Szqs27d L1F/oVwJ8cLZz7AT9Ef6k9WIjXp4KtM4s4GYSI28D216Yz6R+gY61yj58yq/yHTJNXjg+w7xyM2AC BmM8WVj2h77Yir0qgmamfbBIp7K/FtA//5KbnlWbfYO1oZAOvnfehXxjlIo+flrus2tdTycFUe2Lr klKivUmV6zUH/r6b++anef8UyXM7sqvigN5waesV3IO0Ux62a54flaGLo5/YQezGRam5LZu6NhpD7 z9PbIhjv/ro1ZbMNEW2iukyAPjn7DHg==; 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 1fuc9u-0008S1-Cg; Tue, 28 Aug 2018 11:27:42 +0000 Received: from smtprelay.synopsys.com ([198.182.47.9]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuc9r-0008Pr-AD for linux-snps-arc@lists.infradead.org; Tue, 28 Aug 2018 11:27:41 +0000 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 7D15624E23D2; Tue, 28 Aug 2018 04:27:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1535455648; bh=aN8zzZQ0BA2ndzTYT0yp7g0qhluSBS46Vc+R4A/Cl8U=; h=From:To:Cc:Subject:Date:From; b=G2j6AlXrkeMCw3DZEhpm+moqe2kfzG2jxGK7QhgVQ7/TORSjQgpDB1tR0AA2EszZY KJpQtlEcoLZFR+vypuzd/z0TAGQan+WL3TNmus+GNhEBhTEbz3klYUK8KHcE6YujDH nrFhix+o6BZEzd1HnkaL+iW1ABxSIi9VV/fWNhnslhUh+UuapSTFn6IUy/bUUsNxBx Txjcl2AEHo1vZ8CMg3uI7Nx3AU9QvnFhc3Z2CcKvOpFA69XC29MleB3fMus/06MwF2 d+tbEqaBezWy/r1+lKza8AREwUp3CMsgp6F56KjjRXO9Jf43/uXx7kBMYLLBFuvN2+ fZrQoc85zefxA== Received: from paltsev-e7480.internal.synopsys.com (paltsev-e7480.internal.synopsys.com [10.121.3.36]) by mailhost.synopsys.com (Postfix) with ESMTP id E83B65F93; Tue, 28 Aug 2018 04:27:24 -0700 (PDT) From: Eugeniy Paltsev To: linux-snps-arc@lists.infradead.org, linux-gpio@vger.kernel.org Subject: [PATCH v2 0/2] GPIO: add single-register GPIO via CREG driver Date: Tue, 28 Aug 2018 14:27:19 +0300 Message-Id: <20180828112721.28178-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-20180828_042739_380673_E9C07CBC X-CRM114-Status: GOOD ( 10.65 ) 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.47.9 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -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 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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 lines and each GPIO line owns a field with different length and on/off value. 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 ^ ^ register (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 | 49 +++++ MAINTAINERS | 6 + drivers/gpio/Kconfig | 9 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-creg-snps.c | 242 +++++++++++++++++++++ 5 files changed, 307 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/snps,creg-gpio.txt create mode 100644 drivers/gpio/gpio-creg-snps.c