aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2014-03-17 06:14:34 -0400
committerArnd Bergmann <arnd@arndb.de>2014-03-17 06:14:34 -0400
commitcda88c8be59128da05d7cd58f9ce2754a1416516 (patch)
treeb0af393c68b3d53fcdb100b8cb07af884bd3d4d5
parentde65ded49e95dbbd685b613a615f6821868e5b33 (diff)
parent200c0a3e404beab02be83e5cbf111d26b9f6ce22 (diff)
Merge tag 'mvebu-drivers-3.15-2' of git://git.infradead.org/linux-mvebu into next/drivers
Merge "mvebu drivers for v3.15" from Jason Cooper: pull request #1: - mvebu mbus - use of_find_matching_node_and_match - rtc - use PTR_ERR_OR_ZERO in isl12057 - work around issue in mv where date returned is 2038 - kirkwood -> mach-mvebu - various Kconfig oneliners to allow building kirkwood in -mvebu/ pull request #2: - reset - re-use qnap-poweroff driver for Synology NASs * tag 'mvebu-drivers-3.15-2' of git://git.infradead.org/linux-mvebu: Power: Reset: Generalize qnap-poweroff to work on Synology devices. drivers: Enable building of Kirkwood drivers for mach-mvebu rtc: mv: reset date if after year 2038 rtc: isl12057: use PTR_ERR_OR_ZERO to fix coccinelle warnings bus: mvebu-mbus: make use of of_find_matching_node_and_match Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--Documentation/devicetree/bindings/power_supply/qnap-poweroff.txt5
-rw-r--r--drivers/bus/mvebu-mbus.c3
-rw-r--r--drivers/cpufreq/Kconfig.arm2
-rw-r--r--drivers/cpuidle/Kconfig.arm2
-rw-r--r--drivers/leds/Kconfig4
-rw-r--r--drivers/phy/Kconfig2
-rw-r--r--drivers/power/reset/qnap-poweroff.c49
-rw-r--r--drivers/rtc/rtc-isl12057.c5
-rw-r--r--drivers/rtc/rtc-mv.c12
-rw-r--r--drivers/thermal/Kconfig2
-rw-r--r--sound/soc/kirkwood/Kconfig2
11 files changed, 62 insertions, 26 deletions
diff --git a/Documentation/devicetree/bindings/power_supply/qnap-poweroff.txt b/Documentation/devicetree/bindings/power_supply/qnap-poweroff.txt
index 0347d8350d94..af25e77c0e0c 100644
--- a/Documentation/devicetree/bindings/power_supply/qnap-poweroff.txt
+++ b/Documentation/devicetree/bindings/power_supply/qnap-poweroff.txt
@@ -6,8 +6,11 @@ Orion5x SoCs. Sending the character 'A', at 19200 baud, tells the
6microcontroller to turn the power off. This driver adds a handler to 6microcontroller to turn the power off. This driver adds a handler to
7pm_power_off which is called to turn the power off. 7pm_power_off which is called to turn the power off.
8 8
9Synology NAS devices use a similar scheme, but a different baud rate,
109600, and a different character, '1'.
11
9Required Properties: 12Required Properties:
10- compatible: Should be "qnap,power-off" 13- compatible: Should be "qnap,power-off" or "synology,power-off"
11 14
12- reg: Address and length of the register set for UART1 15- reg: Address and length of the register set for UART1
13- clocks: tclk clock 16- clocks: tclk clock
diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index 725c46162bbd..31f2c805d3e5 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -890,13 +890,12 @@ int __init mvebu_mbus_dt_init(void)
890 const __be32 *prop; 890 const __be32 *prop;
891 int ret; 891 int ret;
892 892
893 np = of_find_matching_node(NULL, of_mvebu_mbus_ids); 893 np = of_find_matching_node_and_match(NULL, of_mvebu_mbus_ids, &of_id);
894 if (!np) { 894 if (!np) {
895 pr_err("could not find a matching SoC family\n"); 895 pr_err("could not find a matching SoC family\n");
896 return -ENODEV; 896 return -ENODEV;
897 } 897 }
898 898
899 of_id = of_match_node(of_mvebu_mbus_ids, np);
900 mbus_state.soc = of_id->data; 899 mbus_state.soc = of_id->data;
901 900
902 prop = of_get_property(np, "controller", NULL); 901 prop = of_get_property(np, "controller", NULL);
diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
index 31297499a60a..077db3aa985b 100644
--- a/drivers/cpufreq/Kconfig.arm
+++ b/drivers/cpufreq/Kconfig.arm
@@ -113,7 +113,7 @@ config ARM_INTEGRATOR
113 If in doubt, say Y. 113 If in doubt, say Y.
114 114
115config ARM_KIRKWOOD_CPUFREQ 115config ARM_KIRKWOOD_CPUFREQ
116 def_bool ARCH_KIRKWOOD && OF 116 def_bool MACH_KIRKWOOD
117 help 117 help
118 This adds the CPUFreq driver for Marvell Kirkwood 118 This adds the CPUFreq driver for Marvell Kirkwood
119 SoCs. 119 SoCs.
diff --git a/drivers/cpuidle/Kconfig.arm b/drivers/cpuidle/Kconfig.arm
index d988948a89a0..97ccc31dbdd8 100644
--- a/drivers/cpuidle/Kconfig.arm
+++ b/drivers/cpuidle/Kconfig.arm
@@ -22,7 +22,7 @@ config ARM_HIGHBANK_CPUIDLE
22 22
23config ARM_KIRKWOOD_CPUIDLE 23config ARM_KIRKWOOD_CPUIDLE
24 bool "CPU Idle Driver for Marvell Kirkwood SoCs" 24 bool "CPU Idle Driver for Marvell Kirkwood SoCs"
25 depends on ARCH_KIRKWOOD 25 depends on ARCH_KIRKWOOD || MACH_KIRKWOOD
26 help 26 help
27 This adds the CPU Idle driver for Marvell Kirkwood SoCs. 27 This adds the CPU Idle driver for Marvell Kirkwood SoCs.
28 28
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 72156c123033..44c358ecf5a1 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -421,7 +421,7 @@ config LEDS_MC13783
421config LEDS_NS2 421config LEDS_NS2
422 tristate "LED support for Network Space v2 GPIO LEDs" 422 tristate "LED support for Network Space v2 GPIO LEDs"
423 depends on LEDS_CLASS 423 depends on LEDS_CLASS
424 depends on ARCH_KIRKWOOD 424 depends on ARCH_KIRKWOOD || MACH_KIRKWOOD
425 default y 425 default y
426 help 426 help
427 This option enable support for the dual-GPIO LED found on the 427 This option enable support for the dual-GPIO LED found on the
@@ -431,7 +431,7 @@ config LEDS_NS2
431config LEDS_NETXBIG 431config LEDS_NETXBIG
432 tristate "LED support for Big Network series LEDs" 432 tristate "LED support for Big Network series LEDs"
433 depends on LEDS_CLASS 433 depends on LEDS_CLASS
434 depends on ARCH_KIRKWOOD 434 depends on ARCH_KIRKWOOD || MACH_KIRKWOOD
435 default y 435 default y
436 help 436 help
437 This option enable support for LEDs found on the LaCie 2Big 437 This option enable support for LEDs found on the LaCie 2Big
diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index afa2354f6600..5e6b33f9c294 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -24,7 +24,7 @@ config PHY_EXYNOS_MIPI_VIDEO
24 24
25config PHY_MVEBU_SATA 25config PHY_MVEBU_SATA
26 def_bool y 26 def_bool y
27 depends on ARCH_KIRKWOOD || ARCH_DOVE 27 depends on ARCH_KIRKWOOD || ARCH_DOVE || MACH_KIRKWOOD
28 depends on OF 28 depends on OF
29 select GENERIC_PHY 29 select GENERIC_PHY
30 30
diff --git a/drivers/power/reset/qnap-poweroff.c b/drivers/power/reset/qnap-poweroff.c
index 37f56f7ee926..a75db7f8a92f 100644
--- a/drivers/power/reset/qnap-poweroff.c
+++ b/drivers/power/reset/qnap-poweroff.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * QNAP Turbo NAS Board power off 2 * QNAP Turbo NAS Board power off. Can also be used on Synology devices.
3 * 3 *
4 * Copyright (C) 2012 Andrew Lunn <andrew@lunn.ch> 4 * Copyright (C) 2012 Andrew Lunn <andrew@lunn.ch>
5 * 5 *
@@ -25,17 +25,43 @@
25 25
26#define UART1_REG(x) (base + ((UART_##x) << 2)) 26#define UART1_REG(x) (base + ((UART_##x) << 2))
27 27
28struct power_off_cfg {
29 u32 baud;
30 char cmd;
31};
32
33static const struct power_off_cfg qnap_power_off_cfg = {
34 .baud = 19200,
35 .cmd = 'A',
36};
37
38static const struct power_off_cfg synology_power_off_cfg = {
39 .baud = 9600,
40 .cmd = '1',
41};
42
43static const struct of_device_id qnap_power_off_of_match_table[] = {
44 { .compatible = "qnap,power-off",
45 .data = &qnap_power_off_cfg,
46 },
47 { .compatible = "synology,power-off",
48 .data = &synology_power_off_cfg,
49 },
50 {}
51};
52MODULE_DEVICE_TABLE(of, qnap_power_off_of_match_table);
53
28static void __iomem *base; 54static void __iomem *base;
29static unsigned long tclk; 55static unsigned long tclk;
56static const struct power_off_cfg *cfg;
30 57
31static void qnap_power_off(void) 58static void qnap_power_off(void)
32{ 59{
33 /* 19200 baud divisor */ 60 const unsigned divisor = ((tclk + (8 * cfg->baud)) / (16 * cfg->baud));
34 const unsigned divisor = ((tclk + (8 * 19200)) / (16 * 19200));
35 61
36 pr_err("%s: triggering power-off...\n", __func__); 62 pr_err("%s: triggering power-off...\n", __func__);
37 63
38 /* hijack UART1 and reset into sane state (19200,8n1) */ 64 /* hijack UART1 and reset into sane state */
39 writel(0x83, UART1_REG(LCR)); 65 writel(0x83, UART1_REG(LCR));
40 writel(divisor & 0xff, UART1_REG(DLL)); 66 writel(divisor & 0xff, UART1_REG(DLL));
41 writel((divisor >> 8) & 0xff, UART1_REG(DLM)); 67 writel((divisor >> 8) & 0xff, UART1_REG(DLM));
@@ -44,16 +70,21 @@ static void qnap_power_off(void)
44 writel(0x00, UART1_REG(FCR)); 70 writel(0x00, UART1_REG(FCR));
45 writel(0x00, UART1_REG(MCR)); 71 writel(0x00, UART1_REG(MCR));
46 72
47 /* send the power-off command 'A' to PIC */ 73 /* send the power-off command to PIC */
48 writel('A', UART1_REG(TX)); 74 writel(cfg->cmd, UART1_REG(TX));
49} 75}
50 76
51static int qnap_power_off_probe(struct platform_device *pdev) 77static int qnap_power_off_probe(struct platform_device *pdev)
52{ 78{
79 struct device_node *np = pdev->dev.of_node;
53 struct resource *res; 80 struct resource *res;
54 struct clk *clk; 81 struct clk *clk;
55 char symname[KSYM_NAME_LEN]; 82 char symname[KSYM_NAME_LEN];
56 83
84 const struct of_device_id *match =
85 of_match_node(qnap_power_off_of_match_table, np);
86 cfg = match->data;
87
57 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 88 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
58 if (!res) { 89 if (!res) {
59 dev_err(&pdev->dev, "Missing resource"); 90 dev_err(&pdev->dev, "Missing resource");
@@ -94,12 +125,6 @@ static int qnap_power_off_remove(struct platform_device *pdev)
94 return 0; 125 return 0;
95} 126}
96 127
97static const struct of_device_id qnap_power_off_of_match_table[] = {
98 { .compatible = "qnap,power-off", },
99 {}
100};
101MODULE_DEVICE_TABLE(of, qnap_power_off_of_match_table);
102
103static struct platform_driver qnap_power_off_driver = { 128static struct platform_driver qnap_power_off_driver = {
104 .probe = qnap_power_off_probe, 129 .probe = qnap_power_off_probe,
105 .remove = qnap_power_off_remove, 130 .remove = qnap_power_off_remove,
diff --git a/drivers/rtc/rtc-isl12057.c b/drivers/rtc/rtc-isl12057.c
index 7854a656628f..835b425549bd 100644
--- a/drivers/rtc/rtc-isl12057.c
+++ b/drivers/rtc/rtc-isl12057.c
@@ -275,10 +275,7 @@ static int isl12057_probe(struct i2c_client *client,
275 dev_set_drvdata(dev, data); 275 dev_set_drvdata(dev, data);
276 276
277 rtc = devm_rtc_device_register(dev, DRV_NAME, &rtc_ops, THIS_MODULE); 277 rtc = devm_rtc_device_register(dev, DRV_NAME, &rtc_ops, THIS_MODULE);
278 if (IS_ERR(rtc)) 278 return PTR_ERR_OR_ZERO(rtc);
279 return PTR_ERR(rtc);
280
281 return 0;
282} 279}
283 280
284#ifdef CONFIG_OF 281#ifdef CONFIG_OF
diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
index d536c5962c99..d15a999363fc 100644
--- a/drivers/rtc/rtc-mv.c
+++ b/drivers/rtc/rtc-mv.c
@@ -222,6 +222,7 @@ static int __init mv_rtc_probe(struct platform_device *pdev)
222 struct resource *res; 222 struct resource *res;
223 struct rtc_plat_data *pdata; 223 struct rtc_plat_data *pdata;
224 u32 rtc_time; 224 u32 rtc_time;
225 u32 rtc_date;
225 int ret = 0; 226 int ret = 0;
226 227
227 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 228 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
@@ -257,6 +258,17 @@ static int __init mv_rtc_probe(struct platform_device *pdev)
257 } 258 }
258 } 259 }
259 260
261 /*
262 * A date after January 19th, 2038 does not fit on 32 bits and
263 * will confuse the kernel and userspace. Reset to a sane date
264 * (January 1st, 2013) if we're after 2038.
265 */
266 rtc_date = readl(pdata->ioaddr + RTC_DATE_REG_OFFS);
267 if (bcd2bin((rtc_date >> RTC_YEAR_OFFS) & 0xff) >= 38) {
268 dev_info(&pdev->dev, "invalid RTC date, resetting to January 1st, 2013\n");
269 writel(0x130101, pdata->ioaddr + RTC_DATE_REG_OFFS);
270 }
271
260 pdata->irq = platform_get_irq(pdev, 0); 272 pdata->irq = platform_get_irq(pdev, 0);
261 273
262 platform_set_drvdata(pdev, pdata); 274 platform_set_drvdata(pdev, pdata);
diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
index 35c066489a19..1bc9cbc4f1b8 100644
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
@@ -142,7 +142,7 @@ config RCAR_THERMAL
142 142
143config KIRKWOOD_THERMAL 143config KIRKWOOD_THERMAL
144 tristate "Temperature sensor on Marvell Kirkwood SoCs" 144 tristate "Temperature sensor on Marvell Kirkwood SoCs"
145 depends on ARCH_KIRKWOOD 145 depends on ARCH_KIRKWOOD || MACH_KIRKWOOD
146 depends on OF 146 depends on OF
147 help 147 help
148 Support for the Kirkwood thermal sensor driver into the Linux thermal 148 Support for the Kirkwood thermal sensor driver into the Linux thermal
diff --git a/sound/soc/kirkwood/Kconfig b/sound/soc/kirkwood/Kconfig
index 78ed4a42ad21..106e2e22fed2 100644
--- a/sound/soc/kirkwood/Kconfig
+++ b/sound/soc/kirkwood/Kconfig
@@ -1,6 +1,6 @@
1config SND_KIRKWOOD_SOC 1config SND_KIRKWOOD_SOC
2 tristate "SoC Audio for the Marvell Kirkwood and Dove chips" 2 tristate "SoC Audio for the Marvell Kirkwood and Dove chips"
3 depends on ARCH_KIRKWOOD || ARCH_DOVE || COMPILE_TEST 3 depends on ARCH_KIRKWOOD || ARCH_DOVE || MACH_KIRKWOOD || COMPILE_TEST
4 help 4 help
5 Say Y or M if you want to add support for codecs attached to 5 Say Y or M if you want to add support for codecs attached to
6 the Kirkwood I2S interface. You will also need to select the 6 the Kirkwood I2S interface. You will also need to select the