diff options
Diffstat (limited to 'drivers/bluetooth/bt3c_cs.c')
-rw-r--r-- | drivers/bluetooth/bt3c_cs.c | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c index d2a0add19cc8..1d524baa24a0 100644 --- a/drivers/bluetooth/bt3c_cs.c +++ b/drivers/bluetooth/bt3c_cs.c | |||
@@ -891,6 +891,27 @@ static void bt3c_release(dev_link_t *link) | |||
891 | link->state &= ~DEV_CONFIG; | 891 | link->state &= ~DEV_CONFIG; |
892 | } | 892 | } |
893 | 893 | ||
894 | static int bt3c_suspend(struct pcmcia_device *dev) | ||
895 | { | ||
896 | dev_link_t *link = dev_to_instance(dev); | ||
897 | |||
898 | link->state |= DEV_SUSPEND; | ||
899 | if (link->state & DEV_CONFIG) | ||
900 | pcmcia_release_configuration(link->handle); | ||
901 | |||
902 | return 0; | ||
903 | } | ||
904 | |||
905 | static int bt3c_resume(struct pcmcia_device *dev) | ||
906 | { | ||
907 | dev_link_t *link = dev_to_instance(dev); | ||
908 | |||
909 | link->state &= ~DEV_SUSPEND; | ||
910 | if (DEV_OK(link)) | ||
911 | pcmcia_request_configuration(link->handle, &link->conf); | ||
912 | |||
913 | return 0; | ||
914 | } | ||
894 | 915 | ||
895 | static int bt3c_event(event_t event, int priority, event_callback_args_t *args) | 916 | static int bt3c_event(event_t event, int priority, event_callback_args_t *args) |
896 | { | 917 | { |
@@ -909,20 +930,6 @@ static int bt3c_event(event_t event, int priority, event_callback_args_t *args) | |||
909 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 930 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
910 | bt3c_config(link); | 931 | bt3c_config(link); |
911 | break; | 932 | break; |
912 | case CS_EVENT_PM_SUSPEND: | ||
913 | link->state |= DEV_SUSPEND; | ||
914 | /* Fall through... */ | ||
915 | case CS_EVENT_RESET_PHYSICAL: | ||
916 | if (link->state & DEV_CONFIG) | ||
917 | pcmcia_release_configuration(link->handle); | ||
918 | break; | ||
919 | case CS_EVENT_PM_RESUME: | ||
920 | link->state &= ~DEV_SUSPEND; | ||
921 | /* Fall through... */ | ||
922 | case CS_EVENT_CARD_RESET: | ||
923 | if (DEV_OK(link)) | ||
924 | pcmcia_request_configuration(link->handle, &link->conf); | ||
925 | break; | ||
926 | } | 933 | } |
927 | 934 | ||
928 | return 0; | 935 | return 0; |
@@ -943,6 +950,8 @@ static struct pcmcia_driver bt3c_driver = { | |||
943 | .event = bt3c_event, | 950 | .event = bt3c_event, |
944 | .detach = bt3c_detach, | 951 | .detach = bt3c_detach, |
945 | .id_table = bt3c_ids, | 952 | .id_table = bt3c_ids, |
953 | .suspend = bt3c_suspend, | ||
954 | .resume = bt3c_resume, | ||
946 | }; | 955 | }; |
947 | 956 | ||
948 | static int __init init_bt3c_cs(void) | 957 | static int __init init_bt3c_cs(void) |