From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754536AbbFBBPO (ORCPT ); Mon, 1 Jun 2015 21:15:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33581 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752272AbbFBBOv (ORCPT ); Mon, 1 Jun 2015 21:14:51 -0400 From: Laura Abbott To: Marcel Holtmann Cc: Laura Abbott , Alan Stern , Takashi Iwai , Oliver Neukum , Ming Lei , "David S. Miller" , Johan Hedberg , "Rafael J. Wysocki" , "Gustavo F. Padovan" , , Linux Kernel Mailing List , USB list , netdev Subject: [PATCH 2/2] Bluetooth: btusb: Add reset_resume function Date: Mon, 1 Jun 2015 18:14:42 -0700 Message-Id: <1433207682-15064-2-git-send-email-labbott@fedoraproject.org> In-Reply-To: <1433207682-15064-1-git-send-email-labbott@fedoraproject.org> References: <1433207682-15064-1-git-send-email-labbott@fedoraproject.org> In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some USB hubs may lose power across suspend/resume. Add a reset_resume callback to properly reset those bluetoot devices. Signed-off-by: Laura Abbott --- Now the setup function is called again with the HCI_RESET_RESUME flag set. The various functions could then use that RESET_RESUME flag to determine if loading the firmware is appropriate or not. --- drivers/bluetooth/btusb.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 3c10d4d..34884cf 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -3382,6 +3382,21 @@ done: return err; } + +static int btusb_reset_resume(struct usb_interface *intf) +{ + struct btusb_data *data = usb_get_intfdata(intf); + struct hci_dev *hdev = data->hdev; + int ret; + + BT_DBG("intf %p", intf); + + ret = btusb_resume(intf); + if (ret) + return ret; + + return hci_reset_resume_dev(hdev); +} #endif static struct usb_driver btusb_driver = { @@ -3391,6 +3406,7 @@ static struct usb_driver btusb_driver = { #ifdef CONFIG_PM .suspend = btusb_suspend, .resume = btusb_resume, + .reset_resume = btusb_reset_resume, #endif .id_table = btusb_table, .supports_autosuspend = 1, -- 2.4.1