Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp6973779imm; Tue, 28 Aug 2018 04:28:49 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaYB/hH2/JyN9s8+J3GsE4GOJhfSkjgVGC4BNz1hkm35fkemQ2d3ZPfScUzVj4L7uSuwl0a X-Received: by 2002:a62:2983:: with SMTP id p125-v6mr1136830pfp.128.1535455729214; Tue, 28 Aug 2018 04:28:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535455729; cv=none; d=google.com; s=arc-20160816; b=g7JDuZvAEtmXJVcjvETGjJ62NILoBJbOH5rqSyXglE3/KJdBy0aGAPVGNbxUEbq+Bi m8v58pPheN6NiubFHpey8dDMHajAGJec3IRtkod5z7A3OIngG7wYfWFxc4JAjXSA3HKj C+CtBYutssseEli4GqrkgsyFrdZtR1+SFxM2BO5kiTk0fOWBBe08mdw3RtpOlLYw6dxw Yg1YCJonR0L6v0Xwys4XDV1/AF0XhFGDH9JxXUXT69baHtJE71E3MdGQoEpO6uxjvoUx bAWa1DTWhdTX5XbJ+Y0OM/+qx1C7K/HThtUb85B4w4LyyxWOLJbrq2v8DokMgv/CsIGq aAvA== 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=p1PS08PVXSQja6QU3ebtdUWLm4s4aJLjEt+gV2263l8=; b=tSNOmNuSIbsYmxbZwUbu5SuDs/u6CIMi7kdgdhJkRbyNhO61OSBAf+GgAAixdSSc/0 P9eAiOnzdujTGdJGeYDYOaQ4SQ+72vSQXfORdmXemGKJhWIEBl2xvD+IzClASFPOxrd4 xRWHRhQZLRrC+Q1hnS4crk7s/VLCPjJSEFIKEw/VcSIxAG3ZzYpK9r576R1aqCqj+My6 Ru4nmB0pvF/meAgbhPthvbkbhQHj1d8eFW1O+YxXI9U44+TsKEoMTLDcDaZgzxx74u6u EgHCBTBXuTSujDd7wWcA68PolZ2tJ1oTugsw5QYwIsH0Hg6fYYxKsQqhQxiYb4dTzcUc XJAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=G2j6AlXr; 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 144-v6si802779pfw.95.2018.08.28.04.28.34; Tue, 28 Aug 2018 04:28:49 -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=G2j6AlXr; 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 S1727752AbeH1PSk (ORCPT + 99 others); Tue, 28 Aug 2018 11:18:40 -0400 Received: from smtprelay4.synopsys.com ([198.182.47.9]:33112 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727201AbeH1PSk (ORCPT ); Tue, 28 Aug 2018 11:18:40 -0400 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 Cc: linux-kernel@vger.kernel.org, Vineet Gupta , Alexey Brodkin , Linus Walleij , Rob Herring , devicetree@vger.kernel.org, Mark Rutland , Eugeniy Paltsev 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 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 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 -- 2.14.4