Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <linux/err.h>
- #include <linux/hardirq.h>
- #include <linux/init.h>
- #include <linux/interrupt.h>
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <plat/dmtimer.h>
- int dmt1 = 3;
- int dmt2 = 4;
- module_param(dmt1, int, 0);
- module_param(dmt2, int, 0);
- void tsk_enable_timer(unsigned long id)
- {
- struct omap_dm_timer *dmt = NULL;
- dmt = omap_dm_timer_request_specific(id);
- if (!dmt) {
- printk("%s error requesting timer\n", __func__);
- return;
- }
- omap_dm_timer_free(dmt);
- }
- struct tasklet_struct dmt_tsk;
- static int __init dmtimer_test_init(void)
- {
- struct omap_dm_timer *dmt = NULL;
- dmt = omap_dm_timer_request_specific(dmt1);
- if (!dmt)
- printk("%s error requesting timer\n", __func__);
- tasklet_init(&dmt_tsk, tsk_enable_timer, dmt2);
- tasklet_schedule(&dmt_tsk);
- if (dmt)
- omap_dm_timer_free(dmt);
- return 0;
- }
- static void __exit dmtimer_test_exit(void)
- {
- tasklet_kill(&dmt_tsk);
- }
- module_init(dmtimer_test_init);
- module_exit(dmtimer_test_exit);
- MODULE_AUTHOR("Omar");
- MODULE_LICENSE("GPL");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement