Skip to content

Commit

Permalink
Merge tag 'mfd-3.12-1' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/sameo/mfd-next

Pull MFD (multi-function device) updates from Samuel Ortiz:
 "For the 3.12 merge window we have one new driver for the DA9063 PMIC
  from Dialog Semiconductor.

  Besides that driver we also have:

   - Device tree support for the s2mps11 driver

   - More devm_* conversion for the pm8921, max89xx, menelaus, tps65010,
     wl1273 and pcf50633-adc drivers.

   - A conversion to threaded IRQ and IRQ domain for the twl6030 driver.

   - A fairly big update for the rtsx driver: Better power saving
     support, better vendor settings handling, and a few fixes.

   - Support for a couple more boards (COMe-bHL6 and COMe-cTH6) for the
     Kontron driver.

   - A conversion to the dev_get_platdata() API for all MFD drivers.

   - A removal of non-DT (legacy) support for the twl6040 driver.

   - A few fixes and additions (Mic detect level) to the wm5110 register
     tables.

   - Regmap support for the davinci_voicecodec driver.

   - The usual bunch of minor cleanups and janitorial fixes"

* tag 'mfd-3.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-next: (81 commits)
  mfd: ucb1x00-core: Rewrite ucb1x00_add_dev()
  mfd: ab8500-debugfs: Apply a check for -ENOMEM after allocating memory for event name
  mfd: ab8500-debugfs: Apply a check for -ENOMEM after allocating memory for sysfs
  mfd: timberdale: Use module_pci_driver
  mfd: timberdale: Remove redundant break
  mfd: timberdale: Staticize local variables
  mfd: ab8500-debugfs: Staticize local variables
  mfd: db8500-prcmu: Staticize clk_mgt
  mfd: db8500-prcmu: Use ANSI function declaration
  mfd: omap-usb-host: Staticize usbhs_driver_name
  mfd: 88pm805: Fix potential NULL pdata dereference
  mfd: 88pm800: Fix potential NULL pdata dereference
  mfd: twl6040: Use regmap for register cache
  mfd: davinci_voicecodec: Provide a regmap for register I/O
  mfd: davinci_voicecodec: Remove unused read and write functions
  mmc: memstick: rtsx: Modify copyright comments
  mmc: rtsx: Clear SD_CLK toggle enable bit if switching voltage fail
  mfd: mmc: rtsx: Change default tx phase
  mfd: pcf50633-adc: Use devm_*() functions
  mfd: rtsx: Copyright modifications
  ...
  • Loading branch information
Linus Torvalds committed Sep 8, 2013
2 parents 327fff3 + 9c31e88 commit 8de4651
Show file tree
Hide file tree
Showing 106 changed files with 3,222 additions and 656 deletions.
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/mfd/palmas.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ twl6035 (palmas)
twl6037 (palmas)
tps65913 (palmas)
tps65914 (palmas)
tps659038

Required properties:
- compatible : Should be from the list
Expand All @@ -14,6 +15,7 @@ Required properties:
ti,tps65913
ti,tps65914
ti,tps80036
ti,tps659038
and also the generic series names
ti,palmas
- interrupt-controller : palmas has its own internal IRQs
Expand Down
109 changes: 109 additions & 0 deletions Documentation/devicetree/bindings/mfd/s2mps11.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@

* Samsung S2MPS11 Voltage and Current Regulator

The Samsung S2MP211 is a multi-function device which includes voltage and
current regulators, RTC, charger controller and other sub-blocks. It is
interfaced to the host controller using a I2C interface. Each sub-block is
addressed by the host system using different I2C slave address.

Required properties:
- compatible: Should be "samsung,s2mps11-pmic".
- reg: Specifies the I2C slave address of the pmic block. It should be 0x66.

Optional properties:
- interrupt-parent: Specifies the phandle of the interrupt controller to which
the interrupts from s2mps11 are delivered to.
- interrupts: Interrupt specifiers for interrupt sources.

Optional nodes:
- clocks: s2mps11 provides three(AP/CP/BT) buffered 32.768 KHz outputs, so to
register these as clocks with common clock framework instantiate a sub-node
named "clocks". It uses the common clock binding documented in :
[Documentation/devicetree/bindings/clock/clock-bindings.txt]
- #clock-cells: should be 1.

- The following is the list of clocks generated by the controller. Each clock
is assigned an identifier and client nodes use this identifier to specify
the clock which they consume.
Clock ID
----------------------
32KhzAP 0
32KhzCP 1
32KhzBT 2

- regulators: The regulators of s2mps11 that have to be instantiated should be
included in a sub-node named 'regulators'. Regulator nodes included in this
sub-node should be of the format as listed below.

