From patchwork Mon Feb 22 20:29:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 81283 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1MKNvhi025171 for ; Mon, 22 Feb 2010 20:23:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754092Ab0BVUX5 (ORCPT ); Mon, 22 Feb 2010 15:23:57 -0500 Received: from mail-ew0-f228.google.com ([209.85.219.228]:52571 "EHLO mail-ew0-f228.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753800Ab0BVUX4 (ORCPT ); Mon, 22 Feb 2010 15:23:56 -0500 Received: by ewy28 with SMTP id 28so3197329ewy.28 for ; Mon, 22 Feb 2010 12:23:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=LfZYjI4n2oiCfxn2F3NcQ26txpS/SfypnD8lQIJC4M4=; b=XCS3Tfz5IzI3yC1kFNJm3YVQnOu46OHDpVAiwdtDgOOqNy/ETHHHJy3gqZVqFc+wHT RSmVM61h8PCkJTcQfD62N1YAxW+wU55vy7mZh3e6KPo94dk1Q5oxnKQC+t1TevpvBUwm FQj05ZQhahmoFFFPgy4eH91P6goWGMmg+RnQg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=Rc1PU3Qng9317DLEgW7Pn5fwzTsN+Z1+EJgZyqSzrS14NVRTQ83PvYbPUCUhP57wZt sXagUTMOMkXb4SbLwakd9ZLQnUNh5L4A/4xsCaAsSOOR2s9okQko1gv9kiaAx8dv1A13 uvGsst6UaVRrQOCYNo/4d3BWN6lMq4ySh8XSE= Received: by 10.213.3.131 with SMTP id 3mr2227478ebn.92.1266870234873; Mon, 22 Feb 2010 12:23:54 -0800 (PST) Received: from localhost (host-94-101-4-66.igua.fi [94.101.4.66]) by mx.google.com with ESMTPS id 16sm2720005ewy.6.2010.02.22.12.23.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 22 Feb 2010 12:23:54 -0800 (PST) From: Jarkko Nikula To: linux-omap@vger.kernel.org Cc: Tony Lindgren , Jarkko Nikula Subject: [PATCH] omap: i2c: Fix muxing for command line enabled bus Date: Mon, 22 Feb 2010 22:29:36 +0200 Message-Id: <1266870576-24487-1-git-send-email-jhnikula@gmail.com> X-Mailer: git-send-email 1.6.6.1 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 22 Feb 2010 20:23:58 +0000 (UTC) diff --git a/arch/arm/mach-omap1/i2c.c b/arch/arm/mach-omap1/i2c.c index 1bf4735..5446c99 100644 --- a/arch/arm/mach-omap1/i2c.c +++ b/arch/arm/mach-omap1/i2c.c @@ -23,9 +23,7 @@ #include #include -int __init omap_register_i2c_bus(int bus_id, u32 clkrate, - struct i2c_board_info const *info, - unsigned len) +void __init omap1_i2c_mux_pins(int bus_id) { if (cpu_is_omap7xx()) { omap_cfg_reg(I2C_7XX_SDA); @@ -34,6 +32,4 @@ int __init omap_register_i2c_bus(int bus_id, u32 clkrate, omap_cfg_reg(I2C_SDA); omap_cfg_reg(I2C_SCL); } - - return omap_plat_register_i2c_bus(bus_id, clkrate, info, len); } diff --git a/arch/arm/mach-omap2/i2c.c b/arch/arm/mach-omap2/i2c.c index 789ca8c..7951ae1 100644 --- a/arch/arm/mach-omap2/i2c.c +++ b/arch/arm/mach-omap2/i2c.c @@ -25,9 +25,7 @@ #include "mux.h" -int __init omap_register_i2c_bus(int bus_id, u32 clkrate, - struct i2c_board_info const *info, - unsigned len) +void __init omap2_i2c_mux_pins(int bus_id) { if (cpu_is_omap24xx()) { const int omap24xx_pins[][2] = { @@ -51,6 +49,4 @@ int __init omap_register_i2c_bus(int bus_id, u32 clkrate, sprintf(mux_name, "i2c%i_sda.i2c%i_sda", bus_id, bus_id); omap_mux_init_signal(mux_name, OMAP_PIN_INPUT); } - - return omap_plat_register_i2c_bus(bus_id, clkrate, info, len); } diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c index 96d2781..624e262 100644 --- a/arch/arm/plat-omap/i2c.c +++ b/arch/arm/plat-omap/i2c.c @@ -28,6 +28,7 @@ #include #include #include +#include #define OMAP_I2C_SIZE 0x3f #define OMAP1_I2C_BASE 0xfffb3800 @@ -117,6 +118,11 @@ static int __init omap_i2c_add_bus(int bus_id) res[1].start = irq; } + if (cpu_class_is_omap1()) + omap1_i2c_mux_pins(bus_id); + if (cpu_class_is_omap2()) + omap2_i2c_mux_pins(bus_id); + return platform_device_register(pdev); } @@ -169,7 +175,7 @@ out: subsys_initcall(omap_register_i2c_bus_cmdline); /** - * omap_plat_register_i2c_bus - register I2C bus with device descriptors + * omap_register_i2c_bus - register I2C bus with device descriptors * @bus_id: bus id counting from number 1 * @clkrate: clock rate of the bus in kHz * @info: pointer into I2C device descriptor table or NULL @@ -177,7 +183,7 @@ subsys_initcall(omap_register_i2c_bus_cmdline); * * Returns 0 on success or an error code. */ -int __init omap_plat_register_i2c_bus(int bus_id, u32 clkrate, +int __init omap_register_i2c_bus(int bus_id, u32 clkrate, struct i2c_board_info const *info, unsigned len) { diff --git a/arch/arm/plat-omap/include/plat/i2c.h b/arch/arm/plat-omap/include/plat/i2c.h index 585d9ca..87f6bf2 100644 --- a/arch/arm/plat-omap/include/plat/i2c.h +++ b/arch/arm/plat-omap/include/plat/i2c.h @@ -34,6 +34,5 @@ static inline int omap_register_i2c_bus(int bus_id, u32 clkrate, } #endif -int omap_plat_register_i2c_bus(int bus_id, u32 clkrate, - struct i2c_board_info const *info, - unsigned len); +void __init omap1_i2c_mux_pins(int bus_id); +void __init omap2_i2c_mux_pins(int bus_id);