I am trying to work with a watchdog module on an embedded linux 2.6.11.
The insmod programme calls the watchdog_init function, and the rmmod calls the watchdog_exit function. That works fine.
The problem is that this module as no open/clore/read/write routine. The watchdog is started in watchdog_probe function which is called by nobody. No right now, the watchdog can't work at all.
So my questions are :
- how to call the probe routine from the Linux command line ?
- where are stored the resources variables returned by platform_get_resource?
Here is a simplify version of the driver :
static struct device_driver watchdog_driver = { .name = "name", .bus = &platform_bus_type, .probe = watchdog_probe, .remove = watchdog_remove, };
static int __init watchdog_init(void) { /* ... */ return driver_register(&watchdog_driver); }
static void __exit watchdog_exit(void) { /* ... */ driver_unregister(&watchdog_driver); }
static int watchdog_probe(struct device *device) { struct platform_device *pdev = to_platform_device(device); struct resource * r;
r = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = ioremap(r->start, r->end-r->start+1); /* ... */ }
static void watchdog_remove(void) { /* ... */ iounmap(base); }
module_init(watchdog_init) module_exit(watchdog_exit)