Re: [PATCH] tty: serial: 8250: remove U6715 16550A auto-detection

2013-03-21 Thread Philippe LANGLAIS

On 03/20/2013 06:21 PM, Greg Kroah-Hartman wrote:
> On Tue, Mar 19, 2013 at 08:50:09PM +0100, Philippe Langlais wrote:
>> The auto-detection based on 64 bytes fifo size causes troubles
>> for the identification of the MultiTechZPX Modems (pci 11c1:0480).
>> They loose the ability to do hardware flow control
>> (specifically CTS is never set).
>>
>> Signed-off-by: Philippe Langlais 
>> ---
>>   drivers/tty/serial/8250/8250.c |9 -
>>   1 file changed, 9 deletions(-)
>>
>> diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
>> index cf6a538..3255014 100644
>> --- a/drivers/tty/serial/8250/8250.c
>> +++ b/drivers/tty/serial/8250/8250.c
>> @@ -1026,15 +1026,6 @@ static void autoconfig_16550a(struct uart_8250_port 
>> *up)
>>   
>>  return;
>>  }
>> -
>> -/*
>> - * We distinguish between 16550A and U6 16550A by counting
>> - * how many bytes are in the FIFO.
>> - */
>> -if (up->port.type == PORT_16550A && size_fifo(up) == 64) {
>> -up->port.type = PORT_U6_16550A;
>> -up->capabilities |= UART_CAP_AFE;
>> -}
> So you just broke this functionality for all of the other devices it
> does work properly for?  That's not nice, and not acceptable.
Yes, I know, but as U6715 & U6XXX kernel maintainer there is no risk to 
do that,
kernel for such platforms are not managed in mainstream, there are more 
risks
to keep these lines for other platforms.
>
> Please fix this properly.
I don't know how to distinguish MultiTechZPX Modems, so I rather to 
remove these lines.
>
> greg k-h
Philippe--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] tty: serial: 8250: remove U6715 16550A auto-detection

2013-03-21 Thread Philippe LANGLAIS

On 03/20/2013 06:21 PM, Greg Kroah-Hartman wrote:
 On Tue, Mar 19, 2013 at 08:50:09PM +0100, Philippe Langlais wrote:
 The auto-detection based on 64 bytes fifo size causes troubles
 for the identification of the MultiTechZPX Modems (pci 11c1:0480).
 They loose the ability to do hardware flow control
 (specifically CTS is never set).

 Signed-off-by: Philippe Langlais philippe.langl...@st.com
 ---
   drivers/tty/serial/8250/8250.c |9 -
   1 file changed, 9 deletions(-)

 diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
 index cf6a538..3255014 100644
 --- a/drivers/tty/serial/8250/8250.c
 +++ b/drivers/tty/serial/8250/8250.c
 @@ -1026,15 +1026,6 @@ static void autoconfig_16550a(struct uart_8250_port 
 *up)
   
  return;
  }
 -
 -/*
 - * We distinguish between 16550A and U6 16550A by counting
 - * how many bytes are in the FIFO.
 - */
 -if (up-port.type == PORT_16550A  size_fifo(up) == 64) {
 -up-port.type = PORT_U6_16550A;
 -up-capabilities |= UART_CAP_AFE;
 -}
 So you just broke this functionality for all of the other devices it
 does work properly for?  That's not nice, and not acceptable.
Yes, I know, but as U6715  U6XXX kernel maintainer there is no risk to 
do that,
kernel for such platforms are not managed in mainstream, there are more 
risks
to keep these lines for other platforms.

 Please fix this properly.
I don't know how to distinguish MultiTechZPX Modems, so I rather to 
remove these lines.

 greg k-h
Philippe--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] tty: serial: 8250: remove U6715 16550A auto-detection

2013-03-19 Thread Philippe Langlais
The auto-detection based on 64 bytes fifo size causes troubles
for the identification of the MultiTechZPX Modems (pci 11c1:0480).
They loose the ability to do hardware flow control
(specifically CTS is never set).

Signed-off-by: Philippe Langlais 
---
 drivers/tty/serial/8250/8250.c |9 -
 1 file changed, 9 deletions(-)

diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
index cf6a538..3255014 100644
--- a/drivers/tty/serial/8250/8250.c
+++ b/drivers/tty/serial/8250/8250.c
@@ -1026,15 +1026,6 @@ static void autoconfig_16550a(struct uart_8250_port *up)
 
return;
}
-
-   /*
-* We distinguish between 16550A and U6 16550A by counting
-* how many bytes are in the FIFO.
-*/
-   if (up->port.type == PORT_16550A && size_fifo(up) == 64) {
-   up->port.type = PORT_U6_16550A;
-   up->capabilities |= UART_CAP_AFE;
-   }
 }
 
 /*
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] tty: serial: 8250: remove U6715 16550A auto-detection

2013-03-19 Thread Philippe Langlais
The auto-detection based on 64 bytes fifo size causes troubles
for the identification of the MultiTechZPX Modems (pci 11c1:0480).
They loose the ability to do hardware flow control
(specifically CTS is never set).

Signed-off-by: Philippe Langlais philippe.langl...@st.com
---
 drivers/tty/serial/8250/8250.c |9 -
 1 file changed, 9 deletions(-)

diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
index cf6a538..3255014 100644
--- a/drivers/tty/serial/8250/8250.c
+++ b/drivers/tty/serial/8250/8250.c
@@ -1026,15 +1026,6 @@ static void autoconfig_16550a(struct uart_8250_port *up)
 
return;
}
-
-   /*
-* We distinguish between 16550A and U6 16550A by counting
-* how many bytes are in the FIFO.
-*/
-   if (up-port.type == PORT_16550A  size_fifo(up) == 64) {
-   up-port.type = PORT_U6_16550A;
-   up-capabilities |= UART_CAP_AFE;
-   }
 }
 
 /*
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1 v2] ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT

2012-08-24 Thread Philippe LANGLAIS
On 08/24/2012 04:08 PM, Lee Jones wrote:
>> I have checked in Snowball schematics and I can confirm that the fixed
>> 3.3V regulator is GPIO26 on AB8500 not DB8500, so its numero is
>> MOP500_AB8500_PIN_GPIO(26)
> We're also using GPIO26 on the DB8500 in the Device Tree solution.
> Odd that is should work? I wonder if we're just getting lucky, or if
> it's just not required?
Yes, we are lucky that the AB8500 GPIO26 is in the right state to make 
the ethernet working
and changing the state of GPIO26 doesn't seems to break something on 
Snowball.
>
>> and you have first to update the upstream gpio-ab8500 driver.
> I see. Do you know what needs to be updated to get it working?
I can't remember exactly, changes have been done recently on the 
internal driver and I know that the upstream driver is BROKEN (use 
obsolete IRQ API).
>
>> On 08/24/2012 02:48 PM, Lee Jones wrote:
>>> 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..139f31e 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 = 330,
>>> +   .max_uV = 330,
>>> +   .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 42e1759..c7f0973 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 = 330,
>>> +   .enable_high= 1,
>>> +   .init_data  = _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  = _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 = {
>>> _led_dev,
>>> _key_dev,
>>> _sbnet_dev,
>>> +   _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 9e9dd5a..d3a02d5 100644
>>> --- a/arch/arm/mach-ux500/board-mop500.h
>>> +++ b/arch/arm/mach-ux500/board-mop500.h
>>> @@ -13,6 +13,7 @@
>>> 

Re: [PATCH 1/1 v2] ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT

2012-08-24 Thread Philippe LANGLAIS
Hi Lee,

I have checked in Snowball schematics and I can confirm that the fixed
3.3V regulator is GPIO26 on AB8500 not DB8500, so its numero is 
MOP500_AB8500_PIN_GPIO(26)
and you have first to update the upstream gpio-ab8500 driver.

BR,
Philippe

On 08/24/2012 02:48 PM, Lee Jones wrote:
> 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..139f31e 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 = 330,
> + .max_uV = 330,
> + .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 42e1759..c7f0973 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 = 330,
> + .enable_high= 1,
> + .init_data  = _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  = _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 = {
>   _led_dev,
>   _key_dev,
>   _sbnet_dev,
> + _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 9e9dd5a..d3a02d5 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
No it's MOP500_AB8500_PIN_GPIO(26)
>   #define SNOWBALL_ACCEL_INT1_GPIO163
>   #define SNOWBALL_ACCEL_INT2_GPIO164
>   #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_GPIOMOP500_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 */
keep this line
>   
>   struct device;
>   struct i2c_board_info;

Re: [PATCH 1/1 v2] ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT

2012-08-24 Thread Philippe LANGLAIS
Hi Lee,

I have checked in Snowball schematics and I can confirm that the fixed
3.3V regulator is GPIO26 on AB8500 not DB8500, so its numero is 
MOP500_AB8500_PIN_GPIO(26)
and you have first to update the upstream gpio-ab8500 driver.

BR,
Philippe

On 08/24/2012 02:48 PM, Lee Jones wrote:
 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 lee.jo...@linaro.org
 ---
   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..139f31e 100644
 --- a/arch/arm/mach-ux500/board-mop500-regulators.c
 +++ b/arch/arm/mach-ux500/board-mop500-regulators.c
 @@ -13,6 +13,23 @@
   #include linux/regulator/ab8500.h
   #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 = 330,
 + .max_uV = 330,
 + .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 42e1759..c7f0973 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
 +static struct fixed_voltage_config snowball_gpio_en_3v3_data = {
 + .supply_name= EN-3V3,
 + .gpio   = SNOWBALL_EN_3V3_ETH_GPIO,
 + .microvolts = 330,
 + .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 9e9dd5a..d3a02d5 100644
 --- a/arch/arm/mach-ux500/board-mop500.h
 +++ b/arch/arm/mach-ux500/board-mop500.h
 @@ -13,6 +13,7 @@
   #include linux/amba/mmci.h
   
   /* Snowball specific GPIO assignments, this board has no GPIO expander */
 +#define SNOWBALL_EN_3V3_ETH_GPIO 26
No it's MOP500_AB8500_PIN_GPIO(26)
   #define SNOWBALL_ACCEL_INT1_GPIO163
   #define SNOWBALL_ACCEL_INT2_GPIO164
   #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_GPIOMOP500_AB8500_PIN_GPIO(16)  
 /* PWMOUT3/GPIO16 */
   #define SNOWBALL_PME_ETH_GPIO   MOP500_AB8500_PIN_GPIO(24)  
 /* SYSCLKREQ7/GPIO24 */
 -#define 

Re: [PATCH 1/1 v2] ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT

2012-08-24 Thread Philippe LANGLAIS
On 08/24/2012 04:08 PM, Lee Jones wrote:
 I have checked in Snowball schematics and I can confirm that the fixed
 3.3V regulator is GPIO26 on AB8500 not DB8500, so its numero is
 MOP500_AB8500_PIN_GPIO(26)
 We're also using GPIO26 on the DB8500 in the Device Tree solution.
 Odd that is should work? I wonder if we're just getting lucky, or if
 it's just not required?
Yes, we are lucky that the AB8500 GPIO26 is in the right state to make 
the ethernet working
and changing the state of GPIO26 doesn't seems to break something on 
Snowball.

 and you have first to update the upstream gpio-ab8500 driver.
 I see. Do you know what needs to be updated to get it working?
I can't remember exactly, changes have been done recently on the 
internal driver and I know that the upstream driver is BROKEN (use 
obsolete IRQ API).

 On 08/24/2012 02:48 PM, Lee Jones wrote:
 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 lee.jo...@linaro.org
 ---
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..139f31e 100644
 --- a/arch/arm/mach-ux500/board-mop500-regulators.c
 +++ b/arch/arm/mach-ux500/board-mop500-regulators.c
 @@ -13,6 +13,23 @@
#include linux/regulator/ab8500.h
#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 = 330,
 +   .max_uV = 330,
 +   .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 42e1759..c7f0973 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
 +static struct fixed_voltage_config snowball_gpio_en_3v3_data = {
 +   .supply_name= EN-3V3,
 +   .gpio   = SNOWBALL_EN_3V3_ETH_GPIO,
 +   .microvolts = 330,
 +   .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 9e9dd5a..d3a02d5 100644
 --- a/arch/arm/mach-ux500/board-mop500.h
 +++ b/arch/arm/mach-ux500/board-mop500.h
 @@ -13,6 +13,7 @@
#include linux/amba/mmci.h

/* Snowball specific GPIO assignments, this board has no GPIO expander */