Commit de1893f6 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'mfd-fixes-3.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-fixes

Pull MFD fixes from Samuel Ortiz:
 "This is the first batch of MFD fixes for 3.9.

  With this one we have:

   - An ab8500 build failure fix.
   - An ab8500 device tree parsing fix.
   - A fix for twl4030_madc remove routine to work properly (when
     built-in).
   - A fix for properly registering palmas interrupt handler.
   - A fix for omap-usb init routine to actually write into the
     hostconfig register.
   - A couple of warning fixes for ab8500-gpadc and tps65912"

* tag 'mfd-fixes-3.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-fixes:
  mfd: twl4030-madc: Remove __exit_p annotation
  mfd: ab8500: Kill "reg" property from binding
  mfd: ab8500-gpadc: Complain if we fail to enable vtvout LDO
  mfd: wm831x: Don't forward declare enum wm831x_auxadc
  mfd: twl4030-audio: Fix argument type for twl4030_audio_disable_resource()
  mfd: tps65912: Declare and use tps65912_irq_exit()
  mfd: palmas: Provide irq flags through DT/platform data
  mfd: Make AB8500_CORE select POWER_SUPPLY to fix build error
  mfd: omap-usb-host: Actually update hostconfig
parents 92fbb1c9 03715410
...@@ -13,9 +13,6 @@ Required parent device properties: ...@@ -13,9 +13,6 @@ Required parent device properties:
4 = active high level-sensitive 4 = active high level-sensitive
8 = active low level-sensitive 8 = active low level-sensitive
Optional parent device properties:
- reg : contains the PRCMU mailbox address for the AB8500 i2c port
The AB8500 consists of a large and varied group of sub-devices: The AB8500 consists of a large and varied group of sub-devices:
Device IRQ Names Supply Names Description Device IRQ Names Supply Names Description
...@@ -86,9 +83,8 @@ Non-standard child device properties: ...@@ -86,9 +83,8 @@ Non-standard child device properties:
- stericsson,amic2-bias-vamic1 : Analoge Mic wishes to use a non-standard Vamic - stericsson,amic2-bias-vamic1 : Analoge Mic wishes to use a non-standard Vamic
- stericsson,earpeice-cmv : Earpeice voltage (only: 950 | 1100 | 1270 | 1580) - stericsson,earpeice-cmv : Earpeice voltage (only: 950 | 1100 | 1270 | 1580)
ab8500@5 { ab8500 {
compatible = "stericsson,ab8500"; compatible = "stericsson,ab8500";
reg = <5>; /* mailbox 5 is i2c */
interrupts = <0 40 0x4>; interrupts = <0 40 0x4>;
interrupt-controller; interrupt-controller;
#interrupt-cells = <2>; #interrupt-cells = <2>;
......
...@@ -319,9 +319,8 @@ db8500_esram34_ret_reg: db8500_esram34_ret { ...@@ -319,9 +319,8 @@ db8500_esram34_ret_reg: db8500_esram34_ret {
}; };
}; };
ab8500@5 { ab8500 {
compatible = "stericsson,ab8500"; compatible = "stericsson,ab8500";
reg = <5>; /* mailbox 5 is i2c */
interrupt-parent = <&intc>; interrupt-parent = <&intc>;
interrupts = <0 40 0x4>; interrupts = <0 40 0x4>;
interrupt-controller; interrupt-controller;
......
...@@ -221,7 +221,7 @@ db8500_esram34_ret_reg: db8500_esram34_ret { ...@@ -221,7 +221,7 @@ db8500_esram34_ret_reg: db8500_esram34_ret {
}; };
}; };
ab8500@5 { ab8500 {
ab8500-regulators { ab8500-regulators {
ab8500_ldo_aux1_reg: ab8500_ldo_aux1 { ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
regulator-name = "V-DISPLAY"; regulator-name = "V-DISPLAY";
......
...@@ -158,7 +158,7 @@ db8500_esram34_ret_reg: db8500_esram34_ret { ...@@ -158,7 +158,7 @@ db8500_esram34_ret_reg: db8500_esram34_ret {
}; };
}; };
ab8500@5 { ab8500 {
ab8500-regulators { ab8500-regulators {
ab8500_ldo_aux1_reg: ab8500_ldo_aux1 { ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
regulator-name = "V-DISPLAY"; regulator-name = "V-DISPLAY";
......
...@@ -298,7 +298,7 @@ db8500_esram34_ret_reg: db8500_esram34_ret { ...@@ -298,7 +298,7 @@ db8500_esram34_ret_reg: db8500_esram34_ret {
}; };
}; };
ab8500@5 { ab8500 {
ab8500-regulators { ab8500-regulators {
ab8500_ldo_aux1_reg: ab8500_ldo_aux1 { ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
regulator-name = "V-DISPLAY"; regulator-name = "V-DISPLAY";
......
...@@ -858,6 +858,7 @@ config EZX_PCAP ...@@ -858,6 +858,7 @@ config EZX_PCAP
config AB8500_CORE config AB8500_CORE
bool "ST-Ericsson AB8500 Mixed Signal Power Management chip" bool "ST-Ericsson AB8500 Mixed Signal Power Management chip"
depends on GENERIC_HARDIRQS && ABX500_CORE && MFD_DB8500_PRCMU depends on GENERIC_HARDIRQS && ABX500_CORE && MFD_DB8500_PRCMU
select POWER_SUPPLY
select MFD_CORE select MFD_CORE
select IRQ_DOMAIN select IRQ_DOMAIN
help help
......
...@@ -594,9 +594,12 @@ static int ab8500_gpadc_runtime_suspend(struct device *dev) ...@@ -594,9 +594,12 @@ static int ab8500_gpadc_runtime_suspend(struct device *dev)
static int ab8500_gpadc_runtime_resume(struct device *dev) static int ab8500_gpadc_runtime_resume(struct device *dev)
{ {
struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); struct ab8500_gpadc *gpadc = dev_get_drvdata(dev);
int ret;
regulator_enable(gpadc->regu); ret = regulator_enable(gpadc->regu);
return 0; if (ret)
dev_err(dev, "Failed to enable vtvout LDO: %d\n", ret);
return ret;
} }
static int ab8500_gpadc_runtime_idle(struct device *dev) static int ab8500_gpadc_runtime_idle(struct device *dev)
...@@ -643,7 +646,7 @@ static int ab8500_gpadc_probe(struct platform_device *pdev) ...@@ -643,7 +646,7 @@ static int ab8500_gpadc_probe(struct platform_device *pdev)
} }
/* VTVout LDO used to power up ab8500-GPADC */ /* VTVout LDO used to power up ab8500-GPADC */
gpadc->regu = regulator_get(&pdev->dev, "vddadc"); gpadc->regu = devm_regulator_get(&pdev->dev, "vddadc");
if (IS_ERR(gpadc->regu)) { if (IS_ERR(gpadc->regu)) {
ret = PTR_ERR(gpadc->regu); ret = PTR_ERR(gpadc->regu);
dev_err(gpadc->dev, "failed to get vtvout LDO\n"); dev_err(gpadc->dev, "failed to get vtvout LDO\n");
...@@ -652,7 +655,11 @@ static int ab8500_gpadc_probe(struct platform_device *pdev) ...@@ -652,7 +655,11 @@ static int ab8500_gpadc_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, gpadc); platform_set_drvdata(pdev, gpadc);
regulator_enable(gpadc->regu); ret = regulator_enable(gpadc->regu);
if (ret) {
dev_err(gpadc->dev, "Failed to enable vtvout LDO: %d\n", ret);
goto fail_enable;
}
pm_runtime_set_autosuspend_delay(gpadc->dev, GPADC_AUDOSUSPEND_DELAY); pm_runtime_set_autosuspend_delay(gpadc->dev, GPADC_AUDOSUSPEND_DELAY);
pm_runtime_use_autosuspend(gpadc->dev); pm_runtime_use_autosuspend(gpadc->dev);
...@@ -663,6 +670,8 @@ static int ab8500_gpadc_probe(struct platform_device *pdev) ...@@ -663,6 +670,8 @@ static int ab8500_gpadc_probe(struct platform_device *pdev)
list_add_tail(&gpadc->node, &ab8500_gpadc_list); list_add_tail(&gpadc->node, &ab8500_gpadc_list);
dev_dbg(gpadc->dev, "probe success\n"); dev_dbg(gpadc->dev, "probe success\n");
return 0; return 0;
fail_enable:
fail_irq: fail_irq:
free_irq(gpadc->irq, gpadc); free_irq(gpadc->irq, gpadc);
fail: fail:
......
...@@ -460,15 +460,15 @@ static void omap_usbhs_init(struct device *dev) ...@@ -460,15 +460,15 @@ static void omap_usbhs_init(struct device *dev)
switch (omap->usbhs_rev) { switch (omap->usbhs_rev) {
case OMAP_USBHS_REV1: case OMAP_USBHS_REV1:
omap_usbhs_rev1_hostconfig(omap, reg); reg = omap_usbhs_rev1_hostconfig(omap, reg);
break; break;
case OMAP_USBHS_REV2: case OMAP_USBHS_REV2:
omap_usbhs_rev2_hostconfig(omap, reg); reg = omap_usbhs_rev2_hostconfig(omap, reg);
break; break;
default: /* newer revisions */ default: /* newer revisions */
omap_usbhs_rev2_hostconfig(omap, reg); reg = omap_usbhs_rev2_hostconfig(omap, reg);
break; break;
} }
......
...@@ -257,9 +257,24 @@ static struct regmap_irq_chip palmas_irq_chip = { ...@@ -257,9 +257,24 @@ static struct regmap_irq_chip palmas_irq_chip = {
PALMAS_INT1_MASK), PALMAS_INT1_MASK),
}; };
static void palmas_dt_to_pdata(struct device_node *node, static int palmas_set_pdata_irq_flag(struct i2c_client *i2c,
struct palmas_platform_data *pdata) struct palmas_platform_data *pdata)
{ {
struct irq_data *irq_data = irq_get_irq_data(i2c->irq);
if (!irq_data) {
dev_err(&i2c->dev, "Invalid IRQ: %d\n", i2c->irq);
return -EINVAL;
}
pdata->irq_flags = irqd_get_trigger_type(irq_data);
dev_info(&i2c->dev, "Irq flag is 0x%08x\n", pdata->irq_flags);
return 0;
}
static void palmas_dt_to_pdata(struct i2c_client *i2c,
struct palmas_platform_data *pdata)
{
struct device_node *node = i2c->dev.of_node;
int ret; int ret;
u32 prop; u32 prop;
...@@ -283,6 +298,8 @@ static void palmas_dt_to_pdata(struct device_node *node, ...@@ -283,6 +298,8 @@ static void palmas_dt_to_pdata(struct device_node *node,
pdata->power_ctrl = PALMAS_POWER_CTRL_NSLEEP_MASK | pdata->power_ctrl = PALMAS_POWER_CTRL_NSLEEP_MASK |
PALMAS_POWER_CTRL_ENABLE1_MASK | PALMAS_POWER_CTRL_ENABLE1_MASK |
PALMAS_POWER_CTRL_ENABLE2_MASK; PALMAS_POWER_CTRL_ENABLE2_MASK;
if (i2c->irq)
palmas_set_pdata_irq_flag(i2c, pdata);
} }
static int palmas_i2c_probe(struct i2c_client *i2c, static int palmas_i2c_probe(struct i2c_client *i2c,
...@@ -304,7 +321,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c, ...@@ -304,7 +321,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
if (!pdata) if (!pdata)
return -ENOMEM; return -ENOMEM;
palmas_dt_to_pdata(node, pdata); palmas_dt_to_pdata(i2c, pdata);
} }
if (!pdata) if (!pdata)
...@@ -344,6 +361,19 @@ static int palmas_i2c_probe(struct i2c_client *i2c, ...@@ -344,6 +361,19 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
} }
} }
/* Change interrupt line output polarity */
if (pdata->irq_flags & IRQ_TYPE_LEVEL_HIGH)
reg = PALMAS_POLARITY_CTRL_INT_POLARITY;
else
reg = 0;
ret = palmas_update_bits(palmas, PALMAS_PU_PD_OD_BASE,
PALMAS_POLARITY_CTRL, PALMAS_POLARITY_CTRL_INT_POLARITY,
reg);
if (ret < 0) {
dev_err(palmas->dev, "POLARITY_CTRL updat failed: %d\n", ret);
goto err;
}
/* Change IRQ into clear on read mode for efficiency */ /* Change IRQ into clear on read mode for efficiency */
slave = PALMAS_BASE_TO_SLAVE(PALMAS_INTERRUPT_BASE); slave = PALMAS_BASE_TO_SLAVE(PALMAS_INTERRUPT_BASE);
addr = PALMAS_BASE_TO_REG(PALMAS_INTERRUPT_BASE, PALMAS_INT_CTRL); addr = PALMAS_BASE_TO_REG(PALMAS_INTERRUPT_BASE, PALMAS_INT_CTRL);
...@@ -352,7 +382,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c, ...@@ -352,7 +382,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
regmap_write(palmas->regmap[slave], addr, reg); regmap_write(palmas->regmap[slave], addr, reg);
ret = regmap_add_irq_chip(palmas->regmap[slave], palmas->irq, ret = regmap_add_irq_chip(palmas->regmap[slave], palmas->irq,
IRQF_ONESHOT | IRQF_TRIGGER_LOW, 0, &palmas_irq_chip, IRQF_ONESHOT | pdata->irq_flags, 0, &palmas_irq_chip,
&palmas->irq_data); &palmas->irq_data);
if (ret < 0) if (ret < 0)
goto err; goto err;
......
...@@ -169,6 +169,7 @@ int tps65912_device_init(struct tps65912 *tps65912) ...@@ -169,6 +169,7 @@ int tps65912_device_init(struct tps65912 *tps65912)
void tps65912_device_exit(struct tps65912 *tps65912) void tps65912_device_exit(struct tps65912 *tps65912)
{ {
mfd_remove_devices(tps65912->dev); mfd_remove_devices(tps65912->dev);
tps65912_irq_exit(tps65912);
kfree(tps65912); kfree(tps65912);
} }
......
...@@ -118,7 +118,7 @@ EXPORT_SYMBOL_GPL(twl4030_audio_enable_resource); ...@@ -118,7 +118,7 @@ EXPORT_SYMBOL_GPL(twl4030_audio_enable_resource);
* Disable the resource. * Disable the resource.
* The function returns with error or the content of the register * The function returns with error or the content of the register
*/ */
int twl4030_audio_disable_resource(unsigned id) int twl4030_audio_disable_resource(enum twl4030_audio_res id)
{ {
struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev); struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev);
int val; int val;
......
...@@ -800,7 +800,7 @@ static int twl4030_madc_remove(struct platform_device *pdev) ...@@ -800,7 +800,7 @@ static int twl4030_madc_remove(struct platform_device *pdev)
static struct platform_driver twl4030_madc_driver = { static struct platform_driver twl4030_madc_driver = {
.probe = twl4030_madc_probe, .probe = twl4030_madc_probe,
.remove = __exit_p(twl4030_madc_remove), .remove = twl4030_madc_remove,
.driver = { .driver = {
.name = "twl4030_madc", .name = "twl4030_madc",
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -221,6 +221,7 @@ struct palmas_clk_platform_data { ...@@ -221,6 +221,7 @@ struct palmas_clk_platform_data {
}; };
struct palmas_platform_data { struct palmas_platform_data {
int irq_flags;
int gpio_base; int gpio_base;
/* bit value to be loaded to the POWER_CTRL register */ /* bit value to be loaded to the POWER_CTRL register */
......
...@@ -323,5 +323,6 @@ int tps65912_device_init(struct tps65912 *tps65912); ...@@ -323,5 +323,6 @@ int tps65912_device_init(struct tps65912 *tps65912);
void tps65912_device_exit(struct tps65912 *tps65912); void tps65912_device_exit(struct tps65912 *tps65912);
int tps65912_irq_init(struct tps65912 *tps65912, int irq, int tps65912_irq_init(struct tps65912 *tps65912, int irq,
struct tps65912_platform_data *pdata); struct tps65912_platform_data *pdata);
int tps65912_irq_exit(struct tps65912 *tps65912);
#endif /* __LINUX_MFD_TPS65912_H */ #endif /* __LINUX_MFD_TPS65912_H */
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#ifndef __MFD_WM831X_AUXADC_H__ #ifndef __MFD_WM831X_AUXADC_H__
#define __MFD_WM831X_AUXADC_H__ #define __MFD_WM831X_AUXADC_H__
struct wm831x;
/* /*
* R16429 (0x402D) - AuxADC Data * R16429 (0x402D) - AuxADC Data
*/ */
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/irqdomain.h> #include <linux/irqdomain.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/mfd/wm831x/auxadc.h>
/* /*
* Register values. * Register values.
...@@ -355,7 +356,6 @@ enum wm831x_parent { ...@@ -355,7 +356,6 @@ enum wm831x_parent {
}; };
struct wm831x; struct wm831x;
enum wm831x_auxadc;
typedef int (*wm831x_auxadc_read_fn)(struct wm831x *wm831x, typedef int (*wm831x_auxadc_read_fn)(struct wm831x *wm831x,
enum wm831x_auxadc input); enum wm831x_auxadc input);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment