diff options
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 bfe49243f38..1c9410d1822 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[] = { | |||
| 819 | MODULE_DEVICE_TABLE(parisc, hp_sdc_tbl); | 819 | MODULE_DEVICE_TABLE(parisc, hp_sdc_tbl); |
| 820 | 820 | ||
| 821 | static int __init hp_sdc_init_hppa(struct parisc_device *d); | 821 | static int __init hp_sdc_init_hppa(struct parisc_device *d); |
| 822 | static struct delayed_work moduleloader_work; | ||
| 822 | 823 | ||
| 823 | static struct parisc_driver hp_sdc_driver = { | 824 | static struct parisc_driver hp_sdc_driver = { |
| 824 | .name = "hp_sdc", | 825 | .name = "hp_sdc", |
| @@ -930,8 +931,15 @@ static int __init hp_sdc_init(void) | |||
| 930 | 931 | ||
| 931 | #if defined(__hppa__) | 932 | #if defined(__hppa__) |
| 932 | 933 | ||
| 934 | static void request_module_delayed(struct work_struct *work) | ||
| 935 | { | ||
| 936 | request_module("hp_sdc_mlc"); | ||
| 937 | } | ||
| 938 | |||
| 933 | static int __init hp_sdc_init_hppa(struct parisc_device *d) | 939 | static int __init hp_sdc_init_hppa(struct parisc_device *d) |
| 934 | { | 940 | { |
| 941 | int ret; | ||
| 942 | |||
| 935 | if (!d) | 943 | if (!d) |
| 936 | return 1; | 944 | return 1; |
| 937 | if (hp_sdc.dev != NULL) | 945 | if (hp_sdc.dev != NULL) |
| @@ -944,13 +952,26 @@ static int __init hp_sdc_init_hppa(struct parisc_device *d) | |||
| 944 | hp_sdc.data_io = d->hpa.start + 0x800; | 952 | hp_sdc.data_io = d->hpa.start + 0x800; |
| 945 | hp_sdc.status_io = d->hpa.start + 0x801; | 953 | hp_sdc.status_io = d->hpa.start + 0x801; |
| 946 | 954 | ||
| 947 | return hp_sdc_init(); | 955 | INIT_DELAYED_WORK(&moduleloader_work, request_module_delayed); |
| 956 | |||
| 957 | ret = hp_sdc_init(); | ||
| 958 | /* after sucessfull initialization give SDC some time to settle | ||
| 959 | * and then load the hp_sdc_mlc upper layer driver */ | ||
| 960 | if (!ret) | ||
| 961 | schedule_delayed_work(&moduleloader_work, | ||
| 962 | msecs_to_jiffies(2000)); | ||
| 963 | |||
| 964 | return ret; | ||
| 948 | } | 965 | } |
| 949 | 966 | ||
| 950 | #endif /* __hppa__ */ | 967 | #endif /* __hppa__ */ |
| 951 | 968 | ||
| 952 | static void hp_sdc_exit(void) | 969 | static void hp_sdc_exit(void) |
| 953 | { | 970 | { |
| 971 | /* do nothing if we don't have a SDC */ | ||
| 972 | if (!hp_sdc.dev) | ||
| 973 | return; | ||
| 974 | |||
| 954 | write_lock_irq(&hp_sdc.lock); | 975 | write_lock_irq(&hp_sdc.lock); |
| 955 | 976 | ||
| 956 | /* Turn off all maskable "sub-function" irq's. */ | 977 | /* Turn off all maskable "sub-function" irq's. */ |
| @@ -969,6 +990,7 @@ static void hp_sdc_exit(void) | |||
| 969 | tasklet_kill(&hp_sdc.task); | 990 | tasklet_kill(&hp_sdc.task); |
| 970 | 991 | ||
| 971 | #if defined(__hppa__) | 992 | #if defined(__hppa__) |
| 993 | cancel_delayed_work_sync(&moduleloader_work); | ||
| 972 | if (unregister_parisc_driver(&hp_sdc_driver)) | 994 | if (unregister_parisc_driver(&hp_sdc_driver)) |
| 973 | printk(KERN_WARNING PREFIX "Error unregistering HP SDC"); | 995 | printk(KERN_WARNING PREFIX "Error unregistering HP SDC"); |
| 974 | #endif | 996 | #endif |
