aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/rtsx_usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/rtsx_usb.c')
-rw-r--r--drivers/mfd/rtsx_usb.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/mfd/rtsx_usb.c b/drivers/mfd/rtsx_usb.c
index b53b9d46cc45..141ea52c46e3 100644
--- a/drivers/mfd/rtsx_usb.c
+++ b/drivers/mfd/rtsx_usb.c
@@ -67,7 +67,7 @@ static int rtsx_usb_bulk_transfer_sglist(struct rtsx_ucr *ucr,
67 ucr->sg_timer.expires = jiffies + msecs_to_jiffies(timeout); 67 ucr->sg_timer.expires = jiffies + msecs_to_jiffies(timeout);
68 add_timer(&ucr->sg_timer); 68 add_timer(&ucr->sg_timer);
69 usb_sg_wait(&ucr->current_sg); 69 usb_sg_wait(&ucr->current_sg);
70 del_timer(&ucr->sg_timer); 70 del_timer_sync(&ucr->sg_timer);
71 71
72 if (act_len) 72 if (act_len)
73 *act_len = ucr->current_sg.bytes; 73 *act_len = ucr->current_sg.bytes;
@@ -644,14 +644,14 @@ static int rtsx_usb_probe(struct usb_interface *intf,
644 if (ret) 644 if (ret)
645 goto out_init_fail; 645 goto out_init_fail;
646 646
647 /* initialize USB SG transfer timer */
648 setup_timer(&ucr->sg_timer, rtsx_usb_sg_timed_out, (unsigned long) ucr);
649
647 ret = mfd_add_devices(&intf->dev, usb_dev->devnum, rtsx_usb_cells, 650 ret = mfd_add_devices(&intf->dev, usb_dev->devnum, rtsx_usb_cells,
648 ARRAY_SIZE(rtsx_usb_cells), NULL, 0, NULL); 651 ARRAY_SIZE(rtsx_usb_cells), NULL, 0, NULL);
649 if (ret) 652 if (ret)
650 goto out_init_fail; 653 goto out_init_fail;
651 654
652 /* initialize USB SG transfer timer */
653 init_timer(&ucr->sg_timer);
654 setup_timer(&ucr->sg_timer, rtsx_usb_sg_timed_out, (unsigned long) ucr);
655#ifdef CONFIG_PM 655#ifdef CONFIG_PM
656 intf->needs_remote_wakeup = 1; 656 intf->needs_remote_wakeup = 1;
657 usb_enable_autosuspend(usb_dev); 657 usb_enable_autosuspend(usb_dev);
@@ -687,9 +687,15 @@ static int rtsx_usb_suspend(struct usb_interface *intf, pm_message_t message)
687 dev_dbg(&intf->dev, "%s called with pm message 0x%04u\n", 687 dev_dbg(&intf->dev, "%s called with pm message 0x%04u\n",
688 __func__, message.event); 688 __func__, message.event);
689 689
690 /*
691 * Call to make sure LED is off during suspend to save more power.
692 * It is NOT a permanent state and could be turned on anytime later.
693 * Thus no need to call turn_on when resunming.
694 */
690 mutex_lock(&ucr->dev_mutex); 695 mutex_lock(&ucr->dev_mutex);
691 rtsx_usb_turn_off_led(ucr); 696 rtsx_usb_turn_off_led(ucr);
692 mutex_unlock(&ucr->dev_mutex); 697 mutex_unlock(&ucr->dev_mutex);
698
693 return 0; 699 return 0;
694} 700}
695 701