Skip to content

Commit 4fc9a04

Browse files
lukaszluba-armchanwoochoi
authored andcommitted
memory: samsung: exynos5422-dmc: Add module param to control IRQ mode
The driver can operate in two modes relaying on devfreq monitoring mechanism which periodically checks the device status or it can use interrupts when they are provided by loaded Device Tree. The newly introduced module parameter can be used to choose between devfreq monitoring and internal interrupts without modifying the Device Tree. It also sets devfreq monitoring as default when the parameter is not set (also the case for default when the driver is not built as a module). Reported-by: Willy Wolff <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Lukasz Luba <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
1 parent 74ca9e4 commit 4fc9a04

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/memory/samsung/exynos5422-dmc.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/io.h>
1313
#include <linux/mfd/syscon.h>
1414
#include <linux/module.h>
15+
#include <linux/moduleparam.h>
1516
#include <linux/of_device.h>
1617
#include <linux/pm_opp.h>
1718
#include <linux/platform_device.h>
@@ -21,6 +22,10 @@
2122
#include "../jedec_ddr.h"
2223
#include "../of_memory.h"
2324

25+
static int irqmode;
26+
module_param(irqmode, int, 0644);
27+
MODULE_PARM_DESC(irqmode, "Enable IRQ mode (0=off [default], 1=on)");
28+
2429
#define EXYNOS5_DREXI_TIMINGAREF (0x0030)
2530
#define EXYNOS5_DREXI_TIMINGROW0 (0x0034)
2631
#define EXYNOS5_DREXI_TIMINGDATA0 (0x0038)
@@ -1428,7 +1433,7 @@ static int exynos5_dmc_probe(struct platform_device *pdev)
14281433
/* There is two modes in which the driver works: polling or IRQ */
14291434
irq[0] = platform_get_irq_byname(pdev, "drex_0");
14301435
irq[1] = platform_get_irq_byname(pdev, "drex_1");
1431-
if (irq[0] > 0 && irq[1] > 0) {
1436+
if (irq[0] > 0 && irq[1] > 0 && irqmode) {
14321437
ret = devm_request_threaded_irq(dev, irq[0], NULL,
14331438
dmc_irq_thread, IRQF_ONESHOT,
14341439
dev_name(dev), dmc);
@@ -1485,7 +1490,7 @@ static int exynos5_dmc_probe(struct platform_device *pdev)
14851490
if (dmc->in_irq_mode)
14861491
exynos5_dmc_start_perf_events(dmc, PERF_COUNTER_START_VALUE);
14871492

1488-
dev_info(dev, "DMC initialized\n");
1493+
dev_info(dev, "DMC initialized, in irq mode: %d\n", dmc->in_irq_mode);
14891494

14901495
return 0;
14911496

0 commit comments

Comments
 (0)