From patchwork Mon Mar 12 21:14:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 7242 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 401BE23E29 for ; Mon, 12 Mar 2012 21:15:04 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 01E47A18335 for ; Mon, 12 Mar 2012 21:15:03 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so9574938iag.11 for ; Mon, 12 Mar 2012 14:15:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=AhPiupNdQBG86MocP2Em9HaXfP2OmoQgMt0gCZQM67U=; b=FbppjkbVtR0i0a7S4WqKXl3f2r8ccZXA68ahnnkoZVSPbghwJSBDcg79yZSExZHKRu 5wImr/ys3dGxzMdF4a+lpBBofOVzEchJD2dz3NsxuiI8kWbNT+Cxc8Io4pbpiHXdxx2L gx6rXdNz+y2Dc9CCFY2ulOwIJUcEuZhJv3NhEq2ArGEMjECBtzvHXko78O89SrGR4rQe Yw2UJV55mOhvfuhjenaoqC9Te03sAqdEUk99mZCXm7Cat65pHFWscQzdEopjzEnNJ1nL DNLSe1JDt3oPCoxHA3TcG3SJKgZf9nDwal6cGEmYqk2gB7/rgYoLmx03UeO3SYT0J7HO pIPw== Received: by 10.42.147.199 with SMTP id o7mr17547290icv.50.1331586903783; Mon, 12 Mar 2012 14:15:03 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.53.18 with SMTP id k18csp51569ibg; Mon, 12 Mar 2012 14:15:03 -0700 (PDT) Received: by 10.213.21.211 with SMTP id k19mr1121590ebb.293.1331586902496; Mon, 12 Mar 2012 14:15:02 -0700 (PDT) Received: from eu1sys200aog104.obsmtp.com (eu1sys200aog104.obsmtp.com. [207.126.144.117]) by mx.google.com with SMTP id y9si2426730eef.68.2012.03.12.14.14.49 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 12 Mar 2012 14:15:02 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.117 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.117; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.117 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob104.postini.com ([207.126.147.11]) with SMTP ID DSNKT15nR/bKhMxt9ZhpgW6/FmugFHT35LSh@postini.com; Mon, 12 Mar 2012 21:15:02 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 64063B1; Mon, 12 Mar 2012 21:06:21 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 801F3F90; Mon, 12 Mar 2012 21:14:44 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id CE971A8065; Mon, 12 Mar 2012 22:14:35 +0100 (CET) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Mon, 12 Mar 2012 22:14:43 +0100 From: Linus Walleij To: , Cc: Stephen Warren , Shawn Guo , Thomas Abraham , Dong Aisheng , Rajendra Nayak , Haojian Zhuang , Linus Walleij Subject: [PATCH 4/4 v2] ARM: u300: configure some pins as an example Date: Mon, 12 Mar 2012 22:14:40 +0100 Message-ID: <1331586880-15690-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.8 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmyWdlx8iZcf8qebmHI5wafetk+ud0FUrH9zVNR3wlfbg9ASQqYoSy0q+3tWD4B8q3TEbS5 From: Linus Walleij To show how the pin configuration is used on the U300, let's include some configs for two GPIO pins. ChangeLog v1->v2: - Provide a better example, set the clock return pin to pull-up and set the card detect pin to high impedance. Signed-off-by: Linus Walleij --- arch/arm/mach-u300/core.c | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c index f326d31..a7b3f36 100644 --- a/arch/arm/mach-u300/core.c +++ b/arch/arm/mach-u300/core.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -1605,7 +1606,15 @@ static struct platform_device dma_device = { }, }; -/* Pinmux settings */ +static unsigned long pin_pullup_conf[] = { + PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 1), +}; + +static unsigned long pin_highz_conf[] = { + PIN_CONF_PACKED(PIN_CONFIG_BIAS_HIGH_IMPEDANCE, 0), +}; + +/* Pin control settings */ static struct pinctrl_map __initdata u300_pinmux_map[] = { /* anonymous maps for chip power and EMIFs */ PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-u300", NULL, "power"), @@ -1615,6 +1624,12 @@ static struct pinctrl_map __initdata u300_pinmux_map[] = { PIN_MAP_MUX_GROUP_DEFAULT("mmci", "pinctrl-u300", NULL, "mmc0"), PIN_MAP_MUX_GROUP_DEFAULT("pl022", "pinctrl-u300", NULL, "spi0"), PIN_MAP_MUX_GROUP_DEFAULT("uart0", "pinctrl-u300", NULL, "uart0"), + /* This pin is used for clock return rather than GPIO */ + PIN_MAP_CONFIGS_PIN_DEFAULT("mmci", "pinctrl-u300", "PIO APP GPIO 11", + pin_pullup_conf), + /* This pin is used for card detect */ + PIN_MAP_CONFIGS_PIN_DEFAULT("mmci", "pinctrl-u300", "PIO MS INS", + pin_highz_conf), }; struct u300_mux_hog { @@ -1640,7 +1655,6 @@ static int __init u300_pinctrl_fetch(void) for (i = 0; i < ARRAY_SIZE(u300_mux_hogs); i++) { struct pinctrl *p; - int ret; p = pinctrl_get_select_default(u300_mux_hogs[i].dev); if (IS_ERR(p)) {