Merge branch 'fixes' of git://github.com/hzhuang1/linux into fixes
authorOlof Johansson <olof@lixom.net>
Fri, 30 Mar 2012 03:36:18 +0000 (20:36 -0700)
committerOlof Johansson <olof@lixom.net>
Fri, 30 Mar 2012 03:36:18 +0000 (20:36 -0700)
* 'fixes' of git://github.com/hzhuang1/linux:
  ARM: pxa: fix build issue on stargate2
  ARM: pxa: fix build issue on cm-x300
  ARM: pxa: fix build failure for regulator consumer in em-x270.c
  ARM: pxa: fix regulator related build fail in magician_defconfig

1  2 
arch/arm/mach-pxa/cm-x300.c
arch/arm/mach-pxa/hx4700.c
arch/arm/mach-pxa/magician.c

@@@ -44,7 -44,6 +44,7 @@@
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
  #include <asm/setup.h>
 +#include <asm/system_info.h>
  
  #include <mach/pxa300.h>
  #include <mach/pxa27x-udc.h>
@@@ -714,7 -713,6 +714,6 @@@ struct da9030_battery_info cm_x300_batt
  
  static struct regulator_consumer_supply buck2_consumers[] = {
        {
-               .dev = NULL,
                .supply = "vcc_core",
        },
  };
@@@ -28,8 -28,7 +28,8 @@@
  #include <linux/mtd/physmap.h>
  #include <linux/pda_power.h>
  #include <linux/pwm_backlight.h>
 -#include <linux/regulator/bq24022.h>
 +#include <linux/regulator/driver.h>
 +#include <linux/regulator/gpio-regulator.h>
  #include <linux/regulator/machine.h>
  #include <linux/regulator/max1586.h>
  #include <linux/spi/ads7846.h>
