mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 20:14:27 +01:00
dummy-irq
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# Changes to this file are automatically used in the new kernel
|
# Changes to this file are automatically trigger kernel reconfigures
|
||||||
# after ./run, no need to do anything different.
|
# even without using the linux-reconfigure target.
|
||||||
|
|
||||||
CONFIG_DEBUG_FS=y
|
CONFIG_DEBUG_FS=y
|
||||||
CONFIG_DEBUG_INFO=y
|
CONFIG_DEBUG_INFO=y
|
||||||
@@ -108,3 +108,19 @@ CONFIG_ARM_AMBA=y
|
|||||||
CONFIG_GPIOLIB=y
|
CONFIG_GPIOLIB=y
|
||||||
CONFIG_GPIO_SYSFS=y
|
CONFIG_GPIO_SYSFS=y
|
||||||
CONFIG_GPIO_PL061=y
|
CONFIG_GPIO_PL061=y
|
||||||
|
|
||||||
|
# run -a arm
|
||||||
|
#
|
||||||
|
# In target:
|
||||||
|
#
|
||||||
|
# modprobe dummy-irq irq=34
|
||||||
|
# insmod /platform_device.ko
|
||||||
|
#
|
||||||
|
# Outcome:
|
||||||
|
#
|
||||||
|
# lkmc_platform_device_write offset=0 value=12345678 size=4
|
||||||
|
# dummy-irq: interrupt occurred on IRQ 34
|
||||||
|
#
|
||||||
|
# When the device generates an IRQ,
|
||||||
|
# the dummy module also snoops it.
|
||||||
|
CONFIG_DUMMY_IRQ=m
|
||||||
|
|||||||
@@ -55,9 +55,9 @@ static int lkmc_platform_device_probe(struct platform_device *pdev)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* IRQ. */
|
/* IRQ. Shared so that other test modules may snoop it. */
|
||||||
irq = irq_of_parse_and_map(dev->of_node, 0);
|
irq = irq_of_parse_and_map(dev->of_node, 0);
|
||||||
if (request_irq(irq, lkmc_irq_handler, 0, "lkmc_platform_device", dev) < 0) {
|
if (request_irq(irq, lkmc_irq_handler, IRQF_SHARED, "lkmc_platform_device", dev) < 0) {
|
||||||
dev_err(dev, "request_irq");
|
dev_err(dev, "request_irq");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user