linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Lee Jones <lee.jones@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	STEricsson_nomadik_linux@list.st.com,
	linus.walleij@stericsson.com, arnd@arndb.de
Subject: Re: [PATCH] ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT
Date: Mon, 3 Sep 2012 14:15:35 +0200	[thread overview]
Message-ID: <CACRpkdZX=bHYJ-BOZg68wjPZ6ZxwBq5BTL+0yR8sRdYAYAm9pw@mail.gmail.com> (raw)
In-Reply-To: <1345809612-30992-1-git-send-email-lee.jones@linaro.org>

On Fri, Aug 24, 2012 at 2:00 PM, Lee Jones <lee.jones@linaro.org> wrote:

> The SMSC911x Ethernet chip requires a fixed-regulator in order to
> function correctly.

Thanks for fixing this.

> +#ifdef CONFIG_REGULATOR_FIXED_VOLTAGE

No, just select REGULATOR_FIXED_VOLTAGE in apropriate
Kconfig entry, that's simpler. (Suspect under MACH_MOP500.)

(...)
> 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 <linux/spi/spi.h>
>  #include <linux/mfd/abx500/ab8500.h>
>  #include <linux/regulator/ab8500.h>
> +#include <linux/regulator/fixed.h>
>  #include <linux/mfd/tc3589x.h>
>  #include <linux/mfd/tps6105x.h>
>  #include <linux/mfd/abx500/ab8500-gpio.h>
> @@ -75,6 +76,25 @@ static struct platform_device snowball_led_dev = {
>         },
>  };
>
> +#ifdef CONFIG_REGULATOR_FIXED_VOLTAGE

Here too, get rid of the #ifdef.

> +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,

Since as you're not #ifdef:in around this entry it will not compile anyway
without fixed regulators.

(...)
>  /* 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 */

As noted by Philippe, please drop this hunk off the patch for now.
The AB8500 GPIO is the right one... Probably you're lucky that U-boot
draws the pin high and activates this voltage.

BTW: disablingt the AB8500 pin 26 and thus noting that ethernet screws
up may be a good test for the AB8500 GPIO driver.

Yours,
Linus Walleij

  parent reply	other threads:[~2012-09-03 12:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-24 12:00 Lee Jones
2012-08-24 12:47 ` Lee Jones
2012-09-03 12:15 ` Linus Walleij [this message]
2012-09-03 13:33 ` Lee Jones
2012-09-04  8:53   ` Linus Walleij
2012-09-04  9:08     ` Lee Jones
2012-09-04  9:29       ` Linus Walleij
2012-09-04  9:36         ` Lee Jones

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='CACRpkdZX=bHYJ-BOZg68wjPZ6ZxwBq5BTL+0yR8sRdYAYAm9pw@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=STEricsson_nomadik_linux@list.st.com \
    --cc=arnd@arndb.de \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH] ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT' \
    /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

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).