Merge tag 'regulator-v3.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/brooni...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 25 Jan 2014 21:19:10 +0000 (13:19 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 25 Jan 2014 21:19:10 +0000 (13:19 -0800)
Pull regulator updates from Mark Brown:
 "A respin of the merges in the previous pull request with one extra
  fix.

  A quiet release for the regulator API, quite a large number of small
  improvements all over but other than the addition of new drivers for
  the AS3722 and MAX14577 there is nothing of substantial non-local
  impact"

* tag 'regulator-v3.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (47 commits)
  regulator: pfuze100-regulator: Improve dev_info() message
  regulator: pfuze100-regulator: Fix some checkpatch complaints
  regulator: twl: Fix checkpatch issue
  regulator: core: Fix checkpatch issue
  regulator: anatop-regulator: Remove unneeded memset()
  regulator: s5m8767: Update LDO index in s5m8767-regulator.txt
  regulator: as3722: set enable time for SD0/1/6
  regulator: as3722: detect SD0 low-voltage mode
  regulator: tps62360: Fix up a pointer-integer size mismatch warning
  regulator: anatop-regulator: Remove unneeded kstrdup()
  regulator: act8865: Fix build error when !OF
  regulator: act8865: register all regulators regardless of how many are used
  regulator: wm831x-dcdc: Remove unneeded 'err' label
  regulator: anatop-regulator: Add MODULE_ALIAS()
  regulator: act8865: fix incorrect devm_kzalloc for act8865
  regulator: act8865: Remove set_suspend_[en|dis]able implementation
  regulator: act8865: Remove unneeded regulator_unregister() calls
  regulator: s2mps11: Clean up redundant code
  regulator: tps65910: Simplify setting enable_mask for regulators
  regulator: act8865: add device tree binding doc
  ...

1  2 
Documentation/devicetree/bindings/vendor-prefixes.txt
drivers/mfd/sec-core.c
drivers/regulator/Kconfig
include/linux/mfd/as3722.h

@@@ -3,13 -3,13 +3,14 @@@ Device tree binding vendor prefix regis
  This isn't an exhaustive list, but you should add new prefixes to it before
  using them to avoid name-space collisions.
  
+ active-semi   Active-Semi International Inc
  ad    Avionic Design GmbH
  adi   Analog Devices, Inc.
  aeroflexgaisler       Aeroflex Gaisler AB
  ak    Asahi Kasei Corp.
  altr  Altera Corp.
  amcc  Applied Micro Circuits Corporation (APM, formally AMCC)
 +amstaos       AMS-Taos Inc.
  apm   Applied Micro Circuits Corporation (APM)
  arm   ARM Ltd.
  atmel Atmel Corporation
@@@ -27,25 -27,19 +28,25 @@@ cortina    Cortina Systems, Inc
  dallas        Maxim Integrated Products (formerly Dallas Semiconductor)
  davicom       DAVICOM Semiconductor, Inc.
  denx  Denx Software Engineering
 +edt   Emerging Display Technologies
  emmicro       EM Microelectronic
 +epfl  Ecole Polytechnique Fédérale de Lausanne
  epson Seiko Epson Corp.
  est   ESTeem Wireless Modems
  fsl   Freescale Semiconductor
  GEFanuc       GE Fanuc Intelligent Platforms Embedded Systems, Inc.
  gef   GE Fanuc Intelligent Platforms Embedded Systems, Inc.
  gmt   Global Mixed-mode Technology, Inc.
 +gumstix       Gumstix, Inc.
 +haoyu Haoyu Microelectronic Co. Ltd.
  hisilicon     Hisilicon Limited.
  hp    Hewlett Packard
  ibm   International Business Machines (IBM)
  idt   Integrated Device Technologies, Inc.
  img   Imagination Technologies Ltd.
  intercontrol  Inter Control Group
 +isl   Intersil
 +karo  Ka-Ro electronics GmbH
  lg    LG Corporation
  linux Linux-specific binding
  lsi   LSI Corp. (LSI Logic)
@@@ -68,7 -62,6 +69,7 @@@ ralink        Mediatek/Ralink Technology Corp
  ramtron       Ramtron International
  realtek Realtek Semiconductor Corp.
  renesas       Renesas Electronics Corporation
 +rockchip      Fuzhou Rockchip Electronics Co., Ltd
  samsung       Samsung Semiconductor
  sbs   Smart Battery System
  schindler     Schindler
@@@ -81,7 -74,6 +82,7 @@@ st    STMicroelectronic
  ste   ST-Ericsson
  stericsson    ST-Ericsson
  ti    Texas Instruments
 +tlm   Trusted Logic Mobility
  toshiba       Toshiba Corporation
  toumaz        Toumaz
  v3    V3 Semiconductor
