From patchwork Wed Mar 14 13:04:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 7284 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 B004E23DEE for ; Wed, 14 Mar 2012 13:05:18 +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 774D5A18746 for ; Wed, 14 Mar 2012 13:05:18 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so3119093iag.11 for ; Wed, 14 Mar 2012 06:05:18 -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:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=qnJUNBIZxSgaVfhyIA6SYWSGi1bw+AkVJYEezZWJxXE=; b=Gf6JZFiNmM6TDLQhZoYvnqnfVXe0CVDll+/Dzn3vzxbzHXVoXG5tU+SVNTd7KRuk6h kNg23LN0MSv1pFPBjn6cMAO4V33CW0WGY6Z2xOcvgn3le+GfgG3oCH4ULC5kPgbsVjAp ixVpNnlNc7QQo8WnLKhnJlGVm3k7Vm9MjqxKe6emX3d1hzvDPyt6alBAvSo9xXTMY3WD TnLfOUrJ4zPJee3XNdQgMzTw0ETCfI9vEZZNmV7iS03t8yZOgwaN6C2o2aSW7BjLv0xB rGNlXdpGnOryKkrWqhwOBntJo6aXDbaiG3Sf1u4fkW/qDTJ5QsMqIIj81P/ybx1kxepd gUHg== Received: by 10.42.145.72 with SMTP id e8mr3648591icv.0.1331730318267; Wed, 14 Mar 2012 06:05:18 -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.53.18 with SMTP id k18csp9540ibg; Wed, 14 Mar 2012 06:05:17 -0700 (PDT) Received: by 10.216.135.199 with SMTP id u49mr1662336wei.7.1331730315849; Wed, 14 Mar 2012 06:05:15 -0700 (PDT) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id n6si5405177wic.47.2012.03.14.06.05.15 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Mar 2012 06:05:15 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-we0-f178.google.com with SMTP id a13so2183990wer.37 for ; Wed, 14 Mar 2012 06:05:15 -0700 (PDT) Received: by 10.216.135.97 with SMTP id t75mr1529164wei.60.1331730315349; Wed, 14 Mar 2012 06:05:15 -0700 (PDT) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id fi4sm11477024wib.4.2012.03.14.06.05.13 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Mar 2012 06:05:14 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org Cc: linus.walleij@linaro.org, arnd@arndb.de, niklas.hernaeus@stericsson.com, Lee Jones Subject: [PATCH 03/10] ARM: ux500: combine the board init functions for DT boot Date: Wed, 14 Mar 2012 13:04:59 +0000 Message-Id: <1331730306-11461-4-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1331730306-11461-1-git-send-email-lee.jones@linaro.org> References: <1331730306-11461-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQlw9I3X8Xz1ofb8/dGusxCljog0HJKki1Ym7SMVXuvVi5hj9KcMxp5wnoys9OiXibXz6Yir From: Arnd Bergmann This lets us move over evertything to device tree one by one. Signed-off-by: Arnd Bergmann Signed-off-by: Lee Jones --- arch/arm/mach-ux500/board-mop500.c | 57 ++++++++++++++++++++++++++++++++---- 1 files changed, 51 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 0fb5dfd..e2932fc 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -745,12 +745,57 @@ MACHINE_END #ifdef CONFIG_MACH_UX500_DT static void __init u8500_init_machine(void) { - if (of_machine_is_compatible("calaosystems,snowball-a9500")) - return snowball_init_machine(); - else if (of_machine_is_compatible("st-ericsson,hrefv60+")) - return hrefv60_init_machine(); - else if (of_machine_is_compatible("st-ericsson,mop500")) - return mop500_init_machine(); + struct device *parent = NULL; + int i2c0_devs; + int i; + + parent = u8500_init_devices(); + i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); + + for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++) + mop500_platform_devs[i]->dev.parent = parent; + for (i = 0; i < ARRAY_SIZE(snowball_platform_devs); i++) + snowball_platform_devs[i]->dev.parent = parent; + + + if (of_machine_is_compatible("st-ericsson,mop500")) { + mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR; + mop500_pins_init(); + + platform_add_devices(mop500_platform_devs, + ARRAY_SIZE(mop500_platform_devs)); + + mop500_sdi_init(parent); + } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) { + snowball_pins_init(); + platform_add_devices(snowball_platform_devs, + ARRAY_SIZE(snowball_platform_devs)); + + snowball_sdi_init(parent); + } else if (of_machine_is_compatible("st-ericsson,hrefv60+")) { + /* + * The HREFv60 board removed a GPIO expander and routed + * all these GPIO pins to the internal GPIO controller + * instead. + */ + mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO; + i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES; + hrefv60_pins_init(); + platform_add_devices(mop500_platform_devs, + ARRAY_SIZE(mop500_platform_devs)); + + hrefv60_sdi_init(parent); + } + mop500_i2c_init(parent); + mop500_spi_init(parent); + mop500_uart_init(parent); + + i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); + i2c_register_board_info(2, mop500_i2c2_devices, + ARRAY_SIZE(mop500_i2c2_devices)); + + /* This board has full regulator constraints */ + regulator_has_full_constraints(); } static const char * u8500_dt_board_compat[] = {