Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp176766pxf; Wed, 10 Mar 2021 03:43:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJyzETVb7G8aE4eTB+klkPd6YSm82MC5kM7xftmC24QY5FynilkQimahwY4iImbCH6oydRzV X-Received: by 2002:aa7:cdcf:: with SMTP id h15mr2741437edw.28.1615376622750; Wed, 10 Mar 2021 03:43:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615376622; cv=none; d=google.com; s=arc-20160816; b=WayWI/j/ZguR8wv18yjOmRx280NgIUsNPchp/DMnyDFBaIVORAh4rOK/z10rpVdyPE 2NG/GflZUFF0Cmj+FoEk+6D5hZ8ee2D6H2EOY1TtSx4/zZp/xN/guD6tgnE1N1erBWUv 7tzI/JeValSjjlkG3ejcqu6i3QZuY643qKqPlzEYsZGkkfDp1aVS95guOmKNnEIFjquP ATKnTi4i1nikdOtMkPjaGJp1QuViEdjEjrkQY0AN+MGuEpOXAwqTDrSGdlzF3/3tlbQH uW9zDDRQUD283Y9TSFE7T/7tNyoZbwiLn09FQOkFCUqp4Tpls+C7LsALbIYxsQAEK/lB ePpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=mRJB1gDjhVTPTAhhEElBVhkRFfh/+xmmSXzU5q5yPWU=; b=xAWrEQPaGgXFdu5zugQF1B2i90HRV4GcGbgpk6uciQHay+SJw+1tQ/+cpwJLr1kTt2 Q1TItwvoucgTqq18z0a7TejnMfxmJAiSeYHLnl9QEDghpX0dM4iC++Qxhx1PzVjcvBfi Wbl2tYOEyPfyEzvr0RHvXldDIlr5Y833JY4JG2F6ooIQKXJlIhSQEUkxgQCTIsgQh/dr 4RHy4IqkGRMWzD1TQvbsdi0dgbsiSa3MGgCufRCmmpAdTgXLpx4kzAweoivAB6ZmvHF6 inIdzVsZbKF+Nhb3rqjNyC0U2HjvbI9OtO5u1jSTJBQi9uSvaDXxeetktwahnMUScS5M jX7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k18si11292909ejp.292.2021.03.10.03.43.20; Wed, 10 Mar 2021 03:43:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231517AbhCJLmT (ORCPT + 99 others); Wed, 10 Mar 2021 06:42:19 -0500 Received: from alexa-out.qualcomm.com ([129.46.98.28]:63318 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230214AbhCJLmI (ORCPT ); Wed, 10 Mar 2021 06:42:08 -0500 Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 10 Mar 2021 03:42:07 -0800 X-QCInternal: smtphost Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/AES256-SHA; 10 Mar 2021 03:42:05 -0800 X-QCInternal: smtphost Received: from gubbaven-linux.qualcomm.com ([10.206.64.32]) by ironmsg01-blr.qualcomm.com with ESMTP; 10 Mar 2021 17:11:39 +0530 Received: by gubbaven-linux.qualcomm.com (Postfix, from userid 2365015) id 7098820F0F; Wed, 10 Mar 2021 17:11:38 +0530 (IST) From: Venkata Lakshmi Narayana Gubba To: marcel@holtmann.org, johan.hedberg@gmail.com Cc: mka@chromium.org, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, hemantg@codeaurora.org, linux-arm-msm@vger.kernel.org, bgodavar@codeaurora.org, rjliao@codeaurora.org, hbandi@codeaurora.org, abhishekpandit@chromium.org, Venkata Lakshmi Narayana Gubba Subject: [RFC PATCH v1] Bluetooth: hci_qca: Add device_may_wakeup support Date: Wed, 10 Mar 2021 17:11:36 +0530 Message-Id: <1615376496-13577-1-git-send-email-gubbaven@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Added device_may_wakeup() support. Signed-off-by: Venkata Lakshmi Narayana Gubba --- drivers/bluetooth/hci_qca.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index de36af6..73af901 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -1571,6 +1571,20 @@ static void qca_cmd_timeout(struct hci_dev *hdev) mutex_unlock(&qca->hci_memdump_lock); } +static bool qca_prevent_wake(struct hci_dev *hdev) +{ + struct hci_uart *hu = hci_get_drvdata(hdev); + bool wakeup; + + /* UART driver handles the interrupt from BT SoC.So we need to use + * device handle of UART driver to get the status of device may wakeup. + */ + wakeup = device_may_wakeup(hu->serdev->ctrl->dev.parent); + bt_dev_dbg(hu->hdev, "wakeup status : %d", wakeup); + + return !wakeup; +} + static int qca_wcn3990_init(struct hci_uart *hu) { struct qca_serdev *qcadev; @@ -1721,6 +1735,7 @@ static int qca_setup(struct hci_uart *hu) qca_debugfs_init(hdev); hu->hdev->hw_error = qca_hw_error; hu->hdev->cmd_timeout = qca_cmd_timeout; + hu->hdev->prevent_wake = qca_prevent_wake; } else if (ret == -ENOENT) { /* No patch/nvm-config found, run with original fw/config */ set_bit(QCA_ROM_FW, &qca->flags); -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation