From patchwork Tue Aug 6 23:04:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 18818 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f199.google.com (mail-gh0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9BA6723A4E for ; Tue, 6 Aug 2013 23:04:26 +0000 (UTC) Received: by mail-gh0-f199.google.com with SMTP id g14sf1165833ghb.6 for ; Tue, 06 Aug 2013 16:04:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=moOHkdG+pDdlp0hoVWRr01PcUnPkaZ4dv5FBU0uLXxM=; b=at+zETbJKeYJPXvLukDutwVM91puBYLOJTpcfVsrx7HXN7Y8pp1dsJUNJLXX7Uvk+l Q0vFm+D19P2FzK04ivYXeBhjcAYfy3CfAx3VohoDwbHyq+Yci7F1IToILEIDW8aRM0A0 YCq+q9YrUGJDFDR4/Ak9dyonvwQHl7LiJaTo7YxDDHWYx14n4rCwbh3eXRkoknp7sjys 5H1GDb2m0H5QM4Wf/YQk8DLAGUkdWjTZ6oKSDifZLaWjamCHgchghJUoJSKM6adKrzGz aDZ2SmhA9XgH1grqBFDsbFRlvrbRav78j5ThMFYSL2v/6q0D0jQShoY+2stE3bwYF/HL 75Jw== X-Received: by 10.58.55.135 with SMTP id s7mr59980vep.1.1375830266142; Tue, 06 Aug 2013 16:04:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.48.44 with SMTP id i12ls455560qen.41.gmail; Tue, 06 Aug 2013 16:04:26 -0700 (PDT) X-Received: by 10.52.186.129 with SMTP id fk1mr113463vdc.66.1375830265995; Tue, 06 Aug 2013 16:04:25 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id gr9si877027vec.111.2013.08.06.16.04.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 Aug 2013 16:04:25 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id d10so1051673vea.5 for ; Tue, 06 Aug 2013 16:04:25 -0700 (PDT) X-Gm-Message-State: ALoCoQlmKqGX9TO4bIh3wSeJVIbzXNcMFeTAJjHdT3FPH3eorJDXpmcf3UM2vqBOihqL52CUDGNu X-Received: by 10.220.198.133 with SMTP id eo5mr161251vcb.24.1375830265872; Tue, 06 Aug 2013 16:04:25 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.11.8 with SMTP id pc8csp171200vcb; Tue, 6 Aug 2013 16:04:25 -0700 (PDT) X-Received: by 10.112.52.225 with SMTP id w1mr473892lbo.31.1375830264397; Tue, 06 Aug 2013 16:04:24 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx.google.com with ESMTPS id 6si1757139lay.178.2013.08.06.16.04.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 Aug 2013 16:04:24 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.217.182 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id v20so961510lbc.41 for ; Tue, 06 Aug 2013 16:04:23 -0700 (PDT) X-Received: by 10.152.9.194 with SMTP id c2mr141687lab.83.1375830263416; Tue, 06 Aug 2013 16:04:23 -0700 (PDT) Received: from localhost.localdomain (c83-249-208-124.bredband.comhem.se. [83.249.208.124]) by mx.google.com with ESMTPSA id am8sm1617425lac.1.2013.08.06.16.04.21 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 06 Aug 2013 16:04:22 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Cc: Linus Walleij Subject: [PATCH] ARM: nomadik: switch to use the Nomadik I2C driver Date: Wed, 7 Aug 2013 01:04:12 +0200 Message-Id: <1375830252-27233-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.1.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Instead of using bit-banged I2C, let's use the actual I2C driver in the kernel. Since the I2C block may be communicating with things like the PMIC, we need to select it from the Kconfig just like the bit-banged adapter is selected today. The rest of the configuration for this driver can be done from the device tree. Signed-off-by: Linus Walleij --- arch/arm/boot/dts/ste-nomadik-stn8815.dtsi | 42 ++++++++++++++++++++++-------- arch/arm/mach-nomadik/Kconfig | 1 + 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi b/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi index a3acfa7..9169d30 100644 --- a/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi +++ b/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi @@ -140,18 +140,30 @@ }; }; i2c0 { + i2c0_default_mux: i2c0_mux { + i2c0_default_mux { + ste,function = "i2c0"; + ste,pins = "i2c0_a_1"; + }; + }; i2c0_default_mode: i2c0_default { i2c0_default_cfg { ste,pins = "GPIO62_D3", "GPIO63_D2"; - ste,input = <1>; + ste,input = <0>; }; }; }; i2c1 { + i2c1_default_mux: i2c1_mux { + i2c1_default_mux { + ste,function = "i2c1"; + ste,pins = "i2c1_a_1"; + }; + }; i2c1_default_mode: i2c1_default { i2c1_default_cfg { ste,pins = "GPIO53_L4", "GPIO54_L3"; - ste,input = <1>; + ste,input = <0>; }; }; }; @@ -159,7 +171,7 @@ i2c2_default_mode: i2c2_default { i2c2_default_cfg { ste,pins = "GPIO73_C21", "GPIO74_C20"; - ste,input = <1>; + ste,input = <0>; }; }; }; @@ -682,13 +694,17 @@ /* I2C0 connected to the STw4811 power management chip */ i2c0 { - compatible = "i2c-gpio"; - gpios = <&gpio1 31 0>, /* sda */ - <&gpio1 30 0>; /* scl */ + compatible = "st,nomadik-i2c", "arm,primecell"; + reg = <0x101f8000 0x1000>; + interrupt-parent = <&vica>; + interrupts = <20>; + clock-frequency = <100000>; #address-cells = <1>; #size-cells = <0>; + clocks = <&i2c0clk>, <&pclki2c0>; + clock-names = "mclk", "apb_pclk"; pinctrl-names = "default"; - pinctrl-0 = <&i2c0_default_mode>; + pinctrl-0 = <&i2c0_default_mux>, <&i2c0_default_mode>; stw4811@2d { compatible = "st,stw4811"; @@ -698,13 +714,17 @@ /* I2C1 connected to various sensors */ i2c1 { - compatible = "i2c-gpio"; - gpios = <&gpio1 22 0>, /* sda */ - <&gpio1 21 0>; /* scl */ + compatible = "st,nomadik-i2c", "arm,primecell"; + reg = <0x101f7000 0x1000>; + interrupt-parent = <&vica>; + interrupts = <21>; + clock-frequency = <100000>; #address-cells = <1>; #size-cells = <0>; + clocks = <&i2c1clk>, <&pclki2c1>; + clock-names = "mclk", "apb_pclk"; pinctrl-names = "default"; - pinctrl-0 = <&i2c1_default_mode>; + pinctrl-0 = <&i2c1_default_mux>, <&i2c1_default_mode>; camera@2d { compatible = "st,camera"; diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig index 5981c3d..4d42da4 100644 --- a/arch/arm/mach-nomadik/Kconfig +++ b/arch/arm/mach-nomadik/Kconfig @@ -27,6 +27,7 @@ config MACH_NOMADIK_8815NHK select NOMADIK_8815 select I2C select I2C_ALGOBIT + select I2C_NOMADIK endmenu endif