diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-05-05 10:12:55 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-05-05 10:12:55 +0100 |
commit | f3831a592fe4332a70baad64a860b345398885b7 (patch) | |
tree | fd27b986295fe5a4f1c0924a804228f829a4c894 /drivers/input/serio/hp_sdc.c | |
parent | 376f7839b72ec526173cafb5d8eadfc61e2effdf (diff) | |
parent | 8560b9321f9050968f393ce1ec67e47c1a0bd5cf (diff) |
Merge commit 'takashi/topic/asoc' into for-2.6.31
Diffstat (limited to 'drivers/input/serio/hp_sdc.c')
-rw-r--r-- | drivers/input/serio/hp_sdc.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/input/serio/hp_sdc.c b/drivers/input/serio/hp_sdc.c index bfe49243f38b..1c9410d1822c 100644 --- a/drivers/input/serio/hp_sdc.c +++ b/drivers/input/serio/hp_sdc.c @@ -819,6 +819,7 @@ static const struct parisc_device_id hp_sdc_tbl[] = { MODULE_DEVICE_TABLE(parisc, hp_sdc_tbl); static int __init hp_sdc_init_hppa(struct parisc_device *d); +static struct delayed_work moduleloader_work; static struct parisc_driver hp_sdc_driver = { .name = "hp_sdc", @@ -930,8 +931,15 @@ static int __init hp_sdc_init(void) #if defined(__hppa__) +static void request_module_delayed(struct work_struct *work) +{ + request_module("hp_sdc_mlc"); +} + static int __init hp_sdc_init_hppa(struct parisc_device *d) { + int ret; + if (!d) return 1; if (hp_sdc.dev != NULL) @@ -944,13 +952,26 @@ static int __init hp_sdc_init_hppa(struct parisc_device *d) hp_sdc.data_io = d->hpa.start + 0x800; hp_sdc.status_io = d->hpa.start + 0x801; - return hp_sdc_init(); + INIT_DELAYED_WORK(&moduleloader_work, request_module_delayed); + + ret = hp_sdc_init(); + /* after sucessfull initialization give SDC some time to settle + * and then load the hp_sdc_mlc upper layer driver */ + if (!ret) + schedule_delayed_work(&moduleloader_work, + msecs_to_jiffies(2000)); + + return ret; } #endif /* __hppa__ */ static void hp_sdc_exit(void) { + /* do nothing if we don't have a SDC */ + if (!hp_sdc.dev) + return; + write_lock_irq(&hp_sdc.lock); /* Turn off all maskable "sub-function" irq's. */ @@ -969,6 +990,7 @@ static void hp_sdc_exit(void) tasklet_kill(&hp_sdc.task); #if defined(__hppa__) + cancel_delayed_work_sync(&moduleloader_work); if (unregister_parisc_driver(&hp_sdc_driver)) printk(KERN_WARNING PREFIX "Error unregistering HP SDC"); #endif |