@@@ -98,9 -97,9 +98,9 @@@ static unsigned long hx4700_pin_config[
  
        /* BTUART */
        GPIO42_BTUART_RXD,
 -      GPIO43_BTUART_TXD,
 +      GPIO43_BTUART_TXD_LPM_LOW,
        GPIO44_BTUART_CTS,
 -      GPIO45_BTUART_RTS,
 +      GPIO45_BTUART_RTS_LPM_LOW,
  
        /* PWM 1 (Backlight) */
        GPIO17_PWM1_OUT,
@@@ -246,21 -245,6 +246,21 @@@ static u16 asic3_gpio_config[] = 
        ASIC3_GPIOD15_nPIOW,
  };
  
 +static struct asic3_led asic3_leds[ASIC3_NUM_LEDS] = {
 +      [0] = {
 +              .name = "hx4700:amber",
 +              .default_trigger = "ds2760-battery.0-charging-blink-full-solid",
 +      },
 +      [1] = {
 +              .name = "hx4700:green",
 +              .default_trigger = "unused",
 +      },
 +      [2] = {
 +              .name = "hx4700:blue",
 +              .default_trigger = "hx4700-radio",
 +      },
 +};
 +
  static struct resource asic3_resources[] = {
        /* GPIO part */
        [0] = {
@@@ -291,7 -275,6 +291,7 @@@ static struct asic3_platform_data asic3
        .gpio_config_num = ARRAY_SIZE(asic3_gpio_config),
        .irq_base        = IRQ_BOARD_START,
        .gpio_base       = HX4700_ASIC3_GPIO_BASE,
 +      .leds            = asic3_leds,
  };
  
  static struct platform_device asic3 = {
@@@ -681,11 -664,9 +681,9 @@@ static struct platform_device power_sup
  
  static struct regulator_consumer_supply bq24022_consumers[] = {
        {
-               .dev = &gpio_vbus.dev,
                .supply = "vbus_draw",
        },
        {
-               .dev = &power_supply.dev,
                .supply = "ac_draw",
        },
  };
@@@ -699,34 -680,14 +697,34 @@@ static struct regulator_init_data bq240
        .consumer_supplies      = bq24022_consumers,
  };
  
 -static struct bq24022_mach_info bq24022_info = {
 -      .gpio_nce   = GPIO72_HX4700_BQ24022_nCHARGE_EN,
 -      .gpio_iset2 = GPIO96_HX4700_BQ24022_ISET2,
 -      .init_data  = &bq24022_init_data,
 +static struct gpio bq24022_gpios[] = {
 +      { GPIO96_HX4700_BQ24022_ISET2, GPIOF_OUT_INIT_LOW, "bq24022_iset2" },
 +};
 +
 +static struct gpio_regulator_state bq24022_states[] = {
 +      { .value = 100000, .gpios = (0 << 0) },
 +      { .value = 500000, .gpios = (1 << 0) },
 +};
 +
 +static struct gpio_regulator_config bq24022_info = {
 +      .supply_name = "bq24022",
 +
 +      .enable_gpio = GPIO72_HX4700_BQ24022_nCHARGE_EN,
 +      .enable_high = 0,
 +      .enabled_at_boot = 0,
 +
 +      .gpios = bq24022_gpios,
 +      .nr_gpios = ARRAY_SIZE(bq24022_gpios),
 +
 +      .states = bq24022_states,
 +      .nr_states = ARRAY_SIZE(bq24022_states),
 +
 +      .type = REGULATOR_CURRENT,
 +      .init_data = &bq24022_init_data,
  };
  
  static struct platform_device bq24022 = {
 -      .name = "bq24022",
 +      .name = "gpio-regulator",
        .id   = -1,
        .dev  = {
                .platform_data = &bq24022_info,
@@@ -742,9 -703,10 +740,9 @@@ static void hx4700_set_vpp(struct platf
        gpio_set_value(GPIO91_HX4700_FLASH_VPEN, vpp);
  }
  
 -static struct resource strataflash_resource = {
 -      .start = PXA_CS0_PHYS,
 -      .end   = PXA_CS0_PHYS + SZ_128M - 1,
 -      .flags = IORESOURCE_MEM,
 +static struct resource strataflash_resource[] = {
 +      [0] = DEFINE_RES_MEM(PXA_CS0_PHYS, SZ_64M),
 +      [1] = DEFINE_RES_MEM(PXA_CS0_PHYS + SZ_64M, SZ_64M),
  };
  
  static struct physmap_flash_data strataflash_data = {
  static struct platform_device strataflash = {
        .name          = "physmap-flash",
        .id            = -1,
 -      .resource      = &strataflash_resource,
 -      .num_resources = 1,
 +      .resource      = strataflash_resource,
 +      .num_resources = ARRAY_SIZE(strataflash_resource),
        .dev = {
                .platform_data = &strataflash_data,
        },
@@@ -824,6 -786,17 +822,6 @@@ static struct platform_device audio = 
  
  
  /*
 - * PCMCIA
 - */
 -
 -static struct platform_device pcmcia = {
 -      .name = "hx4700-pcmcia",
 -      .dev  = {
 -              .parent = &asic3.dev,
 -      },
 -};
 -
 -/*
   * Platform devices
   */
  
@@@ -839,6 -812,7 +837,6 @@@ static struct platform_device *devices[
        &power_supply,
        &strataflash,
        &audio,
 -      &pcmcia,
  };
  
  static struct gpio global_gpios[] = {
        { GPIO32_HX4700_RS232_ON,         GPIOF_OUT_INIT_HIGH, "RS232_ON" },
        { GPIO71_HX4700_ASIC3_nRESET,     GPIOF_OUT_INIT_HIGH, "ASIC3_nRESET" },
        { GPIO82_HX4700_EUART_RESET,      GPIOF_OUT_INIT_HIGH, "EUART_RESET" },
 -      { GPIO105_HX4700_nIR_ON,          GPIOF_OUT_INIT_HIGH, "nIR_EN" },
  };
  
  static void __init hx4700_init(void)
@@@ -25,8 -25,7 +25,8 @@@
  #include <linux/mtd/physmap.h>
  #include <linux/pda_power.h>
  #include <linux/pwm_backlight.h>
 -#include <linux/regulator/bq24022.h>
 +#include <linux/regulator/driver.h>
 +#include <linux/regulator/gpio-regulator.h>
  #include <linux/regulator/machine.h>
  #include <linux/usb/gpio_vbus.h>
  #include <linux/i2c/pxa-i2c.h>
@@@ -34,7 -33,6 +34,7 @@@
  #include <mach/hardware.h>
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
 +#include <asm/system_info.h>
  
  #include <mach/pxa27x.h>
  #include <mach/magician.h>
@@@ -580,11 -578,9 +580,9 @@@ static struct platform_device power_sup
  
  static struct regulator_consumer_supply bq24022_consumers[] = {
        {
-               .dev = &gpio_vbus.dev,
                .supply = "vbus_draw",
        },
        {
-               .dev = &power_supply.dev,
                .supply = "ac_draw",
        },
  };
@@@ -598,34 -594,14 +596,34 @@@ static struct regulator_init_data bq240
        .consumer_supplies      = bq24022_consumers,
  };
  
 -static struct bq24022_mach_info bq24022_info = {
 -      .gpio_nce   = GPIO30_MAGICIAN_BQ24022_nCHARGE_EN,
 -      .gpio_iset2 = EGPIO_MAGICIAN_BQ24022_ISET2,
 -      .init_data  = &bq24022_init_data,
 +static struct gpio bq24022_gpios[] = {
 +      { EGPIO_MAGICIAN_BQ24022_ISET2, GPIOF_OUT_INIT_LOW, "bq24022_iset2" },
 +};
 +
 +static struct gpio_regulator_state bq24022_states[] = {
 +      { .value = 100000, .gpios = (0 << 0) },
 +      { .value = 500000, .gpios = (1 << 0) },
 +};
 +
 +static struct gpio_regulator_config bq24022_info = {
 +      .supply_name = "bq24022",
 +
 +      .enable_gpio = GPIO30_MAGICIAN_BQ24022_nCHARGE_EN,
 +      .enable_high = 0,
 +      .enabled_at_boot = 0,
 +
 +      .gpios = bq24022_gpios,
 +      .nr_gpios = ARRAY_SIZE(bq24022_gpios),
 +
 +      .states = bq24022_states,
 +      .nr_states = ARRAY_SIZE(bq24022_states),
 +
 +      .type = REGULATOR_CURRENT,
 +      .init_data = &bq24022_init_data,
  };
  
  static struct platform_device bq24022 = {
 -      .name = "bq24022",
 +      .name = "gpio-regulator",
        .id   = -1,
        .dev  = {
                .platform_data = &bq24022_info,