From patchwork Tue Feb 7 20:27:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 140012 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (unknown [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CC129B71AB for ; Wed, 8 Feb 2012 07:30:28 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Rure2-0003Z4-Q5; Tue, 07 Feb 2012 20:28:06 +0000 Received: from mail-gx0-f177.google.com ([209.85.161.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Rurdz-0003YK-Dz for linux-arm-kernel@lists.infradead.org; Tue, 07 Feb 2012 20:28:04 +0000 Received: by ggnf2 with SMTP id f2so4303073ggn.36 for ; Tue, 07 Feb 2012 12:28:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=dOe2hH2qeQ6TdWdRoZQSq/2656xI9mbdD5v14DxEhMw=; b=nU9hRFly3F11sKJUj+8a6iWrKlz8hMj9WGryRf/guQt56h7vtiiBwFvPqpTCtlT/2r 4lmVfjgOVbhuTVXTS36JfejV/ZDpts9J3J7vq9GtFbl4fziFUaE/12lBIlKX885/SXKM R9XVSgRZQIZqQpIUznWvc6AL+VNLfQpqsBHI8= Received: by 10.101.40.14 with SMTP id s14mr10300033anj.79.1328646481452; Tue, 07 Feb 2012 12:28:01 -0800 (PST) Received: from localhost.localdomain ([187.106.61.98]) by mx.google.com with ESMTPS id q5sm29972473yhm.7.2012.02.07.12.27.59 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 07 Feb 2012 12:28:00 -0800 (PST) From: Fabio Estevam To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: 3ds_debugboard: Let ethernet be functional again Date: Tue, 7 Feb 2012 18:27:53 -0200 Message-Id: <1328646473-11828-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.7.1 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (festevam[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.161.177 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Fabio Estevam , Fabio Estevam , kernel@pengutronix.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list 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+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org commit c7e963f6 (net/smsc911x: Add regulator support) requires that regulator are provided to smsc911x chip. Provide regulator support to 3ds_debugboard so that mx31pdk/mx27pdk boards can have ethernet working again. Tested on a mx31pdk board. Signed-off-by: Fabio Estevam --- Sascha, If you think this patch is OK, then I can submit patches for fixing the other i.MX boards that have smsc911x. arch/arm/configs/imx_v6_v7_defconfig | 1 + arch/arm/plat-mxc/3ds_debugboard.c | 42 ++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 0 deletions(-) diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig index 3a4fb2e..0b437d1 100644 --- a/arch/arm/configs/imx_v6_v7_defconfig +++ b/arch/arm/configs/imx_v6_v7_defconfig @@ -126,6 +126,7 @@ CONFIG_WATCHDOG=y CONFIG_IMX2_WDT=y CONFIG_MFD_MC13XXX=y CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_REGULATOR_MC13892=y CONFIG_USB=y CONFIG_USB_EHCI_HCD=y diff --git a/arch/arm/plat-mxc/3ds_debugboard.c b/arch/arm/plat-mxc/3ds_debugboard.c index f0ba072..37c9160 100644 --- a/arch/arm/plat-mxc/3ds_debugboard.c +++ b/arch/arm/plat-mxc/3ds_debugboard.c @@ -16,6 +16,8 @@ #include #include #include +#include +#include #include @@ -61,6 +63,44 @@ static void __iomem *brd_io; +#if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE) +static struct regulator_consumer_supply debugboard_smsc_supplies[] = { + REGULATOR_SUPPLY("vdd33a", NULL), + REGULATOR_SUPPLY("vddvario", NULL), +}; + +static struct regulator_init_data debugboard_smsc_init_data = { + .constraints = { + .name = "3V3", + .always_on = 1, + }, + .consumer_supplies = debugboard_smsc_supplies, + .num_consumer_supplies = ARRAY_SIZE(debugboard_smsc_supplies), +}; + +static struct fixed_voltage_config debugboard_smsc_pdata = { + .supply_name = "board-3V3", + .microvolts = 3300000, + .gpio = -EINVAL, + .enabled_at_boot = 1, + .init_data = &debugboard_smsc_init_data, +}; +static struct platform_device debugboard_voltage_regulator = { + .name = "reg-fixed-voltage", + .id = -1, + .num_resources = 0, + .dev = { + .platform_data = &debugboard_smsc_pdata, + }, +}; +static void __init debugboard_add_regulators(void) +{ + platform_device_register(&debugboard_voltage_regulator); +} +#else +static void __init debugboard_add_regulators(void) {} +#endif + static struct resource smsc911x_resources[] = { { .flags = IORESOURCE_MEM, @@ -187,6 +227,8 @@ int __init mxc_expio_init(u32 base, u32 p_irq) irq_set_irq_type(p_irq, IRQF_TRIGGER_LOW); irq_set_chained_handler(p_irq, mxc_expio_irq_handler); + debugboard_add_regulators(); + /* Register Lan device on the debugboard */ smsc911x_resources[0].start = LAN9217_BASE_ADDR(base); smsc911x_resources[0].end = LAN9217_BASE_ADDR(base) + 0x100 - 1;