From patchwork Sun Feb 22 16:59:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 5862291 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 72DA2BF440 for ; Sun, 22 Feb 2015 17:04:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8808820591 for ; Sun, 22 Feb 2015 17:04:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9D5202058C for ; Sun, 22 Feb 2015 17:04:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YPZv5-00056o-Ua; Sun, 22 Feb 2015 17:02:15 +0000 Received: from opensource.wolfsonmicro.com ([80.75.67.52]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YPZv1-00054O-Oi; Sun, 22 Feb 2015 17:02:12 +0000 Received: from localhost.localdomain (unknown [87.246.78.26]) by opensource.wolfsonmicro.com (Postfix) with ESMTPSA id 4CD61110719; Sun, 22 Feb 2015 17:01:47 +0000 (GMT) From: Charles Keepax To: swarren@wwwdotorg.org, lee@kernel.org Subject: [PATCH] ARM: bcm2835: Add header file for pinctrl constants Date: Sun, 22 Feb 2015 16:59:56 +0000 Message-Id: <1424624396-812-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.7.2.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150222_090212_156018_84855CFC X-CRM114-Status: GOOD ( 10.31 ) X-Spam-Score: -0.0 (/) Cc: devicetree@vger.kernel.org, linux@arm.linux.org.uk, pawel.moll@arm.com, linux-kernel@vger.kernel.org, robh+dt@kernel.org, linux-rpi-kernel@lists.infradead.org, galak@codeaurora.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds a header file for the constants used in pincontrol configuration for the bcm2835. Signed-off-by: Charles Keepax --- arch/arm/boot/dts/bcm2835-rpi-b-plus.dts | 4 +- arch/arm/boot/dts/bcm2835-rpi-b.dts | 4 +- arch/arm/boot/dts/bcm2835-rpi.dtsi | 8 ++-- arch/arm/boot/dts/bcm2835.dtsi | 4 ++- include/dt-bindings/pinctrl/pinctrl-bcm2835.h | 39 +++++++++++++++++++++++++ 5 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 include/dt-bindings/pinctrl/pinctrl-bcm2835.h diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts index e479515..e3418c2 100644 --- a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts +++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts @@ -1,5 +1,5 @@ /dts-v1/; -/include/ "bcm2835-rpi.dtsi" +#include "bcm2835-rpi.dtsi" / { compatible = "raspberrypi,model-b-plus", "brcm,bcm2835"; @@ -25,6 +25,6 @@ /* I2S interface */ i2s_alt0: i2s_alt0 { brcm,pins = <18 19 20 21>; - brcm,function = <4>; /* alt0 */ + brcm,function = ; }; }; diff --git a/arch/arm/boot/dts/bcm2835-rpi-b.dts b/arch/arm/boot/dts/bcm2835-rpi-b.dts index bafa46f..541788a 100644 --- a/arch/arm/boot/dts/bcm2835-rpi-b.dts +++ b/arch/arm/boot/dts/bcm2835-rpi-b.dts @@ -1,5 +1,5 @@ /dts-v1/; -/include/ "bcm2835-rpi.dtsi" +#include "bcm2835-rpi.dtsi" / { compatible = "raspberrypi,model-b", "brcm,bcm2835"; @@ -18,6 +18,6 @@ /* I2S interface */ i2s_alt2: i2s_alt2 { brcm,pins = <28 29 30 31>; - brcm,function = <6>; /* alt2 */ + brcm,function = ; }; }; diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi index c706448..76b0a40 100644 --- a/arch/arm/boot/dts/bcm2835-rpi.dtsi +++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi @@ -1,4 +1,4 @@ -/include/ "bcm2835.dtsi" +#include "bcm2835.dtsi" / { memory { @@ -21,17 +21,17 @@ gpioout: gpioout { brcm,pins = <6>; - brcm,function = <1>; /* GPIO out */ + brcm,function = ; }; alt0: alt0 { brcm,pins = <0 1 2 3 4 5 7 8 9 10 11 14 15 40 45>; - brcm,function = <4>; /* alt0 */ + brcm,function = ; }; alt3: alt3 { brcm,pins = <48 49 50 51 52 53>; - brcm,function = <7>; /* alt3 */ + brcm,function = ; }; }; diff --git a/arch/arm/boot/dts/bcm2835.dtsi b/arch/arm/boot/dts/bcm2835.dtsi index 3342cb1..31f6586 100644 --- a/arch/arm/boot/dts/bcm2835.dtsi +++ b/arch/arm/boot/dts/bcm2835.dtsi @@ -1,4 +1,6 @@ -/include/ "skeleton.dtsi" +#include + +#include "skeleton.dtsi" / { compatible = "brcm,bcm2835"; diff --git a/include/dt-bindings/pinctrl/pinctrl-bcm2835.h b/include/dt-bindings/pinctrl/pinctrl-bcm2835.h new file mode 100644 index 0000000..c74532e --- /dev/null +++ b/include/dt-bindings/pinctrl/pinctrl-bcm2835.h @@ -0,0 +1,39 @@ +/* + * This header provides constants for BCM2835 pinctrl bindings. + * + * Copyright 2015, Cirrus Logic Inc. + * + * Author: Charles Keepax + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef _DT_BINDINGS_PINCTRL_BCM2835_H +#define _DT_BINDINGS_PINCTRL_BCM2835_H + +/* IRQ Flags */ +#define BCM2835_PIN_IRQ_RISING 1 +#define BCM2835_PIN_IRQ_FALLING 2 +#define BCM2835_PIN_IRQ_EDGE (BCM2835_PIN_IRQ_RISING | \ + BCM2835_PIN_IRQ_FALLING) +#define BCM2835_PIN_IRQ_LOW 4 +#define BCM2835_PIN_IRQ_HIGH 8 + +/* Pin Function Settings */ +#define BCM2835_PIN_FUNC_GPIO_IN 0 +#define BCM2835_PIN_FUNC_GPIO_OUT 1 +#define BCM2835_PIN_FUNC_ALT5 2 +#define BCM2835_PIN_FUNC_ALT4 3 +#define BCM2835_PIN_FUNC_ALT0 4 +#define BCM2835_PIN_FUNC_ALT1 5 +#define BCM2835_PIN_FUNC_ALT2 6 +#define BCM2835_PIN_FUNC_ALT3 7 + +/* Pin Pull Settings */ +#define BCM2835_PIN_PULL_NONE 0 +#define BCM2835_PIN_PULL_DOWN 1 +#define BCM2835_PIN_PULL_UP 2 + +#endif