Hi,
Due to real-time requirement, calling gpio_get_value() is too slow for me project. Now I am looking into another alternative -- reading from GPIO register directly to get the input value of a number of GPIO pins in one go. Below is my implementation:
int j, tmp, val;
void __iomem *base;
if (!request_mem_region (0x49058000, 1024, "gpio-test")) {
printk(KERN_INFO "request_mem_region failed");
result = -1;
goto fail;
}
base = ioremap (0x49058000, 1024);
if (!base) {
printk(KERN_INFO "ioremap failed");
result = -1;
goto fail;
}
tmp = ioread32(0x49058038);
printk(KERN_INFO "tmp 0x%04x\n", tmp);
However, my kernel module made kernel OOPS:
Unable to handle kernel paging request at virtual address 49058038
pgd = cb50c000
[49058038] *pgd=00000000
Internal error: Oops: 5 [#1]
Can someone guide me on this?
Many thanks,
Chuakai