aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/btuart_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/bluetooth/btuart_cs.c')
-rw-r--r--drivers/bluetooth/btuart_cs.c38
1 files changed, 24 insertions, 14 deletions
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index 529a28a3209d..1828ba6ca25e 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
@@ -811,6 +811,28 @@ static void btuart_release(dev_link_t *link)
811 link->state &= ~DEV_CONFIG; 811 link->state &= ~DEV_CONFIG;
812} 812}
813 813
814static int btuart_suspend(struct pcmcia_device *dev)
815{
816 dev_link_t *link = dev_to_instance(dev);
817
818 link->state |= DEV_SUSPEND;
819 if (link->state & DEV_CONFIG)
820 pcmcia_release_configuration(link->handle);
821
822 return 0;
823}
824
825static int btuart_resume(struct pcmcia_device *dev)
826{
827 dev_link_t *link = dev_to_instance(dev);
828
829 link->state &= ~DEV_SUSPEND;
830 if (DEV_OK(link))
831 pcmcia_request_configuration(link->handle, &link->conf);
832
833 return 0;
834}
835
814 836
815static int btuart_event(event_t event, int priority, event_callback_args_t *args) 837static int btuart_event(event_t event, int priority, event_callback_args_t *args)
816{ 838{
@@ -829,20 +851,6 @@ static int btuart_event(event_t event, int priority, event_callback_args_t *args
829 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 851 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
830 btuart_config(link); 852 btuart_config(link);
831 break; 853 break;
832 case CS_EVENT_PM_SUSPEND:
833 link->state |= DEV_SUSPEND;
834 /* Fall through... */
835 case CS_EVENT_RESET_PHYSICAL:
836 if (link->state & DEV_CONFIG)
837 pcmcia_release_configuration(link->handle);
838 break;
839 case CS_EVENT_PM_RESUME:
840 link->state &= ~DEV_SUSPEND;
841 /* Fall through... */
842 case CS_EVENT_CARD_RESET:
843 if (DEV_OK(link))
844 pcmcia_request_configuration(link->handle, &link->conf);
845 break;
846 } 854 }
847 855
848 return 0; 856 return 0;
@@ -863,6 +871,8 @@ static struct pcmcia_driver btuart_driver = {
863 .event = btuart_event, 871 .event = btuart_event,
864 .detach = btuart_detach, 872 .detach = btuart_detach,
865 .id_table = btuart_ids, 873 .id_table = btuart_ids,
874 .suspend = btuart_suspend,
875 .resume = btuart_resume,
866}; 876};
867 877
868static int __init init_btuart_cs(void) 878static int __init init_btuart_cs(void)