Commit 5656098e authored by Mark Brown's avatar Mark Brown Committed by Samuel Ortiz

mfd: wm831x: Convert to IORESOURCE_REG

This was originally written by Russell King who unfortunately found
himself unable to take the patch futher.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarHaojian Zhuang <haojian.zhuang@gmail.com>
Tested-by: default avatarHaojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent c04a9cb8
...@@ -614,18 +614,11 @@ int wm831x_set_bits(struct wm831x *wm831x, unsigned short reg, ...@@ -614,18 +614,11 @@ int wm831x_set_bits(struct wm831x *wm831x, unsigned short reg,
} }
EXPORT_SYMBOL_GPL(wm831x_set_bits); EXPORT_SYMBOL_GPL(wm831x_set_bits);
static struct resource wm831x_io_parent = {
.start = 0,
.end = 0xffffffff,
.flags = IORESOURCE_IO,
};
static struct resource wm831x_dcdc1_resources[] = { static struct resource wm831x_dcdc1_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_DC1_CONTROL_1, .start = WM831X_DC1_CONTROL_1,
.end = WM831X_DC1_DVS_CONTROL, .end = WM831X_DC1_DVS_CONTROL,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
{ {
.name = "UV", .name = "UV",
...@@ -644,10 +637,9 @@ static struct resource wm831x_dcdc1_resources[] = { ...@@ -644,10 +637,9 @@ static struct resource wm831x_dcdc1_resources[] = {
static struct resource wm831x_dcdc2_resources[] = { static struct resource wm831x_dcdc2_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_DC2_CONTROL_1, .start = WM831X_DC2_CONTROL_1,
.end = WM831X_DC2_DVS_CONTROL, .end = WM831X_DC2_DVS_CONTROL,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
{ {
.name = "UV", .name = "UV",
...@@ -665,10 +657,9 @@ static struct resource wm831x_dcdc2_resources[] = { ...@@ -665,10 +657,9 @@ static struct resource wm831x_dcdc2_resources[] = {
static struct resource wm831x_dcdc3_resources[] = { static struct resource wm831x_dcdc3_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_DC3_CONTROL_1, .start = WM831X_DC3_CONTROL_1,
.end = WM831X_DC3_SLEEP_CONTROL, .end = WM831X_DC3_SLEEP_CONTROL,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
{ {
.name = "UV", .name = "UV",
...@@ -680,10 +671,9 @@ static struct resource wm831x_dcdc3_resources[] = { ...@@ -680,10 +671,9 @@ static struct resource wm831x_dcdc3_resources[] = {
static struct resource wm831x_dcdc4_resources[] = { static struct resource wm831x_dcdc4_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_DC4_CONTROL, .start = WM831X_DC4_CONTROL,
.end = WM831X_DC4_SLEEP_CONTROL, .end = WM831X_DC4_SLEEP_CONTROL,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
{ {
.name = "UV", .name = "UV",
...@@ -695,10 +685,9 @@ static struct resource wm831x_dcdc4_resources[] = { ...@@ -695,10 +685,9 @@ static struct resource wm831x_dcdc4_resources[] = {
static struct resource wm8320_dcdc4_buck_resources[] = { static struct resource wm8320_dcdc4_buck_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_DC4_CONTROL, .start = WM831X_DC4_CONTROL,
.end = WM832X_DC4_SLEEP_CONTROL, .end = WM832X_DC4_SLEEP_CONTROL,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
{ {
.name = "UV", .name = "UV",
...@@ -718,10 +707,9 @@ static struct resource wm831x_gpio_resources[] = { ...@@ -718,10 +707,9 @@ static struct resource wm831x_gpio_resources[] = {
static struct resource wm831x_isink1_resources[] = { static struct resource wm831x_isink1_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_CURRENT_SINK_1, .start = WM831X_CURRENT_SINK_1,
.end = WM831X_CURRENT_SINK_1, .end = WM831X_CURRENT_SINK_1,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
{ {
.start = WM831X_IRQ_CS1, .start = WM831X_IRQ_CS1,
...@@ -732,10 +720,9 @@ static struct resource wm831x_isink1_resources[] = { ...@@ -732,10 +720,9 @@ static struct resource wm831x_isink1_resources[] = {
static struct resource wm831x_isink2_resources[] = { static struct resource wm831x_isink2_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_CURRENT_SINK_2, .start = WM831X_CURRENT_SINK_2,
.end = WM831X_CURRENT_SINK_2, .end = WM831X_CURRENT_SINK_2,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
{ {
.start = WM831X_IRQ_CS2, .start = WM831X_IRQ_CS2,
...@@ -746,10 +733,9 @@ static struct resource wm831x_isink2_resources[] = { ...@@ -746,10 +733,9 @@ static struct resource wm831x_isink2_resources[] = {
static struct resource wm831x_ldo1_resources[] = { static struct resource wm831x_ldo1_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_LDO1_CONTROL, .start = WM831X_LDO1_CONTROL,
.end = WM831X_LDO1_SLEEP_CONTROL, .end = WM831X_LDO1_SLEEP_CONTROL,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
{ {
.name = "UV", .name = "UV",
...@@ -761,10 +747,9 @@ static struct resource wm831x_ldo1_resources[] = { ...@@ -761,10 +747,9 @@ static struct resource wm831x_ldo1_resources[] = {
static struct resource wm831x_ldo2_resources[] = { static struct resource wm831x_ldo2_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_LDO2_CONTROL, .start = WM831X_LDO2_CONTROL,
.end = WM831X_LDO2_SLEEP_CONTROL, .end = WM831X_LDO2_SLEEP_CONTROL,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
{ {
.name = "UV", .name = "UV",
...@@ -776,10 +761,9 @@ static struct resource wm831x_ldo2_resources[] = { ...@@ -776,10 +761,9 @@ static struct resource wm831x_ldo2_resources[] = {
static struct resource wm831x_ldo3_resources[] = { static struct resource wm831x_ldo3_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_LDO3_CONTROL, .start = WM831X_LDO3_CONTROL,
.end = WM831X_LDO3_SLEEP_CONTROL, .end = WM831X_LDO3_SLEEP_CONTROL,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
{ {
.name = "UV", .name = "UV",
...@@ -791,10 +775,9 @@ static struct resource wm831x_ldo3_resources[] = { ...@@ -791,10 +775,9 @@ static struct resource wm831x_ldo3_resources[] = {
static struct resource wm831x_ldo4_resources[] = { static struct resource wm831x_ldo4_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_LDO4_CONTROL, .start = WM831X_LDO4_CONTROL,
.end = WM831X_LDO4_SLEEP_CONTROL, .end = WM831X_LDO4_SLEEP_CONTROL,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
{ {
.name = "UV", .name = "UV",
...@@ -806,10 +789,9 @@ static struct resource wm831x_ldo4_resources[] = { ...@@ -806,10 +789,9 @@ static struct resource wm831x_ldo4_resources[] = {
static struct resource wm831x_ldo5_resources[] = { static struct resource wm831x_ldo5_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_LDO5_CONTROL, .start = WM831X_LDO5_CONTROL,
.end = WM831X_LDO5_SLEEP_CONTROL, .end = WM831X_LDO5_SLEEP_CONTROL,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
{ {
.name = "UV", .name = "UV",
...@@ -821,10 +803,9 @@ static struct resource wm831x_ldo5_resources[] = { ...@@ -821,10 +803,9 @@ static struct resource wm831x_ldo5_resources[] = {
static struct resource wm831x_ldo6_resources[] = { static struct resource wm831x_ldo6_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_LDO6_CONTROL, .start = WM831X_LDO6_CONTROL,
.end = WM831X_LDO6_SLEEP_CONTROL, .end = WM831X_LDO6_SLEEP_CONTROL,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
{ {
.name = "UV", .name = "UV",
...@@ -836,10 +817,9 @@ static struct resource wm831x_ldo6_resources[] = { ...@@ -836,10 +817,9 @@ static struct resource wm831x_ldo6_resources[] = {
static struct resource wm831x_ldo7_resources[] = { static struct resource wm831x_ldo7_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_LDO7_CONTROL, .start = WM831X_LDO7_CONTROL,
.end = WM831X_LDO7_SLEEP_CONTROL, .end = WM831X_LDO7_SLEEP_CONTROL,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
{ {
.name = "UV", .name = "UV",
...@@ -851,10 +831,9 @@ static struct resource wm831x_ldo7_resources[] = { ...@@ -851,10 +831,9 @@ static struct resource wm831x_ldo7_resources[] = {
static struct resource wm831x_ldo8_resources[] = { static struct resource wm831x_ldo8_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_LDO8_CONTROL, .start = WM831X_LDO8_CONTROL,
.end = WM831X_LDO8_SLEEP_CONTROL, .end = WM831X_LDO8_SLEEP_CONTROL,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
{ {
.name = "UV", .name = "UV",
...@@ -866,10 +845,9 @@ static struct resource wm831x_ldo8_resources[] = { ...@@ -866,10 +845,9 @@ static struct resource wm831x_ldo8_resources[] = {
static struct resource wm831x_ldo9_resources[] = { static struct resource wm831x_ldo9_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_LDO9_CONTROL, .start = WM831X_LDO9_CONTROL,
.end = WM831X_LDO9_SLEEP_CONTROL, .end = WM831X_LDO9_SLEEP_CONTROL,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
{ {
.name = "UV", .name = "UV",
...@@ -881,10 +859,9 @@ static struct resource wm831x_ldo9_resources[] = { ...@@ -881,10 +859,9 @@ static struct resource wm831x_ldo9_resources[] = {
static struct resource wm831x_ldo10_resources[] = { static struct resource wm831x_ldo10_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_LDO10_CONTROL, .start = WM831X_LDO10_CONTROL,
.end = WM831X_LDO10_SLEEP_CONTROL, .end = WM831X_LDO10_SLEEP_CONTROL,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
{ {
.name = "UV", .name = "UV",
...@@ -896,10 +873,9 @@ static struct resource wm831x_ldo10_resources[] = { ...@@ -896,10 +873,9 @@ static struct resource wm831x_ldo10_resources[] = {
static struct resource wm831x_ldo11_resources[] = { static struct resource wm831x_ldo11_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_LDO11_ON_CONTROL, .start = WM831X_LDO11_ON_CONTROL,
.end = WM831X_LDO11_SLEEP_CONTROL, .end = WM831X_LDO11_SLEEP_CONTROL,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
}; };
...@@ -998,19 +974,17 @@ static struct resource wm831x_rtc_resources[] = { ...@@ -998,19 +974,17 @@ static struct resource wm831x_rtc_resources[] = {
static struct resource wm831x_status1_resources[] = { static struct resource wm831x_status1_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_STATUS_LED_1, .start = WM831X_STATUS_LED_1,
.end = WM831X_STATUS_LED_1, .end = WM831X_STATUS_LED_1,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
}; };
static struct resource wm831x_status2_resources[] = { static struct resource wm831x_status2_resources[] = {
{ {
.parent = &wm831x_io_parent,
.start = WM831X_STATUS_LED_2, .start = WM831X_STATUS_LED_2,
.end = WM831X_STATUS_LED_2, .end = WM831X_STATUS_LED_2,
.flags = IORESOURCE_IO, .flags = IORESOURCE_REG,
}, },
}; };
......
...@@ -476,9 +476,9 @@ static __devinit int wm831x_buckv_probe(struct platform_device *pdev) ...@@ -476,9 +476,9 @@ static __devinit int wm831x_buckv_probe(struct platform_device *pdev)
dcdc->wm831x = wm831x; dcdc->wm831x = wm831x;
res = platform_get_resource(pdev, IORESOURCE_IO, 0); res = platform_get_resource(pdev, IORESOURCE_REG, 0);
if (res == NULL) { if (res == NULL) {
dev_err(&pdev->dev, "No I/O resource\n"); dev_err(&pdev->dev, "No REG resource\n");
ret = -EINVAL; ret = -EINVAL;
goto err; goto err;
} }
...@@ -651,9 +651,9 @@ static __devinit int wm831x_buckp_probe(struct platform_device *pdev) ...@@ -651,9 +651,9 @@ static __devinit int wm831x_buckp_probe(struct platform_device *pdev)
dcdc->wm831x = wm831x; dcdc->wm831x = wm831x;
res = platform_get_resource(pdev, IORESOURCE_IO, 0); res = platform_get_resource(pdev, IORESOURCE_REG, 0);
if (res == NULL) { if (res == NULL) {
dev_err(&pdev->dev, "No I/O resource\n"); dev_err(&pdev->dev, "No REG resource\n");
ret = -EINVAL; ret = -EINVAL;
goto err; goto err;
} }
...@@ -795,9 +795,9 @@ static __devinit int wm831x_boostp_probe(struct platform_device *pdev) ...@@ -795,9 +795,9 @@ static __devinit int wm831x_boostp_probe(struct platform_device *pdev)
dcdc->wm831x = wm831x; dcdc->wm831x = wm831x;
res = platform_get_resource(pdev, IORESOURCE_IO, 0); res = platform_get_resource(pdev, IORESOURCE_REG, 0);
if (res == NULL) { if (res == NULL) {
dev_err(&pdev->dev, "No I/O resource\n"); dev_err(&pdev->dev, "No REG resource\n");
ret = -EINVAL; ret = -EINVAL;
goto err; goto err;
} }
......
...@@ -172,9 +172,9 @@ static __devinit int wm831x_isink_probe(struct platform_device *pdev) ...@@ -172,9 +172,9 @@ static __devinit int wm831x_isink_probe(struct platform_device *pdev)
isink->wm831x = wm831x; isink->wm831x = wm831x;
res = platform_get_resource(pdev, IORESOURCE_IO, 0); res = platform_get_resource(pdev, IORESOURCE_REG, 0);
if (res == NULL) { if (res == NULL) {
dev_err(&pdev->dev, "No I/O resource\n"); dev_err(&pdev->dev, "No REG resource\n");
ret = -EINVAL; ret = -EINVAL;
goto err; goto err;
} }
......
...@@ -269,9 +269,9 @@ static __devinit int wm831x_gp_ldo_probe(struct platform_device *pdev) ...@@ -269,9 +269,9 @@ static __devinit int wm831x_gp_ldo_probe(struct platform_device *pdev)
ldo->wm831x = wm831x; ldo->wm831x = wm831x;
res = platform_get_resource(pdev, IORESOURCE_IO, 0); res = platform_get_resource(pdev, IORESOURCE_REG, 0);
if (res == NULL) { if (res == NULL) {
dev_err(&pdev->dev, "No I/O resource\n"); dev_err(&pdev->dev, "No REG resource\n");
ret = -EINVAL; ret = -EINVAL;
goto err; goto err;
} }
...@@ -520,9 +520,9 @@ static __devinit int wm831x_aldo_probe(struct platform_device *pdev) ...@@ -520,9 +520,9 @@ static __devinit int wm831x_aldo_probe(struct platform_device *pdev)
ldo->wm831x = wm831x; ldo->wm831x = wm831x;
res = platform_get_resource(pdev, IORESOURCE_IO, 0); res = platform_get_resource(pdev, IORESOURCE_REG, 0);
if (res == NULL) { if (res == NULL) {
dev_err(&pdev->dev, "No I/O resource\n"); dev_err(&pdev->dev, "No REG resource\n");
ret = -EINVAL; ret = -EINVAL;
goto err; goto err;
} }
...@@ -675,9 +675,9 @@ static __devinit int wm831x_alive_ldo_probe(struct platform_device *pdev) ...@@ -675,9 +675,9 @@ static __devinit int wm831x_alive_ldo_probe(struct platform_device *pdev)
ldo->wm831x = wm831x; ldo->wm831x = wm831x;
res = platform_get_resource(pdev, IORESOURCE_IO, 0); res = platform_get_resource(pdev, IORESOURCE_REG, 0);
if (res == NULL) { if (res == NULL) {
dev_err(&pdev->dev, "No I/O resource\n"); dev_err(&pdev->dev, "No REG resource\n");
ret = -EINVAL; ret = -EINVAL;
goto err; goto err;
} }
......
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