From nobody Sun Feb 8 23:24:47 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 EE9163148AE for ; Mon, 2 Feb 2026 08:05:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770019556; cv=none; b=cdPRXFqFJBx9Ou0kDCkZ6oUEqnV0GR2JbsZeF6ZU0haUhm4nbrh2gSdR4qBst10ui8JrH3xZLRNLGwZ32e7dU4zPo2A/355QYVHZ1svyhwWuFKLS74eUYJSqvfz6M5+WK76nJn57sPVWlQ5laKoXFhQcIekzIdardRz7oAKj+IA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770019556; c=relaxed/simple; bh=V3jvzW11PyDhK8lR9wu29ch6YrkIS1se+hxEZ5/pSOE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tHSAzdOAPl9j91ewynN6r/SXiJFkWapOhxEPnTL5IhqKdvGrS79XwKxumsbzUs8CAK/4lIh1zsEN96uCzzfmasPEAPrANoGLWzX2XnAWoFB9BdNXDa24XY6o/QDJeqNL7ZOaE/1mmXfodPNR6DYdkkOiRzBwgTYVMJnGu9MQuLA= 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=cU+Ybqpl; arc=none smtp.client-ip=209.85.128.49 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cU+Ybqpl" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-47fedb7c68dso42101475e9.2 for ; Mon, 02 Feb 2026 00:05:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770019553; x=1770624353; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=L/sUdOuzlxCbV7DR0QBRghRBYHyuYh6kbLEBCenrgxA=; b=cU+YbqplKThuL0yFRunbnjXJqyHIKGc571XT99y8S3yHkpLx766BO4Bt7G8kK2hLOh VmrkCZvQNSai6sm/fiUFNIGDR/BVjbOITztPF98B60ZibsfY/jX0hBzxvG5ZTQucUAyA sw2N8oNy5PjkPJFpNHGhJju2cOCnYHQ3tbJ2249umQrVU3u6XyqO8cfLax9+Cl+5owao Vyr0Q3KrxqtkfH2tX9TVhtc0mdAdo09Nxjl7811STXVPXzIIGxkXMAcqX5kkvBeYGxaT 1EkZAAxS2f5Sel53Ttf6+8OcOVjg9tKBTTB8YzBLEHO/4McVO11tLa4ZcGA4EiLINwUT zTPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770019553; x=1770624353; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=L/sUdOuzlxCbV7DR0QBRghRBYHyuYh6kbLEBCenrgxA=; b=XLR8NgqVbQYPJPM9sIsD26+k5rtAcr+pIJtBJJvX/FzTA8JfLpZOUnNeLU2t6Gm65T DqsZpw5jRfjB7UoEaXWLZwFBzLufqB/W634id/B/bR2QBXSlKM8fhWFqtqMeriTw5N4i 94fbd9IFLap7MyAiv42fzm8t8UWZbLqe48ICVHhybAtK5SbNHO7SzNGoTknMY+0/1VID Oza+10IU9v0GG+zSQbBdpAhVGRtDD+2mhJIEQu9zA1TJcHCu/lVSXHSzS1DVSOc7EAGS 4b6cURz9qJFqj9qGbYIptB40HI4MCgJEZSnuGTaiNwf35Q1Y6uFYtjXchqfwI6TDSF4C RMqQ== X-Forwarded-Encrypted: i=1; AJvYcCX+Rxt0aYJnS/jYBrA++27TeRgguyB+M2AWgeEkf68uAc3yN+OIm5NVDa62Nzle++eFe6c+VYWr0YojPgA=@vger.kernel.org X-Gm-Message-State: AOJu0YwjWe0igl0ZVyOrpGaPZcwR+gbs6Ea5nTvD939lHm0Q5TcaeSpG x9VR9+hHzpFPZXrP0BzOSAM4JrGx0Wda/ZAtWhiU7k0TkT6s8g8m3RiC X-Gm-Gg: AZuq6aLuoWEvD079xdyM3XJDUpEoUwj/PnQWArzDU5wVWNQYejVCQYVgtt96SxGX+dy uNehOwxTXQGH/FGy5EBNqaPcoCWJSoP1QDhHs3EKEQ3Tw65pLLKVxIGfSZ3of08cK+hShOjcfzI NxWcWdRvk0vkdF8i9W8a9vwM+MaQi1uk41ZrwEgoOTucNLNNZ96ZmhtpbnzirQrNUX5mvSDxD3+ Yp2h/wVfKXvHQn8ExAH2a98Xr0YoPUSdUmiXARnTuPpMjOI3tnvy9tM1095gvXv5gld+bfc+HGR BA1EElMTpAmSI0MtkUT2yz4QahWkyvdfS/B4QSYaRfmG3NzbOPcyyh1wtaE6lONERJkzQ0/ENpS kUpwpQrXLcyMOJRME5bhebaezGlxhhYXUZayTGW2sYLLMgat9O2G1hFWnaeP5uzqpWk3sTXImmw t+ X-Received: by 2002:a05:600c:8116:b0:480:4ae2:def1 with SMTP id 5b1f17b1804b1-482db460140mr119083985e9.13.1770019553184; Mon, 02 Feb 2026 00:05:53 -0800 (PST) Received: from xeon ([188.163.112.49]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48066c37420sm475043365e9.9.2026.02.02.00.05.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Feb 2026 00:05:52 -0800 (PST) From: Svyatoslav Ryhel To: Greg Kroah-Hartman , Mikko Perttunen , Thierry Reding , Jonathan Hunter , Svyatoslav Ryhel Cc: linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 4/4] usb: phy: tegra: parametrize PORTSC1 register offset Date: Mon, 2 Feb 2026 10:05:26 +0200 Message-ID: <20260202080526.23487-5-clamor95@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260202080526.23487-1-clamor95@gmail.com> References: <20260202080526.23487-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The PORTSC1 register has a different offset in Tegra20 compared to Tegra30+, yet they share a crucial set of registers required for HSIC functionality. Reflect this register offset change in the SoC config. Signed-off-by: Svyatoslav Ryhel --- drivers/usb/phy/phy-tegra-usb.c | 17 ++++++----------- include/linux/usb/tegra_usb_phy.h | 2 ++ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-us= b.c index 812d99443180..00443a7beaeb 100644 --- a/drivers/usb/phy/phy-tegra-usb.c +++ b/drivers/usb/phy/phy-tegra-usb.c @@ -965,17 +965,10 @@ static int uhsic_phy_power_on(struct tegra_usb_phy *p= hy) writel_relaxed(val, base + USB_TXFILLTUNING); } =20 - if (phy->soc_config->has_hostpc) { - val =3D readl_relaxed(base + TEGRA30_USB_PORTSC1); - val &=3D ~(TEGRA_USB_PORTSC1_WKOC | TEGRA_USB_PORTSC1_WKDS | - TEGRA_USB_PORTSC1_WKCN); - writel_relaxed(val, base + TEGRA30_USB_PORTSC1); - } else { - val =3D readl_relaxed(base + TEGRA_USB_PORTSC1); - val &=3D ~(TEGRA_USB_PORTSC1_WKOC | TEGRA_USB_PORTSC1_WKDS | - TEGRA_USB_PORTSC1_WKCN); - writel_relaxed(val, base + TEGRA_USB_PORTSC1); - } + val =3D readl_relaxed(base + phy->soc_config->portsc1_offset); + val &=3D ~(TEGRA_USB_PORTSC1_WKOC | TEGRA_USB_PORTSC1_WKDS | + TEGRA_USB_PORTSC1_WKCN); + writel_relaxed(val, base + phy->soc_config->portsc1_offset); =20 val =3D tegra_hsic_readl(phy, UHSIC_PADS_CFG0); val &=3D ~UHSIC_TX_RTUNEN; @@ -1472,6 +1465,7 @@ static const struct tegra_phy_soc_config tegra20_soc_= config =3D { .uhsic_registers_offset =3D 0, .uhsic_tx_rtune =3D 0, /* 40 ohm */ .uhsic_pts_value =3D 0, /* UTMI */ + .portsc1_offset =3D TEGRA_USB_PORTSC1, }; =20 static const struct tegra_phy_soc_config tegra30_soc_config =3D { @@ -1483,6 +1477,7 @@ static const struct tegra_phy_soc_config tegra30_soc_= config =3D { .uhsic_registers_offset =3D 0x400, .uhsic_tx_rtune =3D 8, /* 50 ohm */ .uhsic_pts_value =3D TEGRA_USB_HOSTPC1_DEVLC_PTS_HSIC, + .portsc1_offset =3D TEGRA30_USB_PORTSC1, }; =20 static const struct of_device_id tegra_usb_phy_id_table[] =3D { diff --git a/include/linux/usb/tegra_usb_phy.h b/include/linux/usb/tegra_us= b_phy.h index 81d9f22e58b5..57e22aae6247 100644 --- a/include/linux/usb/tegra_usb_phy.h +++ b/include/linux/usb/tegra_usb_phy.h @@ -28,6 +28,7 @@ struct gpio_desc; * comparing to Tegra20 by 0x400, since Tegra20 has no UTMIP on PHY2 * uhsic_tx_rtune: fine tuned 50 Ohm termination resistor for NMOS/PMOS dr= iver * uhsic_pts_value: parallel transceiver select enumeration value + * portsc1_offset: register offset of PORTSC1 */ =20 struct tegra_phy_soc_config { @@ -39,6 +40,7 @@ struct tegra_phy_soc_config { u32 uhsic_registers_offset; u32 uhsic_tx_rtune; u32 uhsic_pts_value; + u32 portsc1_offset; }; =20 struct tegra_utmip_config { --=20 2.51.0