From patchwork Wed Dec 19 21:41:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaro Koskinen X-Patchwork-Id: 1897421 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 13E5B3FC64 for ; Wed, 19 Dec 2012 21:45:11 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TlRP0-00072Y-UM; Wed, 19 Dec 2012 21:42:11 +0000 Received: from filtteri2.pp.htv.fi ([213.243.153.185]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TlROw-00071w-Oo for linux-arm-kernel@lists.infradead.org; Wed, 19 Dec 2012 21:42:07 +0000 Received: from localhost (localhost [127.0.0.1]) by filtteri2.pp.htv.fi (Postfix) with ESMTP id 538C219BAA9; Wed, 19 Dec 2012 23:42:02 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at pp.htv.fi Received: from smtp4.welho.com ([213.243.153.38]) by localhost (filtteri2.pp.htv.fi [213.243.153.185]) (amavisd-new, port 10024) with ESMTP id kgf2mHlN5R8H; Wed, 19 Dec 2012 23:42:01 +0200 (EET) Received: from blackmetal.pp.htv.fi (cs181064211.pp.htv.fi [82.181.64.211]) by smtp4.welho.com (Postfix) with ESMTP id BF8655BC012; Wed, 19 Dec 2012 23:42:01 +0200 (EET) From: Aaro Koskinen To: tony@atomide.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: OMAP1: nokia770: enable CBUS/Retu Date: Wed, 19 Dec 2012 23:41:01 +0200 Message-Id: <1355953262-4352-1-git-send-email-aaro.koskinen@iki.fi> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121219_164207_017500_60C0B782 X-CRM114-Status: GOOD ( 13.38 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Aaro Koskinen X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add needed platform data so that it's possible to use Retu and e.g. feed Retu watchdog. Signed-off-by: Aaro Koskinen --- arch/arm/mach-omap1/board-nokia770.c | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c index 24d2f2d..ecd3f2a 100644 --- a/arch/arm/mach-omap1/board-nokia770.c +++ b/arch/arm/mach-omap1/board-nokia770.c @@ -7,6 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include @@ -23,6 +24,8 @@ #include #include +#include +#include #include #include @@ -212,6 +215,45 @@ static inline void nokia770_mmc_init(void) } #endif +#if defined(CONFIG_I2C_CBUS_GPIO) || defined(CONFIG_I2C_CBUS_GPIO_MODULE) +static struct i2c_cbus_platform_data nokia770_cbus_data = { + .clk_gpio = OMAP_MPUIO(9), + .dat_gpio = OMAP_MPUIO(10), + .sel_gpio = OMAP_MPUIO(11), +}; + +static struct platform_device nokia770_cbus_device = { + .name = "i2c-cbus-gpio", + .id = 2, + .dev = { + .platform_data = &nokia770_cbus_data, + }, +}; + +static struct i2c_board_info nokia770_i2c_board_info_2[] __initdata = { + { + I2C_BOARD_INFO("retu-mfd", 0x01), + }, +}; + +static void __init nokia770_cbus_init(void) +{ + const int retu_irq_gpio = 62; + + if (gpio_request_one(retu_irq_gpio, GPIOF_IN, "Retu IRQ")) + return; + irq_set_irq_type(gpio_to_irq(retu_irq_gpio), IRQ_TYPE_EDGE_RISING); + nokia770_i2c_board_info_2[0].irq = gpio_to_irq(retu_irq_gpio); + i2c_register_board_info(2, nokia770_i2c_board_info_2, + ARRAY_SIZE(nokia770_i2c_board_info_2)); + platform_device_register(&nokia770_cbus_device); +} +#else /* CONFIG_I2C_CBUS_GPIO */ +static void __init nokia770_cbus_init(void) +{ +} +#endif /* CONFIG_I2C_CBUS_GPIO */ + static void __init omap_nokia770_init(void) { /* On Nokia 770, the SleepX signal is masked with an @@ -233,6 +275,7 @@ static void __init omap_nokia770_init(void) mipid_dev_init(); omap1_usb_init(&nokia770_usb_config); nokia770_mmc_init(); + nokia770_cbus_init(); } MACHINE_START(NOKIA770, "Nokia 770")