From patchwork Wed Apr 27 10:15:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 615525 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3qvwpg4z0Bz9t5Z for ; Wed, 27 Apr 2016 20:16:11 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b=vpY+HOg1; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752378AbcD0KP7 (ORCPT ); Wed, 27 Apr 2016 06:15:59 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:32975 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752273AbcD0KP5 convert rfc822-to-8bit (ORCPT ); Wed, 27 Apr 2016 06:15:57 -0400 Received: by mail-wm0-f65.google.com with SMTP id r12so11466936wme.0; Wed, 27 Apr 2016 03:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=kcuTGJFQgVpAT5T3HsukIjyysXZ5eGyAMs0kacS743M=; b=vpY+HOg175rcFyb+53JUen1YMV30tQCjBZLYN8UOYjOcK72Pd9DhEmZ588OgKOcdsk KQ/fKbh4MKfb9gFr+j3kreEK4gKIm+JHn1dztnO44v6DGfQjiti6jsdjFVzWlNu3hdxB H2CBpH1rOB2g5Bcfyoo1gBPxJ++z2TkKnQYKURC8j86StKdY+0Lt2crNNXVkg6WrTOzp XgN7OsN/oZFcb9IscsVcjgFeb0U4rWppmI2lApBKKJunZaHUJOjnAHLktQc8llP7SnBE sLCyle0fArz64/oFW70wHW5fGa3SUj4Wgdo9FMwF/Y36PtelLwEoS9vMYUoY/6cEsBdf yXgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=kcuTGJFQgVpAT5T3HsukIjyysXZ5eGyAMs0kacS743M=; b=Bav7GEtu+8wsJZ3UBNOuq9Mdk+lqgrjWi0tK3VCvkOIs/CdvEcnXU+3jS9rO0hXxG8 z3EnK5Pyl/ARUu0CF8dqqfdPXo3NgPFy6eQ9ykFzoest9nEuJlwDt1ooRIz90q1qOrWR x834myEeCSRbVsB2nwNtKuIYexCg3V/JF7znyOVSmiIdIHagkFm+9X6SoSWTuCy4ktW+ xxdBm5NLiLuWfH3m4sikLiXqL+IsFTx1Ppva5Vnmw6VL6zC0j/ABWsLkISA6zNwq0Zn9 AJLXPxM3ciFonj3Tpw0trc1K0sgJnnEpnuySuBCsRX2X5R2W4+hW5jsHiuy6leRDTUOy MXGg== X-Gm-Message-State: AOPr4FU8aFKZc40WeLOo2/CQL1wQFSrXuYzJYDRnliF/jXo277ZzT7Wn/Pwu3KIz98laFg== X-Received: by 10.28.213.1 with SMTP id m1mr1053466wmg.103.1461752154619; Wed, 27 Apr 2016 03:15:54 -0700 (PDT) Received: from debian64.daheim ([217.248.179.147]) by smtp.googlemail.com with ESMTPSA id m20sm7659837wma.23.2016.04.27.03.15.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Apr 2016 03:15:53 -0700 (PDT) Received: from localhost.daheim ([127.0.0.1] helo=debian64.localnet) by debian64.daheim with esmtps (TLS1.0:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.87) (envelope-from ) id 1avMVW-000231-Ve; Wed, 27 Apr 2016 12:15:47 +0200 From: Christian Lamparter To: Rob Herring Cc: "linux-gpio@vger.kernel.org" , "devicetree@vger.kernel.org" , =?ISO-8859-1?Q?=C1lvaro_Fern=E1ndez?= Rojas , Kumar Gala , Ian Campbell , Mark Rutland , Pawel Moll , Alexandre Courbot , Linus Walleij Subject: Re: [RFC v3 1/3] gpio: dt-bindings: add basic-mmio-gpio bindings Date: Wed, 27 Apr 2016 12:15:46 +0200 Message-ID: <1838530.usypLq5u4X@debian64> User-Agent: KMail/4.14.10 (Linux/4.6.0-rc4-wt+; KDE/4.14.14; x86_64; ; ) In-Reply-To: References: <7e8845e6b6384c6b5673532ebef79c8730ed7748.1461710784.git.chunkeey@googlemail.com> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Tuesday, April 26, 2016 09:06:14 PM Rob Herring wrote: > On Tue, Apr 26, 2016 at 5:51 PM, Christian Lamparter > wrote: > > From: Álvaro Fernández Rojas > > > > This patch adds the device tree bindings for the basic-mmio-gpio. > > The basic-mmio-gpio is already part of a the GPIO generic library > > and shares its compatible with the platform device. > > These things always start out "simple", "basic" or "generic". Then > people extend them a property or 2 at a time until they are no longer > basic. Make a bunch of GPIO drivers use a generic driver then maybe > I'll be convinced this is a good idea. Well, I mentioned brcm63xx (MIPS) and MyBook Live (PPC). But OK, if you want me to look at the existing code in the kernel. I found the following candidates. 1. MOXA ART: "moxa,moxart-gpio" http://lxr.free-electrons.com/source/drivers/gpio/gpio-moxart.c This driver is used by the: arch/arm/boot/dts/moxart.dtsi --- 3. CLPS711X GPIO driver: "cirrus,clps711x-gpio" http://lxr.free-electrons.com/source/drivers/gpio/gpio-clps711x.c (But there is no DTS which uses the in the kernel) 4. GPIO driver for the TS-4800 board: "technologic,ts4800-gpio" (Again no DTS in kernel) What do you think. There's a total of six devices that can make use of the "basic-mmio-gpio". If this gives me your go-ahead, I'll include them in the series as proper patches. Regards, Christian -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/boot/dts/moxart.dtsi b/arch/arm/boot/dts/moxart.dtsi index 1fd27ed..26707d0 100644 --- a/arch/arm/boot/dts/moxart.dtsi +++ b/arch/arm/boot/dts/moxart.dtsi @@ -66,8 +66,11 @@ gpio: gpio@98700000 { gpio-controller; #gpio-cells = <2>; - compatible = "moxa,moxart-gpio"; - reg = <0x98700000 0xC>; + compatible = "basic-mmio-gpio"; + reg = <0x98700000 0x4 + 0x98700004 0x4 + 0x98700008 0x4>; + reg-names = "set dat dirout"; }; rtc: rtc { --- 2. GE FPGA based GPIO: "ge,imp3a-gpio", "gef,sbc310-gpio", "gef,sbc610-gpio" http://lxr.free-electrons.com/source/drivers/gpio/gpio-ge.c This driver is used by the: arch/powerpc/boot/dts/fsl/ge_imp3a.dts arch/powerpc/boot/dts/fsl/gef_ppc9a.dts arch/powerpc/boot/dts/fsl/gef_sbc610.dts arch/powerpc/boot/dts/fsl/gef_sbc310.dts --- diff --git a/arch/powerpc/boot/dts/fsl/gef_ppc9a.dts b/arch/powerpc/boot/dts/fsl/gef_ppc9a.dts index 0424fc2..20dd084 100644 --- a/arch/powerpc/boot/dts/fsl/gef_ppc9a.dts +++ b/arch/powerpc/boot/dts/fsl/gef_ppc9a.dts @@ -112,9 +112,14 @@ }; gef_gpio: gpio@7,14000 { #gpio-cells = <2>; - compatible = "gef,ppc9a-gpio", "gef,sbc610-gpio"; - reg = <0x7 0x14000 0x24>; + compatible = "basic-mmio-gpio"; + reg = <0x7 0x14000 0x4 + 0x7 0x14004 0x4 + 0x7 0x14008 0x4>; + reg-names = "dirout dat set"; + ngpio = <19>; gpio-controller; + big-endian; }; }; diff --git a/arch/powerpc/boot/dts/fsl/ge_imp3a.dts b/arch/powerpc/boot/dts/fsl/ge_imp3a.dts index a2bb47f..ac5855a 100644 --- a/arch/powerpc/boot/dts/fsl/ge_imp3a.dts +++ b/arch/powerpc/boot/dts/fsl/ge_imp3a.dts @@ -93,9 +93,13 @@ gef_gpio: gpio@4,400 { #gpio-cells = <2>; - compatible = "ge,imp3a-gpio"; - reg = <0x4 0x400 0x24>; + compatible = "basic-mmio-gpio"; + reg = <0x4 0x400 0x02 + 0x4 0x404 0x02 + 0x4 0x408 0x02>; + reg-names = "dirin dat set"; gpio-controller; + big-endian; }; wdt@4,800 { diff --git a/arch/powerpc/boot/dts/fsl/gef_sbc310.dts b/arch/powerpc/boot/dts/fsl/gef_sbc310.dts index 84b3d38..f09528f 100644 --- a/arch/powerpc/boot/dts/fsl/gef_sbc310.dts +++ b/arch/powerpc/boot/dts/fsl/gef_sbc310.dts @@ -113,9 +113,14 @@ }; gef_gpio: gpio@4,8000 { #gpio-cells = <2>; - compatible = "gef,sbc310-gpio"; - reg = <0x4 0x8000 0x24>; + compatible = "basic-mmio-gpio"; + reg = <0x4 0x8000 0x4 + 0x4 0x8004 0x4 + 0x4 0x8008 0x4>; + reg-names = "dirout dat set"; + ngpio = <6>; gpio-controller; + big-endian; }; }; diff --git a/arch/powerpc/boot/dts/fsl/gef_sbc610.dts b/arch/powerpc/boot/dts/fsl/gef_sbc610.dts index 974446a..a9d740a 100644 --- a/arch/powerpc/boot/dts/fsl/gef_sbc610.dts +++ b/arch/powerpc/boot/dts/fsl/gef_sbc610.dts @@ -110,9 +110,14 @@ }; gef_gpio: gpio@7,14000 { #gpio-cells = <2>; - compatible = "gef,sbc610-gpio"; - reg = <0x7 0x14000 0x24>; + compatible = "basic-mmio-gpio"; + reg = <0x7 0x14000 0x4 + 0x7 0x14004 0x4 + 0x7 0x14008 0x4>; + reg-names = "dirout dat set"; + ngpio = <19>; gpio-controller; + big-endian; }; }; ---