From patchwork Fri Apr 27 06:55:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhao X-Patchwork-Id: 8241 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 C066224009 for ; Fri, 27 Apr 2012 06:56:40 +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 82CF7A186EF for ; Fri, 27 Apr 2012 06:56:40 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so857924iag.11 for ; Thu, 26 Apr 2012 23:56:40 -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=ocJRlPytvFBzIk2WR51HU/PwmzoRuavPL4susy7a7bLozDvjSmKSHGUnS6UeFFQM3L AGyymUcCUc8dLK5floTkOc3/IG/cN3O4l22boEar8d/kc9PwBwPnQ9fwNtvcwmkZjc3Q KF5LeF/wjBdqG6HmtcW411APV61+d+Tcwdvfl17FN67BL0q8yCjsYCaSpYSQMlRGwz5e 40TxVsqLf77tN0IJd/FsfWJ665McDFXiUwSsOdaMR6IjQTBeFkIEuJ/W5/A0Snv+3gR/ k6mKYnuk+52L0DcTbjYsG/wNnlKe9u+4w0Vao8e2Mf/xr/xPpSsLzPaydymRAIPBAwTW t3rg== Received: by 10.50.194.163 with SMTP id hx3mr820986igc.49.1335509800330; Thu, 26 Apr 2012 23:56:40 -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 x6csp5119ibt; Thu, 26 Apr 2012 23:56:39 -0700 (PDT) Received: by 10.180.83.38 with SMTP id n6mr3044928wiy.4.1335509798948; Thu, 26 Apr 2012 23:56:38 -0700 (PDT) Received: from db3outboundpool.messaging.microsoft.com (db3ehsobe003.messaging.microsoft.com. [213.199.154.141]) by mx.google.com with ESMTPS id do7si1278887wib.38.2012.04.26.23.56.38 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 Apr 2012 23:56:38 -0700 (PDT) Received-SPF: neutral (google.com: 213.199.154.141 is neither permitted nor denied by best guess record for domain of B20223@freescale.com) client-ip=213.199.154.141; Authentication-Results: mx.google.com; spf=neutral (google.com: 213.199.154.141 is neither permitted nor denied by best guess record for domain of B20223@freescale.com) smtp.mail=B20223@freescale.com Received: from mail12-db3-R.bigfish.com (10.3.81.225) by DB3EHSOBE001.bigfish.com (10.3.84.21) with Microsoft SMTP Server id 14.1.225.23; Fri, 27 Apr 2012 06:56:36 +0000 Received: from mail12-db3 (localhost [127.0.0.1]) by mail12-db3-R.bigfish.com (Postfix) with ESMTP id 09275808DE; Fri, 27 Apr 2012 06:56:36 +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 mail12-db3 (localhost.localdomain [127.0.0.1]) by mail12-db3 (MessageSwitch) id 1335509794601613_10193; Fri, 27 Apr 2012 06:56:34 +0000 (UTC) Received: from DB3EHSMHS017.bigfish.com (unknown [10.3.81.242]) by mail12-db3.bigfish.com (Postfix) with ESMTP id 8343B6005A; Fri, 27 Apr 2012 06:56:34 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS017.bigfish.com (10.3.87.117) with Microsoft SMTP Server (TLS) id 14.1.225.23; Fri, 27 Apr 2012 06:56:34 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.355.3; Fri, 27 Apr 2012 01:56:34 -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 q3R6uBpm008244; Fri, 27 Apr 2012 01:56:30 -0500 (CDT) From: Richard Zhao To: , , CC: , , , , , , , Richard Zhao Subject: [PATCH 04/11] i2c: imx: add pinctrl support Date: Fri, 27 Apr 2012 14:55:55 +0800 Message-ID: <1335509762-7777-5-git-send-email-richard.zhao@freescale.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1335509762-7777-1-git-send-email-richard.zhao@freescale.com> References: <1335509762-7777-1-git-send-email-richard.zhao@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-Gm-Message-State: ALoCoQktgX7i4DF4RJ/rf4tKcdf7M3icbFXxhFT109GyaHaLplXztEo8Rsv7tJ8kS1iUkhCe3lNX 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)) {