From patchwork Fri Apr 27 07:02:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhao X-Patchwork-Id: 8277 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 49A3123E42 for ; Fri, 27 Apr 2012 07:03:33 +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 12D42A183AB for ; Fri, 27 Apr 2012 07:03:32 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so865204iag.11 for ; Fri, 27 Apr 2012 00:03:32 -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 :x-spamscore:x-bigfish:x-forefront-antispam-report:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:x-originatororg:x-gm-message-state; bh=Ukw7BVx86D0Kyjxyn8OeDuvxFtKgsKwMWAFfSObaUH8=; b=FTLFO6Do8S5QNC4cmMt6OxG13ywg7dfXXDBV7Ugyw1XZhF6MXfOTPQ2bt4Q0k3gKYK nguSSuaaLx4tksloqSqVbi0jNip3SL1CiAqoFhupHdSPTMmou1BK1r3249IhRmmzt9SO +DWuUpcRoDeqMw3WsejB18cEzxL2p/AIMB8ADXS8FVrG/EpWkMtBkBg5ciec9iLgyK8H +bujPNGTXVp1e/Ga0+HCkMCmZtjglPChbREGXlAYCEiCBrlCCTwjuU62gCpvSxeubkBJ eTHk513HTS46+BDuGhEpGsE/3wsv5ltUHKqMClddxOUgWvvZDRbvrxXHeXjB1lK09JWA Ge6A== Received: by 10.50.194.163 with SMTP id hx3mr833798igc.49.1335510212850; Fri, 27 Apr 2012 00:03:32 -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.137.198 with SMTP id x6csp5450ibt; Fri, 27 Apr 2012 00:03:32 -0700 (PDT) Received: by 10.180.94.33 with SMTP id cz1mr3040658wib.13.1335510211318; Fri, 27 Apr 2012 00:03:31 -0700 (PDT) Received: from db3outboundpool.messaging.microsoft.com (db3ehsobe006.messaging.microsoft.com. [213.199.154.144]) by mx.google.com with ESMTPS id fp10si1293986wib.40.2012.04.27.00.03.30 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Apr 2012 00:03:31 -0700 (PDT) Received-SPF: neutral (google.com: 213.199.154.144 is neither permitted nor denied by best guess record for domain of B20223@freescale.com) client-ip=213.199.154.144; Authentication-Results: mx.google.com; spf=neutral (google.com: 213.199.154.144 is neither permitted nor denied by best guess record for domain of B20223@freescale.com) smtp.mail=B20223@freescale.com Received: from mail104-db3-R.bigfish.com (10.3.81.229) by DB3EHSOBE006.bigfish.com (10.3.84.26) with Microsoft SMTP Server id 14.1.225.23; Fri, 27 Apr 2012 07:03:29 +0000 Received: from mail104-db3 (localhost [127.0.0.1]) by mail104-db3-R.bigfish.com (Postfix) with ESMTP id 7F9713A066F; Fri, 27 Apr 2012 07:03:28 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839hd24he5bh) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail104-db3 (localhost.localdomain [127.0.0.1]) by mail104-db3 (MessageSwitch) id 1335510205685610_1229; Fri, 27 Apr 2012 07:03:25 +0000 (UTC) Received: from DB3EHSMHS018.bigfish.com (unknown [10.3.81.240]) by mail104-db3.bigfish.com (Postfix) with ESMTP id 9853940026B; Fri, 27 Apr 2012 07:03:25 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS018.bigfish.com (10.3.87.118) with Microsoft SMTP Server (TLS) id 14.1.225.23; Fri, 27 Apr 2012 07:03:25 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server id 14.1.355.3; Fri, 27 Apr 2012 02:03:26 -0500 Received: from b20223-02.ap.freescale.net (b20223-02.ap.freescale.net [10.192.242.124]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id q3R737LM008722; Fri, 27 Apr 2012 02:03:22 -0500 (CDT) From: Richard Zhao To: , , CC: , , , , , , , Richard Zhao Subject: [PATCH 04/11] i2c: imx: add pinctrl support Date: Fri, 27 Apr 2012 15:02:58 +0800 Message-ID: <1335510185-7906-5-git-send-email-richard.zhao@freescale.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1335510185-7906-1-git-send-email-richard.zhao@freescale.com> References: <1335510185-7906-1-git-send-email-richard.zhao@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-Gm-Message-State: ALoCoQljXtjnn/tmkK1b9nWD2uLAZLVSgNKZp7eRsV5CGj3eILMnKEo4Uvh7NNdyhZOQUox+L2mM Signed-off-by: Richard Zhao --- arch/arm/boot/dts/imx6q-sabrelite.dts | 2 ++ arch/arm/boot/dts/imx6q.dtsi | 16 ++++++++++++++++ drivers/i2c/busses/i2c-imx.c | 9 +++++++++ 3 files changed, 27 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts index 4663a4e..4e13293 100644 --- a/arch/arm/boot/dts/imx6q-sabrelite.dts +++ b/arch/arm/boot/dts/imx6q-sabrelite.dts @@ -50,6 +50,8 @@ i2c@021a0000 { /* I2C1 */ status = "okay"; clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c1_1>; codec: sgtl5000@0a { compatible = "fsl,sgtl5000"; diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi index 2ba32e7..fe8c80d 100644 --- a/arch/arm/boot/dts/imx6q.dtsi +++ b/arch/arm/boot/dts/imx6q.dtsi @@ -390,6 +390,22 @@ reg = <0x020e0000 0x4000>; /* shared pinctrl settings */ + i2c1 { + pinctrl_i2c1_1: i2c1grp-1 { + fsl,pins = "MX6Q_PAD_EIM_D21", + "MX6Q_PAD_EIM_D28"; + fsl,hysteresis = <1>; + fsl,mux = <0x16 0x11>; + fsl,pull = <2>; + fsl,pue = <1>; + fsl,pke = <1>; + fsl,open-drain = <1>; + fsl,speed = <2>; + fsl,drive-strength = <6>; + fsl,slew-rate = <1>; + }; + }; + uart4 { pinctrl_uart4_1: uart4grp-1 { fsl,pins = "MX6Q_PAD_KEY_COL0", diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index dfb84b7..7a52067 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -470,6 +471,7 @@ static int __init i2c_imx_probe(struct platform_device *pdev) struct imx_i2c_struct *i2c_imx; struct resource *res; struct imxi2c_platform_data *pdata = pdev->dev.platform_data; + struct pinctrl *pct; void __iomem *base; resource_size_t res_size; int irq, bitrate; @@ -520,6 +522,13 @@ static int __init i2c_imx_probe(struct platform_device *pdev) i2c_imx->base = base; i2c_imx->res = res; + pct = devm_pinctrl_get_select_default(&pdev->dev); + if (IS_ERR(pct)) { + dev_err(&pdev->dev, "can't get/select pinctrl\n"); + ret = PTR_ERR(pct); + goto fail3; + } + /* Get I2C clock */ i2c_imx->clk = clk_get(&pdev->dev, "i2c_clk"); if (IS_ERR(i2c_imx->clk)) {