Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp247969rdb; Mon, 22 Jan 2024 03:00:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGJ2w5yU9h0J5SACv1le/t0zuh8y4GaZJxFPj6HUB7VV12Bvm4/tG1q+efE+AmUnB5+dD1 X-Received: by 2002:a05:600c:524e:b0:40e:a982:62d9 with SMTP id fc14-20020a05600c524e00b0040ea98262d9mr1430579wmb.113.1705921224662; Mon, 22 Jan 2024 03:00:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705921224; cv=pass; d=google.com; s=arc-20160816; b=mHNuwlZ5QGMhIUkLGmHtp5lKRbVog/nsZ+uze1W1F/jny7h09XM+6PYJQxjG36kE39 3U+coZOl6k/V+GOE8M4erURkYN8SsVuOg3B4V/PH0DZkwqZNYq0skyFh6d5KfbSQ3sxy AOwk3kNJKGyYbVWu2gK6+XJLA5eOdq2/e/CXbBCsir/dHJVhqJiBz5bDq7LAMUP49WbN U6BHXVhLieDECBNrD5zJkmKw9asf/EaD4qKPtRnrt0Du1LhTjesgbD/IWD4ShL3nSHvr f3bAy7Jj01/aj6n41flFjGn2pmNxzJ8UDOSfDy4ko9D4um3hKPdVoWfOJYg7o+NL5faO /BDg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=kk5etcf9dUcnm7dWGL+iuziMYTZmGe/tLxwpcuiJuSE=; fh=ly9Gc/XfHOZqHalRZckBcxudBEChPYbyyhfirD7ZCQ8=; b=uEqqFRnXvLUzaEYSHfbKnOJrRRZkOXfo7430TtDYDBX2Nv5rE6WAAx9gnLsP/45gIv kY+QTII3VrirjZXm7WPWmn2i9o/FAn0DOXsq9D0esJSc1f7R5kWpDWJzGK5iZDmU5OIn 0P9Pa4Z4qYr6X2lDK1a5aJ1ozlR9Y+P4BT7lMW7wDVzx5NdKOfPrX1Da3Od6KOeOTaED GH1iscu2Z216FF9nf5wertWMTDckqzs5r4MIIsVtzRxcM3rJJO03tdA5cnTz/aYLiOyE G+8KXwyJ3VVBpOWOcckx5bPyXquDYTcKJi11fZezNw8TaYFp5xgrQN1fvDYkZocSaclP Rtug== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=cYEV9FRW; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-32802-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32802-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id r6-20020a056402234600b0055c44dbd072si721460eda.210.2024.01.22.03.00.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 03:00:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32802-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=cYEV9FRW; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-32802-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32802-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6AA2E1F26FE6 for ; Mon, 22 Jan 2024 11:00:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B41483A8C9; Mon, 22 Jan 2024 11:00:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="cYEV9FRW" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 651D616439; Mon, 22 Jan 2024 11:00:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705921211; cv=none; b=A0hwMJvQGbDOeD+/t4+YmRersm1VjnhzueAc3LhujW/b2CKdCB2XV2o2BxNu921LPvnc5ea7O+xse7UVrfh7EqKbRmxzuDG1FHaHWW35Ugdr3xb/z5TrzW3fPLU4M+S/Jqz4VogmpTzb9Xo+YyulqDsaCEPvdZqqhL/sgYIn0Kc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705921211; c=relaxed/simple; bh=G6ENMbYnSExmBsiKgUE0XhOt+HRgA6TcZEvQKVF8gYI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GnwYnc8yEey1oNiQfoe66nmlQBv92Y76nvgcKld80XN0vv1xAE3csrWeH0fROp7vVeTRnaYcPSdHjU3gMyQeQPa2rhDUuhhr05Bl3Tdm9NH3i5Rd2tSxyCSoi/cn3AZS8jX7uGyLTmrEqfHqFLcJrUw4vWMm1iZ7I6SNOGvyyQY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=cYEV9FRW; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1705921208; bh=G6ENMbYnSExmBsiKgUE0XhOt+HRgA6TcZEvQKVF8gYI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=cYEV9FRWZv8f/lwYnr1LE0PtXwV207uuNisL4vf0YddAd0RXp9RHIaf4/q/wCjtbU FpV8G8RlBORFfIcTuP9PQuqDPg7R4hvv80O9bWsBOFFfutvgLvOJOxxsqNKUi0QUZ8 nFM1eza4JYtCyjVwSkYtNgDsmUOuEOxJJNcTe86FXUkHGTYoag+8ANXsHSYmPL6qPN LgnKUB1Kb5BVP9JKW5fCFqAcb2a5xB6W+dsWZ/28tqIKK3WXGgTt3CvgM35UdYyrsm jB+Szy8JSGGNe/OvQwDibrr2pcqeExSJ/JUKQBSQmEKV6trMa5MzqsCWqTfEocXr/X MYq3Tl12vQK0w== Received: from [100.113.186.2] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id E8A613781FDF; Mon, 22 Jan 2024 11:00:07 +0000 (UTC) Message-ID: <2f8d6e4e-ba01-4a87-94d6-65421db765ed@collabora.com> Date: Mon, 22 Jan 2024 12:00:07 +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 To: Matthias Brugger , 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> <5bf2910f-c184-4681-a474-69bea8ee7b71@gmail.com> From: AngeloGioacchino Del Regno In-Reply-To: <5bf2910f-c184-4681-a474-69bea8ee7b71@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Il 22/01/24 08:58, Matthias Brugger ha scritto: > > > 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? > Hey Matthias! Thanks for catching that - yeah that bit exists, but cannot be used in MTU3, so it has to be dropped. Sending a v2 in a jiffy....... or two. :-) Cheers, Angelo > 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;