regulator_name {
[standard regulator constraints....];
};

regulator-ramp-delay for BUCKs = [6250/12500/25000(default)/50000] uV/us

BUCK[2/3/4/6] supports disabling ramp delay on hardware, so explictly
regulator-ramp-delay = <0> can be used for them to disable ramp delay.
In absence of regulator-ramp-delay property, default ramp delay will be used.

NOTE: Some BUCKs share the ramp rate setting i.e. same ramp value will be set
for a particular group of BUCKs. So provide same regulator-ramp-delay<value>.
Grouping of BUCKs sharing ramp rate setting is as follow : BUCK[1, 6],
BUCK[3, 4], and BUCK[7, 8, 10]

The regulator constraints inside the regulator nodes use the standard regulator
bindings which are documented elsewhere.

The following are the names of the regulators that the s2mps11 pmic block
supports. Note: The 'n' in LDOn and BUCKn represents the LDO or BUCK number
as per the datasheet of s2mps11.

- LDOn
- valid values for n are 1 to 28
- Example: LDO0, LD01, LDO28
- BUCKn
- valid values for n are 1 to 9.
- Example: BUCK1, BUCK2, BUCK9

Example:

s2mps11_pmic@66 {
compatible = "samsung,s2mps11-pmic";
reg = <0x66>;

s2m_osc: clocks{
#clock-cells = 1;
clock-output-names = "xx", "yy", "zz";
};

regulators {
ldo1_reg: LDO1 {
regulator-name = "VDD_ABB_3.3V";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
};

ldo2_reg: LDO2 {
regulator-name = "VDD_ALIVE_1.1V";
regulator-min-microvolt = <1100000>;
regulator-max-microvolt = <1100000>;
regulator-always-on;
};

buck1_reg: BUCK1 {
regulator-name = "vdd_mif";
regulator-min-microvolt = <950000>;
regulator-max-microvolt = <1350000>;
regulator-always-on;
regulator-boot-on;
};

buck2_reg: BUCK2 {
regulator-name = "vdd_arm";
regulator-min-microvolt = <950000>;
regulator-max-microvolt = <1350000>;
regulator-always-on;
regulator-boot-on;
regulator-ramp-delay = <50000>;
};
};
};
5 changes: 5 additions & 0 deletions Documentation/devicetree/bindings/regulator/palmas-pmic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ Optional nodes:
ti,smps-range - OTP has the wrong range set for the hardware so override
0 - low range, 1 - high range.

- ti,system-power-controller: Telling whether or not this pmic is controlling
the system power.

Example:

