From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: 3ds_debugboard: Let ethernet be functional again
Date: Mon, 13 Feb 2012 09:27:41 +0100 [thread overview]
Message-ID: <20120213082741.GN3852@pengutronix.de> (raw)
In-Reply-To: <1328646473-11828-1-git-send-email-festevam@gmail.com>
On Tue, Feb 07, 2012 at 06:27:53PM -0200, Fabio Estevam wrote:
> 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 <fabio.estevam@freescale.com>
> ---
> 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 <linux/platform_device.h>
> #include <linux/gpio.h>
> #include <linux/smsc911x.h>
> +#include <linux/regulator/machine.h>
> +#include <linux/regulator/fixed.h>
>
> #include <mach/hardware.h>
>
> @@ -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
I really don't want to have that much code for saying 'we don't have a
regulator, just make this stupid driver happy'. This is fine for one
board, but not for the more than a dozen users of this driver in the tree.
We should really add a helper to simplify this.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2012-02-13 8:27 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-07 20:27 [PATCH] ARM: 3ds_debugboard: Let ethernet be functional again Fabio Estevam
2012-02-13 8:27 ` Sascha Hauer [this message]
2012-02-13 12:18 ` Fabio Estevam
2012-02-13 14:48 ` Mark Brown
2012-02-14 10:58 ` Sascha Hauer
2012-02-14 17:29 ` Mark Brown
2012-02-16 7:32 ` Sascha Hauer
2012-02-16 7:58 ` Mark Brown
2012-02-16 9:13 ` Sascha Hauer
2012-02-16 16:27 ` Mark Brown
2012-02-17 7:40 ` Sascha Hauer
2012-02-17 16:29 ` Mark Brown
2012-02-27 9:04 ` Sascha Hauer
2012-02-27 13:29 ` Mark Brown
2012-02-27 17:20 ` Sascha Hauer
2012-02-27 23:54 ` Mark Brown
2012-02-28 8:27 ` Sascha Hauer
2012-02-28 10:52 ` Mark Brown
2012-02-29 8:33 ` Sascha Hauer
2012-02-29 10:00 ` Mark Brown
2012-03-01 10:08 ` Sascha Hauer
2012-03-01 10:52 ` Mark Brown
2012-03-01 18:20 ` Sascha Hauer
2012-03-01 18:21 ` Mark Brown
2012-03-01 18:30 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120213082741.GN3852@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).