From patchwork Fri Aug 24 12:48:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 10927 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 9A1E723E29 for ; Fri, 24 Aug 2012 12:48:16 +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 AF155A18056 for ; Fri, 24 Aug 2012 12:47:58 +0000 (UTC) Received: by iafj25 with SMTP id j25so1034519iaf.11 for ; Fri, 24 Aug 2012 05:48:15 -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:x-gm-message-state; bh=Ny0z8ODXVyG9IQJB4EbkeQuCmwjL8pz+qGiob+VAsUY=; b=KskCmPkNmI7hZbor+8j6OZem9ZqcgC5xyYbkgxNnXNL+T+gkZ95njcFTnmKP8JqfDb D7QU5QM9wf0V0KMLK8I3tE0wf1rLErRjAic06kpXqnXrDpTXCh4zbGXomYWqZRJdeumv TM+vGRGpj3CfBXuWfgIpO9bY46uKP29XY+FqUCJpCPsGATgHJ13CK/jole2DKeo3nnx3 oB3AmxVyzOlfpbIgekfgQ47uL8h3lFSGFkYucFOtxzu5l9YuHC1k2yxEGEnuAiCiv+Io SaE2U/Rq292EsplvqED+QorMsC4Wm+sh1XKIbd3uNKVWBCNJ9UL73LUpTuTbgZ0632hO IBog== Received: by 10.42.84.69 with SMTP id k5mr4364912icl.5.1345812495357; Fri, 24 Aug 2012 05:48:15 -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.50.184.232 with SMTP id ex8csp318154igc; Fri, 24 Aug 2012 05:48:14 -0700 (PDT) Received: by 10.180.19.169 with SMTP id g9mr5368963wie.9.1345812493716; Fri, 24 Aug 2012 05:48:13 -0700 (PDT) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx.google.com with ESMTPS id h8si5588965wiz.5.2012.08.24.05.48.13 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 24 Aug 2012 05:48:13 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.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 wibhr14 with SMTP id hr14so634587wib.13 for ; Fri, 24 Aug 2012 05:48:13 -0700 (PDT) Received: by 10.180.98.138 with SMTP id ei10mr5418927wib.1.1345812493032; Fri, 24 Aug 2012 05:48:13 -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 j6sm6412794wiy.4.2012.08.24.05.48.11 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 24 Aug 2012 05:48:12 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: STEricsson_nomadik_linux@list.st.com, linus.walleij@stericsson.com, arnd@arndb.de, Lee Jones Subject: [PATCH 1/1 v2] ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT Date: Fri, 24 Aug 2012 13:48:01 +0100 Message-Id: <1345812481-2384-1-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQmpXAXoHowgGtYAW9jsA4SAEGyqIsJvqx6kzZSLG6LVykk3aL3pK1meL7u8Ec2IqcIEKG/c The SMSC911x Ethernet chip requires a fixed-regulator in order to function correctly. We have previously provided a means to obtain this during a Device Tree boot, however nothing has been put into place when booting with a non-DT kernel. This patch aims to change that. Signed-off-by: Lee Jones --- arch/arm/mach-ux500/board-mop500-regulators.c | 17 +++++++++++++++++ arch/arm/mach-ux500/board-mop500-regulators.h | 1 + arch/arm/mach-ux500/board-mop500.c | 21 +++++++++++++++++++++ arch/arm/mach-ux500/board-mop500.h | 2 +- 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c index 52426a4..139f31e 100644 --- a/arch/arm/mach-ux500/board-mop500-regulators.c +++ b/arch/arm/mach-ux500/board-mop500-regulators.c @@ -13,6 +13,23 @@ #include #include "board-mop500-regulators.h" +#ifdef CONFIG_REGULATOR_FIXED_VOLTAGE +static struct regulator_consumer_supply gpio_en_3v3_consumers[] = { + REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), +}; + +struct regulator_init_data gpio_en_3v3_regulator = { + .constraints = { + .name = "EN-3V3", + .min_uV = 3300000, + .max_uV = 3300000, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = ARRAY_SIZE(gpio_en_3v3_consumers), + .consumer_supplies = gpio_en_3v3_consumers, +}; +#endif + /* * TPS61052 regulator */ diff --git a/arch/arm/mach-ux500/board-mop500-regulators.h b/arch/arm/mach-ux500/board-mop500-regulators.h index 9499215..78a0642 100644 --- a/arch/arm/mach-ux500/board-mop500-regulators.h +++ b/arch/arm/mach-ux500/board-mop500-regulators.h @@ -18,5 +18,6 @@ extern struct ab8500_regulator_reg_init ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS]; extern struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS]; extern struct regulator_init_data tps61052_regulator; +extern struct regulator_init_data gpio_en_3v3_regulator; #endif diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 42e1759..c7f0973 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -75,6 +76,25 @@ static struct platform_device snowball_led_dev = { }, }; +#ifdef CONFIG_REGULATOR_FIXED_VOLTAGE +static struct fixed_voltage_config snowball_gpio_en_3v3_data = { + .supply_name = "EN-3V3", + .gpio = SNOWBALL_EN_3V3_ETH_GPIO, + .microvolts = 3300000, + .enable_high = 1, + .init_data = &gpio_en_3v3_regulator, + .startup_delay = 5000, /* 1200us */ +}; + +static struct platform_device snowball_gpio_en_3v3_regulator_dev = { + .name = "reg-fixed-voltage", + .id = 1, + .dev = { + .platform_data = &snowball_gpio_en_3v3_data, + }, +}; +#endif + static struct ab8500_gpio_platform_data ab8500_gpio_pdata = { .gpio_base = MOP500_AB8500_PIN_GPIO(1), .irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE, @@ -585,6 +605,7 @@ static struct platform_device *snowball_platform_devs[] __initdata = { &snowball_led_dev, &snowball_key_dev, &snowball_sbnet_dev, + &snowball_gpio_en_3v3_regulator_dev, }; static void __init mop500_init_machine(void) diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h index 9e9dd5a..d3a02d5 100644 --- a/arch/arm/mach-ux500/board-mop500.h +++ b/arch/arm/mach-ux500/board-mop500.h @@ -13,6 +13,7 @@ #include /* Snowball specific GPIO assignments, this board has no GPIO expander */ +#define SNOWBALL_EN_3V3_ETH_GPIO 26 #define SNOWBALL_ACCEL_INT1_GPIO 163 #define SNOWBALL_ACCEL_INT2_GPIO 164 #define SNOWBALL_MAGNET_DRDY_GPIO 165 @@ -76,7 +77,6 @@ #define SNOWBALL_PM_GPIO4_GPIO MOP500_AB8500_PIN_GPIO(4) /* SYSCLKREQ6/GPIO4 */ #define SNOWBALL_EN_3V6_GPIO MOP500_AB8500_PIN_GPIO(16) /* PWMOUT3/GPIO16 */ #define SNOWBALL_PME_ETH_GPIO MOP500_AB8500_PIN_GPIO(24) /* SYSCLKREQ7/GPIO24 */ -#define SNOWBALL_EN_3V3_ETH_GPIO MOP500_AB8500_PIN_GPIO(26) /* GPIO26 */ struct device; struct i2c_board_info;