From patchwork Tue Aug 20 13:20:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 19355 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f69.google.com (mail-qe0-f69.google.com [209.85.128.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 85CF72468F for ; Tue, 20 Aug 2013 13:20:44 +0000 (UTC) Received: by mail-qe0-f69.google.com with SMTP id 3sf431535qea.8 for ; Tue, 20 Aug 2013 06:20:44 -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=Jbr+AWLQZkhS6Rfv5cmngxqOg/uAqSOhZqYb+vpfekA=; b=XFgBtCtyvKK0VRWpGLOIgTknsZUBg4oZYT4Sgqmmh/OPsAUIzLm68TmfatOOa8UFi4 oumosLuBS4Qm/pNJW9BT+TC4M4XW69kwWKXcG/A09SDJ+o7ozd6kYtONLATPx8hMaWXq mSc5vCMaDrrbhCxU6axbSTjAhAgM1ILiOHLhRica9aem+gTLgcX1VDl7B1ZkBiG0QWbd j3nkDNnCKeeKtTC7FgDFHOnH0Ahp1+YcwFYEtLIwwe9y93F1uA40IF3yA4PLUBNWre7k bvNso/pJ2TkX6HWMfn3/VOBnjD+lyM7ltPaV4KnK8tS2fAfIzeQLyY315yFengiHMPjl gDCw== X-Received: by 10.236.53.70 with SMTP id f46mr588619yhc.17.1377004844084; Tue, 20 Aug 2013 06:20:44 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.95.138 with SMTP id dk10ls190430qeb.23.gmail; Tue, 20 Aug 2013 06:20:43 -0700 (PDT) X-Received: by 10.52.164.16 with SMTP id ym16mr324471vdb.32.1377004843882; Tue, 20 Aug 2013 06:20:43 -0700 (PDT) Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45]) by mx.google.com with ESMTPS id b5si337008vel.138.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 20 Aug 2013 06:20:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.45 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.45; Received: by mail-vb0-f45.google.com with SMTP id e15so227799vbg.18 for ; Tue, 20 Aug 2013 06:20:43 -0700 (PDT) X-Gm-Message-State: ALoCoQnaZekPSUHqqzUh2sSIKZ1sJhxNn3D+rpdrTF7NNIWgvUgU5fs4CcFQStrmo8z7LV2Y6pSX X-Received: by 10.52.27.228 with SMTP id w4mr1076773vdg.8.1377004843621; Tue, 20 Aug 2013 06:20:43 -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.220.174.196 with SMTP id u4csp156033vcz; Tue, 20 Aug 2013 06:20:43 -0700 (PDT) X-Received: by 10.152.8.51 with SMTP id o19mr1274104laa.42.1377004842530; Tue, 20 Aug 2013 06:20:42 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) by mx.google.com with ESMTPS id xk10si1334330lbb.89.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 20 Aug 2013 06:20:42 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.45 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id eh20so299075lab.18 for ; Tue, 20 Aug 2013 06:20:41 -0700 (PDT) X-Received: by 10.112.33.231 with SMTP id u7mr695005lbi.49.1377004840835; Tue, 20 Aug 2013 06:20:40 -0700 (PDT) Received: from localhost.localdomain (c83-249-208-124.bredband.comhem.se. [83.249.208.124]) by mx.google.com with ESMTPSA id js17sm812327lab.5.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 20 Aug 2013 06:20:39 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Cc: Linus Walleij Subject: [PATCH] ARM: ux500: fix up the I2C devices Date: Tue, 20 Aug 2013 15:20:32 +0200 Message-Id: <1377004832-30278-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.212.45 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: , The I2C device registration on the different ux500 board was buggy due to a switch to dynamically assigned I2C host addresses. This I2C host is still there, but we have to add the devices dynamically instead of using board data. Signed-off-by: Linus Walleij --- arch/arm/mach-ux500/board-mop500.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 4e7ab3a..ad0806e 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -324,21 +324,19 @@ static struct lp55xx_platform_data __initdata lp5521_sec_data = { .clock_mode = LP55XX_CLOCK_EXT, }; +/* I2C0 devices only available on the first HREF/MOP500 */ static struct i2c_board_info __initdata mop500_i2c0_devices[] = { { I2C_BOARD_INFO("tc3589x", 0x42), .irq = NOMADIK_GPIO_TO_IRQ(217), .platform_data = &mop500_tc35892_data, }, - /* I2C0 devices only available prior to HREFv60 */ { I2C_BOARD_INFO("tps61052", 0x33), .platform_data = &mop500_tps61052_data, }, }; -#define NUM_PRE_V60_I2C0_DEVICES 1 - static struct i2c_board_info __initdata mop500_i2c2_devices[] = { { /* lp5521 LED driver, 1st device */ @@ -356,6 +354,17 @@ static struct i2c_board_info __initdata mop500_i2c2_devices[] = { }, }; +static int __init mop500_i2c_board_init(void) +{ + if (machine_is_u8500()) + mop500_uib_i2c_add(0, mop500_i2c0_devices, + ARRAY_SIZE(mop500_i2c0_devices)); + mop500_uib_i2c_add(2, mop500_i2c2_devices, + ARRAY_SIZE(mop500_i2c2_devices)); + return 0; +} +device_initcall(mop500_i2c_board_init); + static void __init mop500_i2c_init(struct device *parent) { db8500_add_i2c0(parent, NULL); @@ -564,7 +573,6 @@ static struct platform_device *snowball_platform_devs[] __initdata = { static void __init mop500_init_machine(void) { struct device *parent = NULL; - int i2c0_devs; int i; platform_device_register(&db8500_prcmu_device); @@ -587,19 +595,13 @@ static void __init mop500_init_machine(void) mop500_spi_init(parent); mop500_audio_init(parent); mop500_uart_init(parent); - u8500_cryp1_hash1_init(parent); - i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); - - 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 void __init snowball_init_machine(void) { struct device *parent = NULL; @@ -634,7 +636,6 @@ static void __init snowball_init_machine(void) static void __init hrefv60_init_machine(void) { struct device *parent = NULL; - int i2c0_devs; int i; platform_device_register(&db8500_prcmu_device); @@ -663,14 +664,6 @@ static void __init hrefv60_init_machine(void) mop500_audio_init(parent); mop500_uart_init(parent); - i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); - - i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES; - - 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(); }