From patchwork Fri Sep 4 08:15:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunfeng Yun X-Patchwork-Id: 11756241 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C213138C for ; Fri, 4 Sep 2020 08:17:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 34B7E20791 for ; Fri, 4 Sep 2020 08:17:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="WZAyFRkq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729833AbgIDIRq (ORCPT ); Fri, 4 Sep 2020 04:17:46 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:22139 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729744AbgIDIRo (ORCPT ); Fri, 4 Sep 2020 04:17:44 -0400 X-UUID: d66e97dddf924caf96f81c241837bf5f-20200904 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=8rRrbCmdA3reTEcnRumgB1k/g3lTeehQQDEOoft6l6Y=; b=WZAyFRkqGESgqiNjzJnb3RA0PdEM+n1eHQWK9FkN19RiEpp1bEQj6M5mwT7nxxfGsGbAzkU2mx1jhS3mGqNUOqyCxnVOBGKBzS0Z0ilzFnndbY1nMHlIGOVLOKtA5gBI2feKosYfZzppVebNq/uXTgRRw7TUseTXks4c6INc1aY=; X-UUID: d66e97dddf924caf96f81c241837bf5f-20200904 Received: from mtkcas35.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1262005186; Fri, 04 Sep 2020 16:17:32 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 4 Sep 2020 16:17:30 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 4 Sep 2020 16:17:29 +0800 From: Chunfeng Yun To: Zhanyong Wang CC: , , , , Chunfeng Yun Subject: [RFC PATCH v2 2/4] usb: xhci-mtk: add mt8192 wakeup Date: Fri, 4 Sep 2020 16:15:38 +0800 Message-ID: <1599207340-4673-2-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1599207340-4673-1-git-send-email-chunfeng.yun@mediatek.com> References: <1599207340-4673-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 2EBBA91619F7DF239197DD7B7CD12799BA62E7C589CD9089C0DA839B21AE0BD52000:8 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Zhanyong Wang need to add wakeup solution as V3 since not support presently. Signed-off-by: Zhanyong Wang Signed-off-by: Chunfeng Yun --- v2: no changes --- drivers/usb/host/xhci-mtk.c | 9 +++++++++ 1 file changed, 9 insertions(+) mode change 100644 => 100755 drivers/usb/host/xhci-mtk.c diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c old mode 100644 new mode 100755 index 4311d4c..d95221f --- a/drivers/usb/host/xhci-mtk.c +++ b/drivers/usb/host/xhci-mtk.c @@ -68,9 +68,13 @@ #define SSC_IP_SLEEP_EN BIT(4) #define SSC_SPM_INT_EN BIT(1) +/* mt8192 etc */ +#define SSC_IP_SLEEP_EN_V3 BIT(6) + enum ssusb_uwk_vers { SSUSB_UWK_V1 = 1, SSUSB_UWK_V2, + SSUSB_UWK_V3, }; static int xhci_mtk_host_enable(struct xhci_hcd_mtk *mtk) @@ -305,6 +309,11 @@ static void usb_wakeup_ip_sleep_set(struct xhci_hcd_mtk *mtk, bool enable) msk = SSC_IP_SLEEP_EN | SSC_SPM_INT_EN; val = enable ? msk : 0; break; + case SSUSB_UWK_V3: + reg = mtk->uwk_reg_base + PERI_SSUSB_SPM_CTRL; + msk = SSC_IP_SLEEP_EN_V3 | SSC_SPM_INT_EN; + val = enable ? msk : 0; + break; default: return; }