#include <dt-bindings/interrupt-controller/irq.h>
Expand All @@ -48,6 +51,8 @@ pmic {

ti,ldo6-vibrator;

ti,system-power-controller;

regulators {
smps12_reg : smps12 {
regulator-name = "smps12";
Expand Down
3 changes: 1 addition & 2 deletions drivers/memstick/host/rtsx_pci_ms.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Realtek PCI-Express Memstick Card Interface driver
*
* Copyright(c) 2009 Realtek Semiconductor Corp. All rights reserved.
* Copyright(c) 2009-2013 Realtek Semiconductor Corp. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
Expand All @@ -17,7 +17,6 @@
*
* Author:
* Wei WANG <wei_wang@realsil.com.cn>
* No. 450, Shenhu Road, Suzhou Industry Park, Suzhou, China
*/

#include <linux/module.h>
Expand Down
12 changes: 7 additions & 5 deletions drivers/mfd/88pm800.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,11 @@ static int device_rtc_init(struct pm80x_chip *chip,
{
int ret;

rtc_devs[0].platform_data = pdata->rtc;
rtc_devs[0].pdata_size =
pdata->rtc ? sizeof(struct pm80x_rtc_pdata) : 0;
if (pdata) {
rtc_devs[0].platform_data = pdata->rtc;
rtc_devs[0].pdata_size =
pdata->rtc ? sizeof(struct pm80x_rtc_pdata) : 0;
}
ret = mfd_add_devices(chip->dev, 0, &rtc_devs[0],
ARRAY_SIZE(rtc_devs), NULL, 0, NULL);
if (ret) {
Expand Down Expand Up @@ -541,7 +543,7 @@ static int pm800_probe(struct i2c_client *client,
{
int ret = 0;
struct pm80x_chip *chip;
struct pm80x_platform_data *pdata = client->dev.platform_data;
struct pm80x_platform_data *pdata = dev_get_platdata(&client->dev);
struct pm80x_subchip *subchip;

ret = pm80x_init(client);
Expand Down Expand Up @@ -578,7 +580,7 @@ static int pm800_probe(struct i2c_client *client,
goto err_device_init;
}

if (pdata->plat_config)
if (pdata && pdata->plat_config)
pdata->plat_config(chip, pdata);

return 0;
Expand Down
4 changes: 2 additions & 2 deletions drivers/mfd/88pm805.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ static int pm805_probe(struct i2c_client *client,
{
int ret = 0;
struct pm80x_chip *chip;
struct pm80x_platform_data *pdata = client->dev.platform_data;
struct pm80x_platform_data *pdata = dev_get_platdata(&client->dev);

ret = pm80x_init(client);
if (ret) {
Expand All @@ -243,7 +243,7 @@ static int pm805_probe(struct i2c_client *client,
goto err_805_init;
}

if (pdata->plat_config)
if (pdata && pdata->plat_config)
pdata->plat_config(chip, pdata);

err_805_init:
Expand Down
2 changes: 1 addition & 1 deletion drivers/mfd/88pm860x-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ static int pm860x_dt_init(struct device_node *np,
static int pm860x_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct pm860x_platform_data *pdata = client->dev.platform_data;
struct pm860x_platform_data *pdata = dev_get_platdata(&client->dev);
struct device_node *node = client->dev.of_node;
struct pm860x_chip *chip;
int ret;
Expand Down
14 changes: 13 additions & 1 deletion drivers/mfd/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@ config MFD_DA9055
This driver can be built as a module. If built as a module it will be
called "da9055"

config MFD_DA9063
bool "Dialog Semiconductor DA9063 PMIC Support"
select MFD_CORE
select REGMAP_I2C
select REGMAP_IRQ
depends on I2C=y && GENERIC_HARDIRQS
help
Say yes here for support for the Dialog Semiconductor DA9063 PMIC.
This includes the I2C driver and core APIs.
Additional drivers must be enabled in order to use the functionality
of the device.

config MFD_MC13783
tristate

Expand Down Expand Up @@ -1070,7 +1082,7 @@ config MFD_WM5110
Support for Wolfson Microelectronics WM5110 low power audio SoC

config MFD_WM8997
bool "Support Wolfson Microelectronics WM8997"
bool "Wolfson Microelectronics WM8997"
depends on MFD_ARIZONA
help
Support for Wolfson Microelectronics WM8997 low power audio SoC
Expand Down
3 changes: 3 additions & 0 deletions drivers/mfd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ obj-$(CONFIG_MFD_LP8788) += lp8788.o lp8788-irq.o
da9055-objs := da9055-core.o da9055-i2c.o
obj-$(CONFIG_MFD_DA9055) += da9055.o

da9063-objs := da9063-core.o da9063-irq.o da9063-i2c.o
obj-$(CONFIG_MFD_DA9063) += da9063.o

obj-$(CONFIG_MFD_MAX77686) += max77686.o max77686-irq.o
obj-$(CONFIG_MFD_MAX77693) += max77693.o max77693-irq.o
obj-$(CONFIG_MFD_MAX8907) += max8907.o
Expand Down
2 changes: 1 addition & 1 deletion drivers/mfd/aat2870-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ static inline void aat2870_uninit_debugfs(struct aat2870_data *aat2870)
static int aat2870_i2c_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct aat2870_platform_data *pdata = client->dev.platform_data;
struct aat2870_platform_data *pdata = dev_get_platdata(&client->dev);
struct aat2870_data *aat2870;
int i, j;
int ret = 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/mfd/ab3100-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ static int ab3100_probe(struct i2c_client *client,
{
struct ab3100 *ab3100;
struct ab3100_platform_data *ab3100_plf_data =
client->dev.platform_data;
dev_get_platdata(&client->dev);
int err;
int i;

Expand Down
14 changes: 10 additions & 4 deletions drivers/mfd/ab8500-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static struct hwreg_cfg hwreg_cfg = {

static struct ab8500_prcmu_ranges *debug_ranges;

struct ab8500_prcmu_ranges ab8500_debug_ranges[AB8500_NUM_BANKS] = {
static struct ab8500_prcmu_ranges ab8500_debug_ranges[AB8500_NUM_BANKS] = {
[0x0] = {
.num_ranges = 0,
.range = NULL,
Expand Down Expand Up @@ -488,7 +488,7 @@ struct ab8500_prcmu_ranges ab8500_debug_ranges[AB8500_NUM_BANKS] = {
},
};

struct ab8500_prcmu_ranges ab8505_debug_ranges[AB8500_NUM_BANKS] = {
static struct ab8500_prcmu_ranges ab8505_debug_ranges[AB8500_NUM_BANKS] = {
[0x0] = {
.num_ranges = 0,
.range = NULL,
Expand Down Expand Up @@ -847,7 +847,7 @@ struct ab8500_prcmu_ranges ab8505_debug_ranges[AB8500_NUM_BANKS] = {
},
};

struct ab8500_prcmu_ranges ab8540_debug_ranges[AB8500_NUM_BANKS] = {
static struct ab8500_prcmu_ranges ab8540_debug_ranges[AB8500_NUM_BANKS] = {
[AB8500_M_FSM_RANK] = {
.num_ranges = 1,
.range = (struct ab8500_reg_range[]) {
Expand Down Expand Up @@ -1377,7 +1377,7 @@ void ab8500_dump_all_banks(struct device *dev)

/* Space for 500 registers. */
#define DUMP_MAX_REGS 700
struct ab8500_register_dump
static struct ab8500_register_dump
{
u8 bank;
u8 reg;
Expand Down Expand Up @@ -2800,7 +2800,13 @@ static ssize_t ab8500_subscribe_write(struct file *file,
*/
dev_attr[irq_index] = kmalloc(sizeof(struct device_attribute),
GFP_KERNEL);
if (!dev_attr[irq_index])
return -ENOMEM;

event_name[irq_index] = kmalloc(count, GFP_KERNEL);
if (!event_name[irq_index])
return -ENOMEM;

sprintf(event_name[irq_index], "%lu", user_val);
dev_attr[irq_index]->show = show_irq;
dev_attr[irq_index]->store = NULL;
Expand Down
4 changes: 4 additions & 0 deletions drivers/mfd/ab8500-gpadc.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@ static void ab8500_gpadc_read_calibration_data(struct ab8500_gpadc *gpadc)
gpadc->cal_data[ADC_INPUT_VBAT].offset);
}

#ifdef CONFIG_PM_RUNTIME
static int ab8500_gpadc_runtime_suspend(struct device *dev)
{
struct ab8500_gpadc *gpadc = dev_get_drvdata(dev);
Expand All @@ -885,7 +886,9 @@ static int ab8500_gpadc_runtime_resume(struct device *dev)
dev_err(dev, "Failed to enable vtvout LDO: %d\n", ret);
return ret;
}
#endif

#ifdef CONFIG_PM_SLEEP
static int ab8500_gpadc_suspend(struct device *dev)
{
struct ab8500_gpadc *gpadc = dev_get_drvdata(dev);
Expand Down Expand Up @@ -913,6 +916,7 @@ static int ab8500_gpadc_resume(struct device *dev)
mutex_unlock(&gpadc->ab8500_gpadc_lock);
return ret;
}
#endif

static int ab8500_gpadc_probe(struct platform_device *pdev)
{
Expand Down
2 changes: 1 addition & 1 deletion drivers/mfd/adp5520.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static int adp5520_remove_subdevs(struct adp5520_chip *chip)
static int adp5520_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct adp5520_platform_data *pdata = client->dev.platform_data;
struct adp5520_platform_data *pdata = dev_get_platdata(&client->dev);
struct platform_device *pdev;
struct adp5520_chip *chip;
int ret;
Expand Down
2 changes: 1 addition & 1 deletion drivers/mfd/arizona-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,9 @@ static int arizona_runtime_suspend(struct device *dev)
}
}

regulator_disable(arizona->dcvdd);
regcache_cache_only(arizona->regmap, true);
regcache_mark_dirty(arizona->regmap);
regulator_disable(arizona->dcvdd);

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/mfd/as3711.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static int as3711_i2c_probe(struct i2c_client *client,
int ret;

if (!client->dev.of_node) {
pdata = client->dev.platform_data;
pdata = dev_get_platdata(&client->dev);
if (!pdata)
dev_dbg(&client->dev, "Platform data not found\n");
} else {
Expand Down
2 changes: 1 addition & 1 deletion drivers/mfd/asic3.c
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ static void asic3_mfd_remove(struct platform_device *pdev)
/* Core */
static int __init asic3_probe(struct platform_device *pdev)
{
struct asic3_platform_data *pdata = pdev->dev.platform_data;
struct asic3_platform_data *pdata = dev_get_platdata(&pdev->dev);
struct asic3 *asic;
struct resource *mem;
unsigned long clksel;
Expand Down
2 changes: 1 addition & 1 deletion drivers/mfd/da903x.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ static int da903x_add_subdevs(struct da903x_chip *chip,
static int da903x_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct da903x_platform_data *pdata = client->dev.platform_data;
struct da903x_platform_data *pdata = dev_get_platdata(&client->dev);
struct da903x_chip *chip;
unsigned int tmp;
int ret;
Expand Down
Loading

0 comments on commit 8de4651

Please sign in to comment.