diff --combined drivers/mfd/sec-core.c
@@@ -31,7 -31,7 +31,7 @@@
  #include <linux/mfd/samsung/s5m8767.h>
  #include <linux/regmap.h>
  
 -static struct mfd_cell s5m8751_devs[] = {
 +static const struct mfd_cell s5m8751_devs[] = {
        {
                .name = "s5m8751-pmic",
        }, {
@@@ -41,7 -41,7 +41,7 @@@
        },
  };
  
 -static struct mfd_cell s5m8763_devs[] = {
 +static const struct mfd_cell s5m8763_devs[] = {
        {
                .name = "s5m8763-pmic",
        }, {
        },
  };
  
 -static struct mfd_cell s5m8767_devs[] = {
 +static const struct mfd_cell s5m8767_devs[] = {
        {
                .name = "s5m8767-pmic",
        }, {
                .name = "s5m-rtc",
 -      },
 +      }, {
 +              .name = "s5m8767-clk",
 +      }
  };
  
 -static struct mfd_cell s2mps11_devs[] = {
 +static const struct mfd_cell s2mps11_devs[] = {
        {
                .name = "s2mps11-pmic",
        }, {
@@@ -81,36 -79,6 +81,6 @@@ static struct of_device_id sec_dt_match
  };
  #endif
  
- int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest)
- {
-       return regmap_read(sec_pmic->regmap_pmic, reg, dest);
- }
- EXPORT_SYMBOL_GPL(sec_reg_read);
- int sec_bulk_read(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf)
- {
-       return regmap_bulk_read(sec_pmic->regmap_pmic, reg, buf, count);
- }
- EXPORT_SYMBOL_GPL(sec_bulk_read);
- int sec_reg_write(struct sec_pmic_dev *sec_pmic, u8 reg, u8 value)
- {
-       return regmap_write(sec_pmic->regmap_pmic, reg, value);
- }
- EXPORT_SYMBOL_GPL(sec_reg_write);
- int sec_bulk_write(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf)
- {
-       return regmap_raw_write(sec_pmic->regmap_pmic, reg, buf, count);
- }
- EXPORT_SYMBOL_GPL(sec_bulk_write);
- int sec_reg_update(struct sec_pmic_dev *sec_pmic, u8 reg, u8 val, u8 mask)
- {
-       return regmap_update_bits(sec_pmic->regmap_pmic, reg, mask, val);
- }
- EXPORT_SYMBOL_GPL(sec_reg_update);
  static bool s2mps11_volatile(struct device *dev, unsigned int reg)
  {
        switch (reg) {
@@@ -136,12 -104,12 +106,12 @@@ static bool s5m8763_volatile(struct dev
        }
  }
  
 -static struct regmap_config sec_regmap_config = {
 +static const struct regmap_config sec_regmap_config = {
        .reg_bits = 8,
        .val_bits = 8,
  };
  
 -static struct regmap_config s2mps11_regmap_config = {
 +static const struct regmap_config s2mps11_regmap_config = {
        .reg_bits = 8,
        .val_bits = 8,
  
        .cache_type = REGCACHE_FLAT,
  };
  
 -static struct regmap_config s5m8763_regmap_config = {
 +static const struct regmap_config s5m8763_regmap_config = {
        .reg_bits = 8,
        .val_bits = 8,
  
        .cache_type = REGCACHE_FLAT,
  };
  
 -static struct regmap_config s5m8767_regmap_config = {
 +static const struct regmap_config s5m8767_regmap_config = {
        .reg_bits = 8,
        .val_bits = 8,
  
@@@ -206,7 -174,7 +176,7 @@@ static struct sec_platform_data *sec_pm
  static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata(
                                        struct device *dev)
  {
 -      return 0;
 +      return NULL;
  }
  #endif
  
@@@ -325,8 -293,6 +295,8 @@@ static int sec_pmic_probe(struct i2c_cl
        if (ret)
                goto err;
  
 +      device_init_wakeup(sec_pmic->dev, sec_pmic->wakeup);
 +
        return ret;
  
  err:
@@@ -345,43 -311,6 +315,43 @@@ static int sec_pmic_remove(struct i2c_c
        return 0;
  }
  
 +static int sec_pmic_suspend(struct device *dev)
 +{
 +      struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
 +      struct sec_pmic_dev *sec_pmic = i2c_get_clientdata(i2c);
 +
 +      if (device_may_wakeup(dev)) {
 +              enable_irq_wake(sec_pmic->irq);
 +              /*
 +               * PMIC IRQ must be disabled during suspend for RTC alarm
 +               * to work properly.
 +               * When device is woken up from suspend by RTC Alarm, an
 +               * interrupt occurs before resuming I2C bus controller.
 +               * The interrupt is handled by regmap_irq_thread which tries
 +               * to read RTC registers. This read fails (I2C is still
 +               * suspended) and RTC Alarm interrupt is disabled.
 +               */
 +              disable_irq(sec_pmic->irq);
 +      }
 +
 +      return 0;
 +}
 +
 +static int sec_pmic_resume(struct device *dev)
 +{
 +      struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
 +      struct sec_pmic_dev *sec_pmic = i2c_get_clientdata(i2c);
 +
 +      if (device_may_wakeup(dev)) {
 +              disable_irq_wake(sec_pmic->irq);
 +              enable_irq(sec_pmic->irq);
 +      }
 +
 +      return 0;
 +}
 +
 +static SIMPLE_DEV_PM_OPS(sec_pmic_pm_ops, sec_pmic_suspend, sec_pmic_resume);
 +
  static const struct i2c_device_id sec_pmic_id[] = {
        { "sec_pmic", 0 },
        { }
@@@ -392,7 -321,6 +362,7 @@@ static struct i2c_driver sec_pmic_drive
        .driver = {
                   .name = "sec_pmic",
                   .owner = THIS_MODULE,
 +                 .pm = &sec_pmic_pm_ops,
                   .of_match_table = of_match_ptr(sec_dt_match),
        },
        .probe = sec_pmic_probe,
@@@ -70,6 -70,14 +70,14 @@@ config REGULATOR_88PM860
        help
          This driver supports 88PM8607 voltage regulator chips.
  
+ config REGULATOR_ACT8865
+       tristate "Active-semi act8865 voltage regulator"
+       depends on I2C
+       select REGMAP_I2C
+       help
+         This driver controls a active-semi act8865 voltage output
+         regulator via I2C bus.
  config REGULATOR_AD5398
        tristate "Analog Devices AD5398/AD5821 regulators"
        depends on I2C
@@@ -249,6 -257,13 +257,13 @@@ config REGULATOR_LP878
        help
          This driver supports LP8788 voltage regulator chip.
  
+ config REGULATOR_MAX14577
+       tristate "Maxim 14577 regulator"
+       depends on MFD_MAX14577
+       help
+         This driver controls a Maxim 14577 regulator via I2C bus.
+         The regulators include safeout LDO and current regulator 'CHARGER'.
  config REGULATOR_MAX1586
        tristate "Maxim 1586/1587 voltage regulator"
        depends on I2C
@@@ -343,7 -358,7 +358,7 @@@ config REGULATOR_MC13XXX_COR
  
  config REGULATOR_MC13783
        tristate "Freescale MC13783 regulator driver"
 -      depends on MFD_MC13783
 +      depends on MFD_MC13XXX
        select REGULATOR_MC13XXX_CORE
        help
          Say y here to support the regulators found on the Freescale MC13783
@@@ -384,7 -399,7 +399,7 @@@ config REGULATOR_PCF5063
         on PCF50633
  
  config REGULATOR_PFUZE100
-       tristate "Support regulators on Freescale PFUZE100 PMIC"
+       tristate "Freescale PFUZE100 regulator driver"
        depends on I2C
        select REGMAP_I2C
        help
  #define AS3722_ASIC_ID1_REG                           0x90
  #define AS3722_ASIC_ID2_REG                           0x91
  #define AS3722_LOCK_REG                                       0x9E
+ #define AS3722_FUSE7_REG                              0xA7
  #define AS3722_MAX_REGISTER                           0xF4
  
  #define AS3722_SD0_EXT_ENABLE_MASK                    0x03
  #define AS3722_SD_VSEL_MASK                           0x7F
  #define AS3722_SD0_VSEL_MIN                           0x01
  #define AS3722_SD0_VSEL_MAX                           0x5A
+ #define AS3722_SD0_VSEL_LOW_VOL_MAX                   0x6E
  #define AS3722_SD2_VSEL_MIN                           0x01
  #define AS3722_SD2_VSEL_MAX                           0x7F
  
  #define AS3722_GPIO_IOSF_GPIO_INTERRUPT_IN            AS3722_GPIO_IOSF_VAL(3)
  #define AS3722_GPIO_IOSF_ISINK_PWM_IN                 AS3722_GPIO_IOSF_VAL(4)
  #define AS3722_GPIO_IOSF_VOLTAGE_STBY                 AS3722_GPIO_IOSF_VAL(5)
 +#define AS3722_GPIO_IOSF_SD0_OUT                      AS3722_GPIO_IOSF_VAL(6)
  #define AS3722_GPIO_IOSF_PWR_GOOD_OUT                 AS3722_GPIO_IOSF_VAL(7)
  #define AS3722_GPIO_IOSF_Q32K_OUT                     AS3722_GPIO_IOSF_VAL(8)
  #define AS3722_GPIO_IOSF_WATCHDOG_IN                  AS3722_GPIO_IOSF_VAL(9)
  #define AS3722_EXT_CONTROL_ENABLE2                    0x2
  #define AS3722_EXT_CONTROL_ENABLE3                    0x3
  
+ #define AS3722_FUSE7_SD0_LOW_VOLTAGE                  BIT(4)
  /* Interrupt IDs */
  enum as3722_irq {
        AS3722_IRQ_LID,