From patchwork Mon Sep 3 13:33:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 1399791 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 AD409DF280 for ; Mon, 3 Sep 2012 13:37:04 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T8Wmj-0006NN-9D; Mon, 03 Sep 2012 13:33:49 +0000 Received: from mail-ee0-f49.google.com ([74.125.83.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T8Wme-0006Mg-0M for linux-arm-kernel@lists.infradead.org; Mon, 03 Sep 2012 13:33:46 +0000 Received: by eekc13 with SMTP id c13so1895132eek.36 for ; Mon, 03 Sep 2012 06:33:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent :x-gm-message-state; bh=FdTXokMN1FlkU1QqkGTVkdqn5Dd7uX5Jzarqg7rONv8=; b=jGWY3ysyeyypMb/X4E65i4rhq4OkvqzmdIRAmkTWqdGqEXhu/TbgRZ0Wb0bmBgVmze S1/GX7kzPhzyd/mVr7QSEsUtP0cmdJTsk1grwghhvBYdYop8ioWCoFuFMgXHLPhRGd8o XN5l26BwUQSJH3FOlzT5t5fqFTsVOHHd84zMFj2+1nNRXzPa6OPykI74rfTwIlJG/Ep/ 1tXu1q2VH3741+/uPpVZ33LFhLDL3WEYJBeqVxTfFjggFXHV96EyfPY2iFG+qCy/k9y/ p3FqtoDLD907dWFJvsWXnev4aE990uYVyM/qOyj4Z4n1+1RPdf/UQkxXAob4WeAGvKRX f7rg== Received: by 10.14.184.134 with SMTP id s6mr8601753eem.46.1346679222634; Mon, 03 Sep 2012 06:33:42 -0700 (PDT) Received: from gmail.com (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id l42sm36632265eep.1.2012.09.03.06.33.41 (version=SSLv3 cipher=OTHER); Mon, 03 Sep 2012 06:33:41 -0700 (PDT) Date: Mon, 3 Sep 2012 14:33:39 +0100 From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT Message-ID: <20120903133333.GE31163@gmail.com> References: <1345809612-30992-1-git-send-email-lee.jones@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1345809612-30992-1-git-send-email-lee.jones@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQnnMbZ+HCuLEyRbpLfzUucZALjb/6cx4FUAsN5urbHkuu0L4fU0Wh11LuO4vBQJ+JBrG/xi 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 [74.125.83.49 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, 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: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Author: Lee Jones Date: Fri Aug 24 12:40:58 2012 +0100 ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT 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 diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c index 52426a4..2a1e388 100644 --- a/arch/arm/mach-ux500/board-mop500-regulators.c +++ b/arch/arm/mach-ux500/board-mop500-regulators.c @@ -13,6 +13,21 @@ #include #include "board-mop500-regulators.h" +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, +}; + /* * 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 b2be36f..9dfad19 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,23 @@ static struct platform_device snowball_led_dev = { }, }; +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, + }, +}; + 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 +603,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)