From patchwork Fri Aug 24 12:00:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 1370791 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id B2BD5DF28C for ; Fri, 24 Aug 2012 12:04:03 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T4sZD-0002Og-OP; Fri, 24 Aug 2012 12:00:47 +0000 Received: from mail-wi0-f171.google.com ([209.85.212.171]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T4sZA-0002Ni-7d for linux-arm-kernel@lists.infradead.org; Fri, 24 Aug 2012 12:00:45 +0000 Received: by wibhq4 with SMTP id hq4so601992wib.0 for ; Fri, 24 Aug 2012 05:00:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=zHAE2BxP+elZBm/br9q9vnxccM2f6/wT4deHVS6dMrU=; b=U7toce8d4twyinwJFLsIDqoVW+NylAB2yGAP/7+4czAkcC6ULpB+bQeJePC6G+CowG 9LeZAU/gJiJhg3CzcHMifdAh1ByYin25KPB3ZmpH8FL16b2P+fjWfN5GcSFRqtfwcBGe spVi1H0wD7wmTABC86t3H9Kxhd9VOPPHD6QeTO15hXP8mNyPxPfQ+Qr7qspBHBViebb3 sKyrhpQZL8hsMGPZAGyx/u/tYl16Q9zE64WM7HZRrANiy/tJLopqE4omDtoPSDVgqu/x +D6Bl7JYFAFPvSYy84ZWw6OxqWyMfbUhPTLFkTTFVsBhXR4i+4jmraLCE2ia+yepbvif Z1FA== Received: by 10.180.91.169 with SMTP id cf9mr5872405wib.1.1345809638887; Fri, 24 Aug 2012 05:00:38 -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 l5sm6123867wix.5.2012.08.24.05.00.36 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 24 Aug 2012 05:00:37 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT Date: Fri, 24 Aug 2012 13:00:12 +0100 Message-Id: <1345809612-30992-1-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQnm2VoA0fdq09Xo/aHf4rfq5JmP2k+ll+bb6rk2aRwx6pB/x8kvuM5iUZCAWcGU9BPftoci X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.171 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: STEricsson_nomadik_linux@list.st.com, Lee Jones , linus.walleij@stericsson.com, arnd@arndb.de 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 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..11ddda7 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 de10f8f..0e904c8 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 a0f920d..4ace165 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;