Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp178537rdb; Mon, 22 Jan 2024 00:00:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJ3gU57+81vPge0GKFGRH+VgRSVLPKsjcBY0y2UV5LqNXLcdBdwzdYcCJZqrlQcbPfbTgi X-Received: by 2002:a05:6a00:ad1:b0:6da:e711:7836 with SMTP id c17-20020a056a000ad100b006dae7117836mr1691605pfl.54.1705910453878; Mon, 22 Jan 2024 00:00:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705910453; cv=pass; d=google.com; s=arc-20160816; b=Y+2yw8QSr1myUJcNJxwvs+PEBeEq8fwQXwXYWPUqMAjPxrCV/ktscTuNUguC0Ocqso eg6gTjNY5QPToDxQY4AonFNyBWR1qGa8bj8mSGxR0R1vyxd5Kttbbzgg27I49HBIFeZc uIAXiNLzBV0KEQZBxZ0fpSGCZbSlZR/cTAF9QiMFnD3bFiVS7lsZnrN1Gg05vREEkvIX 0axFoepGjhlZDwUHfYW3j44+2Uip5KUCFNda82JpnLHGDLcppoHT+/ylFuCgD7DytBwj ktFzCl3hypP7BWzp5sf6oZtBtkcn0uyztSb8k02y2t0Dd6TWUQ3S0S8qoZhht28t8dxe p5bA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=9nVtX6sIVg5JIaktwIHIF/8UXqbp4BOA0LlFNe3QMMA=; fh=rFV7/2O4wbxzm0aUalSCqjMnNoN1MEC3kFXk9A8SACA=; b=ouIAD/PtFKvxvctw0kQH5SbjdRhrs0hXiq0oYXs77yVruyO/hgtt1SfPGM7rAcTEBP 5+uyiVEtQrhH+4fQeDeNDuRhNCiQS5P3PqRFwtZYirQt7nZpECwJZp5mjUR4tk6vU8i7 ZZ4hCEp0Q9B4Z71x8bzEaO+o1sqlTLsbDQcFFrqEcDoJPjR9VzcVpMIrkqLELIJYq07U Ie8d7oVOgxpjcUEks2XtahsG+O8aJH845rLffXed7eNq9IL2EKwY8Z/vGY8WPl3od89C kXXXnPTUj8oXX14oNhGmrEZIMmmOssEgrMzy3hAgANHWifhEKeZW2OgAviOoel71hoOl g9gQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=W3mrroVC; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-32481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32481-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t11-20020a65608b000000b005cdfa675225si7662491pgu.833.2024.01.22.00.00.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 00:00:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=W3mrroVC; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-32481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32481-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8DF7D288E08 for ; Mon, 22 Jan 2024 07:59:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 30991182DC; Mon, 22 Jan 2024 07:58:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="W3mrroVC" Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FD3521357; Mon, 22 Jan 2024 07:58:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705910325; cv=none; b=bi7y/zlpO116FxAUuvkRZtMiEpgkLB9/DSnRtyDk6u+FuKNSpTy2lTHX8tG26IGYqP6pYe6bfxTA/bojls2p6xUCJz7kmJKtsewpEDoBE9gXIaxoFRiQrFFNv3NbWOyntd8RVlD/Z4uaO8Oi6Eq+6tDSQgGjk6l2swGvsDKhu70= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705910325; c=relaxed/simple; bh=+3IAS6+W/qcg3J4V0kzEHae3ZXvyn9+YYU9OGB9iGxY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=q0BhLHTsbZeIGrtPcu77AnvCZwoiXjEs1ZZomAPxo/Z7Fs9mRqeZPYIshi/hgNaBfjKLJ7H1St9V0Lw1rkuSpsSPUCDd4fatCz9jQevgTMwLCH+D3VJYuiBXGJOufZBry/abZp4zd2Cpsb44E0iyjO+oMqekDOJ3+fh98Pkdx78= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=W3mrroVC; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-40e9d4ab5f3so31721505e9.2; Sun, 21 Jan 2024 23:58:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705910322; x=1706515122; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=9nVtX6sIVg5JIaktwIHIF/8UXqbp4BOA0LlFNe3QMMA=; b=W3mrroVCVzq6cHnNodR1YKWta7bOeJmp4f9429iusQzgYwPy4OXxPqmbb3u0qR+eQI ZgYx1k46HU/WlFpHpAvpmCDs9gVhQOI9gSrt4CpenNdNNl7Ss1508FsWA4Wc2C2BUvUX fSufYx4o3mPXeHE74kZ4zH+0t64EOt4FHzYuwp95JFFa8Gs3s8CB8cCXOvZWuo3qTtUs wGFpNTUqM88/SPIvy/35YF3VZe2UESINGh3y5s9pp2HhiWRUAY3qv9xVuYa/TFs8te7c MFfMVhPYj2zo/8nzD16BzIi1bZvICag3AIig9OzI1gzSOiNNu6kN59LNT0PUbbC8hKk8 6W+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705910322; x=1706515122; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9nVtX6sIVg5JIaktwIHIF/8UXqbp4BOA0LlFNe3QMMA=; b=LZ9/ZKGCaXzUBc8bKFwKoM95HgAHxssSbnjhQwKDFdidOumBw3T/w1zX5njeexq/hn RiOPKy4DMxfQCGmJtXtAuumtqPlvJUVe3J3HZBs5LmLziofbrvNyW2nxsgpEndZatbez oT2iRyLqpSuEM9wYGMNrwij2degmpjWXnklLsMWPFscjJO8DzXGzdgLooLkI4EJDbRoY VRpDuxFykeCe78PIFKmG2/gVxTckR9Ijfzp+RJWPip5YFsCDgzqWIIHMoT/gYdV/Y7xo WR011mHpr1Q19NN22NP3EZtTCKj2lvjIzWgPwFWgq8jt284KxzGGSnIHiQeNjjJ+ha5U JrHA== X-Gm-Message-State: AOJu0YwJ84dq9Uau6+9tUool4iIIxDCUILEh5EhNa+7HuPkn6ETGPoGK G7Ri7cRGPzmFvJbB2qeygX2HgkyipHqcxBXDB87ph4jWPsSih3snvkq+rbQg X-Received: by 2002:a05:600c:2353:b0:40e:8999:6c45 with SMTP id 19-20020a05600c235300b0040e89996c45mr2020997wmq.83.1705910321514; Sun, 21 Jan 2024 23:58:41 -0800 (PST) Received: from [192.168.2.177] ([207.188.161.188]) by smtp.gmail.com with ESMTPSA id l34-20020a05600c1d2200b0040e89ade84bsm17815626wms.4.2024.01.21.23.58.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 21 Jan 2024 23:58:40 -0800 (PST) Message-ID: <5bf2910f-c184-4681-a474-69bea8ee7b71@gmail.com> Date: Mon, 22 Jan 2024 08:58:39 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] usb: mtu3: Add MT8195 MTU3 ip-sleep wakeup support Content-Language: en-US, ca-ES, es-ES To: AngeloGioacchino Del Regno , chunfeng.yun@mediatek.com Cc: gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com References: <20240112133222.240038-1-angelogioacchino.delregno@collabora.com> <20240112133222.240038-2-angelogioacchino.delregno@collabora.com> From: Matthias Brugger Autocrypt: addr=matthias.bgg@gmail.com; keydata= xsFNBFP1zgUBEAC21D6hk7//0kOmsUrE3eZ55kjc9DmFPKIz6l4NggqwQjBNRHIMh04BbCMY fL3eT7ZsYV5nur7zctmJ+vbszoOASXUpfq8M+S5hU2w7sBaVk5rpH9yW8CUWz2+ZpQXPJcFa OhLZuSKB1F5JcvLbETRjNzNU7B3TdS2+zkgQQdEyt7Ij2HXGLJ2w+yG2GuR9/iyCJRf10Okq gTh//XESJZ8S6KlOWbLXRE+yfkKDXQx2Jr1XuVvM3zPqH5FMg8reRVFsQ+vI0b+OlyekT/Xe 0Hwvqkev95GG6x7yseJwI+2ydDH6M5O7fPKFW5mzAdDE2g/K9B4e2tYK6/rA7Fq4cqiAw1+u EgO44+eFgv082xtBez5WNkGn18vtw0LW3ESmKh19u6kEGoi0WZwslCNaGFrS4M7OH+aOJeqK fx5dIv2CEbxc6xnHY7dwkcHikTA4QdbdFeUSuj4YhIZ+0QlDVtS1QEXyvZbZky7ur9rHkZvP ZqlUsLJ2nOqsmahMTIQ8Mgx9SLEShWqD4kOF4zNfPJsgEMB49KbS2o9jxbGB+JKupjNddfxZ HlH1KF8QwCMZEYaTNogrVazuEJzx6JdRpR3sFda/0x5qjTadwIW6Cl9tkqe2h391dOGX1eOA 1ntn9O/39KqSrWNGvm+1raHK+Ev1yPtn0Wxn+0oy1tl67TxUjQARAQABzSlNYXR0aGlhcyBC cnVnZ2VyIDxtYXR0aGlhcy5iZ2dAZ21haWwuY29tPsLBkgQTAQIAPAIbAwYLCQgHAwI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zMOD4cQ82T a7eGvPWPeXauWJDLVR9jHtWT9Ot3BQgmApLxACvwvD1a69jaFKov28SPHxUCQ9Y1Y/Ct In-Reply-To: <20240112133222.240038-2-angelogioacchino.delregno@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/01/2024 14:32, AngeloGioacchino Del Regno wrote: > Add support for the ip-sleep wakeup functionality on the three MTU3 > controllers found on the MT8195 SoC. > > Signed-off-by: AngeloGioacchino Del Regno > --- > drivers/usb/mtu3/mtu3_host.c | 31 +++++++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > > diff --git a/drivers/usb/mtu3/mtu3_host.c b/drivers/usb/mtu3/mtu3_host.c > index 9f2be22af844..85f49e00e8db 100644 > --- a/drivers/usb/mtu3/mtu3_host.c > +++ b/drivers/usb/mtu3/mtu3_host.c > @@ -34,6 +34,19 @@ > #define WC0_SSUSB0_CDEN BIT(6) > #define WC0_IS_SPM_EN BIT(1) > > +/* mt8195 */ > +#define PERI_WK_CTRL0_8195 0x04 > +#define WC0_IS_P_95 BIT(30) /* polarity */ > +#define WC0_IS_C_95(x) ((u32)(((x) & 0x7) << 27)) > +#define WC0_IS_EN_P3_95 BIT(26) > +#define WC0_IS_EN_P2_95 BIT(25) > +#define WC0_IS_EN_P1_95 BIT(24) Not used, shouldn't we drop that? Regards, Matthias > + > +#define PERI_WK_CTRL1_8195 0x20 > +#define WC1_IS_C_95(x) ((u32)(((x) & 0xf) << 28)) > +#define WC1_IS_P_95 BIT(12) > +#define WC1_IS_EN_P0_95 BIT(6) > + > /* mt2712 etc */ > #define PERI_SSUSB_SPM_CTRL 0x0 > #define SSC_IP_SLEEP_EN BIT(4) > @@ -44,6 +57,9 @@ enum ssusb_uwk_vers { > SSUSB_UWK_V2, > SSUSB_UWK_V1_1 = 101, /* specific revision 1.01 */ > SSUSB_UWK_V1_2, /* specific revision 1.02 */ > + SSUSB_UWK_V1_3, /* mt8195 IP0 */ > + SSUSB_UWK_V1_5 = 105, /* mt8195 IP2 */ > + SSUSB_UWK_V1_6, /* mt8195 IP3 */ > }; > > /* > @@ -70,6 +86,21 @@ static void ssusb_wakeup_ip_sleep_set(struct ssusb_mtk *ssusb, bool enable) > msk = WC0_SSUSB0_CDEN | WC0_IS_SPM_EN; > val = enable ? msk : 0; > break; > + case SSUSB_UWK_V1_3: > + reg = ssusb->uwk_reg_base + PERI_WK_CTRL1_8195; > + msk = WC1_IS_EN_P0_95 | WC1_IS_C_95(0xf) | WC1_IS_P_95; > + val = enable ? (WC1_IS_EN_P0_95 | WC1_IS_C_95(0x1)) : 0; > + break; > + case SSUSB_UWK_V1_5: > + reg = ssusb->uwk_reg_base + PERI_WK_CTRL0_8195; > + msk = WC0_IS_EN_P2_95 | WC0_IS_C_95(0x7) | WC0_IS_P_95; > + val = enable ? (WC0_IS_EN_P2_95 | WC0_IS_C_95(0x1)) : 0; > + break; > + case SSUSB_UWK_V1_6: > + reg = ssusb->uwk_reg_base + PERI_WK_CTRL0_8195; > + msk = WC0_IS_EN_P3_95 | WC0_IS_C_95(0x7) | WC0_IS_P_95; > + val = enable ? (WC0_IS_EN_P3_95 | WC0_IS_C_95(0x1)) : 0; > + break; > case SSUSB_UWK_V2: > reg = ssusb->uwk_reg_base + PERI_SSUSB_SPM_CTRL; > msk = SSC_IP_SLEEP_EN | SSC_SPM_INT_EN;