aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/ati_remote2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/misc/ati_remote2.c')
-rw-r--r--drivers/input/misc/ati_remote2.c78
1 files changed, 78 insertions, 0 deletions
diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c
index 3c9988dc0e9f..351eb9000def 100644
--- a/drivers/input/misc/ati_remote2.c
+++ b/drivers/input/misc/ati_remote2.c
@@ -139,6 +139,9 @@ static int ati_remote2_probe(struct usb_interface *interface, const struct usb_d
139static void ati_remote2_disconnect(struct usb_interface *interface); 139static void ati_remote2_disconnect(struct usb_interface *interface);
140static int ati_remote2_suspend(struct usb_interface *interface, pm_message_t message); 140static int ati_remote2_suspend(struct usb_interface *interface, pm_message_t message);
141static int ati_remote2_resume(struct usb_interface *interface); 141static int ati_remote2_resume(struct usb_interface *interface);
142static int ati_remote2_reset_resume(struct usb_interface *interface);
143static int ati_remote2_pre_reset(struct usb_interface *interface);
144static int ati_remote2_post_reset(struct usb_interface *interface);
142 145
143static struct usb_driver ati_remote2_driver = { 146static struct usb_driver ati_remote2_driver = {
144 .name = "ati_remote2", 147 .name = "ati_remote2",
@@ -147,6 +150,9 @@ static struct usb_driver ati_remote2_driver = {
147 .id_table = ati_remote2_id_table, 150 .id_table = ati_remote2_id_table,
148 .suspend = ati_remote2_suspend, 151 .suspend = ati_remote2_suspend,
149 .resume = ati_remote2_resume, 152 .resume = ati_remote2_resume,
153 .reset_resume = ati_remote2_reset_resume,
154 .pre_reset = ati_remote2_pre_reset,
155 .post_reset = ati_remote2_post_reset,
150 .supports_autosuspend = 1, 156 .supports_autosuspend = 1,
151}; 157};
152 158
@@ -715,6 +721,78 @@ static int ati_remote2_resume(struct usb_interface *interface)
715 return r; 721 return r;
716} 722}
717 723
724static int ati_remote2_reset_resume(struct usb_interface *interface)
725{
726 struct ati_remote2 *ar2;
727 struct usb_host_interface *alt = interface->cur_altsetting;
728 int r = 0;
729
730 if (alt->desc.bInterfaceNumber)
731 return 0;
732
733 ar2 = usb_get_intfdata(interface);
734
735 dev_dbg(&ar2->intf[0]->dev, "%s()\n", __func__);
736
737 mutex_lock(&ati_remote2_mutex);
738
739 r = ati_remote2_setup(ar2);
740 if (r)
741 goto out;
742
743 if (ar2->flags & ATI_REMOTE2_OPENED)
744 r = ati_remote2_submit_urbs(ar2);
745
746 if (!r)
747 ar2->flags &= ~ATI_REMOTE2_SUSPENDED;
748
749 out:
750 mutex_unlock(&ati_remote2_mutex);
751
752 return r;
753}
754
755static int ati_remote2_pre_reset(struct usb_interface *interface)
756{
757 struct ati_remote2 *ar2;
758 struct usb_host_interface *alt = interface->cur_altsetting;
759
760 if (alt->desc.bInterfaceNumber)
761 return 0;
762
763 ar2 = usb_get_intfdata(interface);
764
765 dev_dbg(&ar2->intf[0]->dev, "%s()\n", __func__);
766
767 mutex_lock(&ati_remote2_mutex);
768
769 if (ar2->flags == ATI_REMOTE2_OPENED)
770 ati_remote2_kill_urbs(ar2);
771
772 return 0;
773}
774
775static int ati_remote2_post_reset(struct usb_interface *interface)
776{
777 struct ati_remote2 *ar2;
778 struct usb_host_interface *alt = interface->cur_altsetting;
779 int r = 0;
780
781 if (alt->desc.bInterfaceNumber)
782 return 0;
783
784 ar2 = usb_get_intfdata(interface);
785
786 dev_dbg(&ar2->intf[0]->dev, "%s()\n", __func__);
787
788 if (ar2->flags == ATI_REMOTE2_OPENED)
789 r = ati_remote2_submit_urbs(ar2);
790
791 mutex_unlock(&ati_remote2_mutex);
792
793 return r;
794}
795
718static int __init ati_remote2_init(void) 796static int __init ati_remote2_init(void)
719{ 797{
720 int r; 798 int r;