From nobody Mon Sep 28 23:07:56 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (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 3C5ED3B52FF; Sat, 15 Aug 2026 09:14:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786785285; cv=none; b=g46UQ9Pv0XZZYK7S849orSdAvqeSR7WIoQTrxh9gdEKW7Q0tQKPILI6F/NsQCrHgR0y+IfIPfRlBW5ZbuVFiLS6r9z3xt3ZfrXOEf9A7dgZITKmQGdlgDL+SegaibjvKq9vJxUeL9jW3fsyU/dY5SfVaf2rBPmPaS5fMSE5Go70= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786785285; c=relaxed/simple; bh=ftguCxpMbqswlMtPaAr05z4e0h43CRs5eW3ROo1Rx98=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tdKnpZkgdctsf29MnM+yoN5S21f1uSphqPaEeoRS+U6HRGfrLYKfMgZasHwY1sKcmMUqpvyZFlEbIEdhfsXWT1s4sWjsibVvm68JcoGWN0DTtprnQV7v+/PQJl/ksWkvNFHR7jMyl0cXWvlFQ+C6gqd+SgwTBPfOzVtV47ZOwAA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=fEA1VMcd; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="fEA1VMcd" Received: from mail01.layka.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id B746D88363; Sat, 15 Aug 2026 11:14:35 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id WHNjcn3bikdF; Sat, 15 Aug 2026 11:14:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1786785274; bh=ftguCxpMbqswlMtPaAr05z4e0h43CRs5eW3ROo1Rx98=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fEA1VMcd7RuNFJ2+UqbKAEnCVhr1ZHJp5EMmHeGHcTxHngXqDCk3RlSyRCuu83wEH ds77pk2QPNRl5mdUJ85DPDgQTXyXwNOju1HdMUh1VYt49Td0MzNSO1hNkWnn4DOxHy duCPHSH2Yz+i1xL+tnPNh0pupm4NO7kaC88x0AzjXQSjFPReKHflNjxGUdzHFBIljm G++oyRa+GdsA0W/aD+M0zghSjsp4he/rCvCo91LplsqNzIsXoGakVOPv0x62w78TUW Z4XDr+IrjgfKrXfWmzsBRgYndaqCi7+Fk3TLEshSiYb3sQc2hPcIbgIfBCLshSCXwF VQlXWcwpylqOw== From: Rustam Adilov To: Vinod Koul , Neil Armstrong , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanley Chang , Philipp Zabel , linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rustam Adilov , Michael Zavertkin Subject: [PATCH v7 1/6] phy: realtek: usb2: introduce phy_reg_desc struct to the driver Date: Sat, 15 Aug 2026 14:13:35 +0500 Message-ID: <20260815091340.26910-2-adilov@disroot.org> In-Reply-To: <20260815091340.26910-1-adilov@disroot.org> References: <20260815091340.26910-1-adilov@disroot.org> 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" In RTL9607C SoC, there are a few differences in usb2 phy compared to existing RTD SoCs, like vstatus register is at certain offset from the base, busy bit and new_reg_req bit are at different bits of the register. To avoid duplicating these variables across phy cfg and driver data, create a per-SoC struct that would hold them and with that add the default rtd_phy_reg_desc to which all RTD SoCs driver data will point towards. Co-developed-by: Michael Zavertkin Signed-off-by: Michael Zavertkin Signed-off-by: Rustam Adilov --- drivers/phy/realtek/phy-rtk-usb2.c | 59 ++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/drivers/phy/realtek/phy-rtk-usb2.c b/drivers/phy/realtek/phy-r= tk-usb2.c index 248550ef98ca..e8d0f0119ec0 100644 --- a/drivers/phy/realtek/phy-rtk-usb2.c +++ b/drivers/phy/realtek/phy-rtk-usb2.c @@ -60,10 +60,17 @@ #define DEFAULT_DC_DISCONNECTION_VALUE (0x6) #define HS_CLK_SELECT BIT(6) =20 +struct phy_reg_desc { + int vstatus_offset; + u32 vstatus_busy; + u32 new_reg_req; +}; + struct phy_reg { void __iomem *reg_wrap_vstatus; void __iomem *reg_gusb2phyacc0; int vstatus_index; + const struct phy_reg_desc *desc; }; =20 struct phy_data { @@ -96,6 +103,7 @@ struct phy_cfg { bool do_toggle_driving; bool use_default_parameter; bool is_double_sensitivity_mode; + const struct phy_reg_desc *reg_desc; }; =20 struct phy_parameter { @@ -156,27 +164,28 @@ static inline int utmi_wait_register(void __iomem *re= g, u32 mask, u32 result) static char rtk_phy_read(struct phy_reg *phy_reg, char addr) { void __iomem *reg_gusb2phyacc0 =3D phy_reg->reg_gusb2phyacc0; + const struct phy_reg_desc *reg_desc =3D phy_reg->desc; unsigned int val; int ret =3D 0; =20 addr -=3D OFFEST_PHY_READ; =20 /* polling until VBusy =3D=3D 0 */ - ret =3D utmi_wait_register(reg_gusb2phyacc0, PHY_VSTS_BUSY, 0); + ret =3D utmi_wait_register(reg_gusb2phyacc0, reg_desc->vstatus_busy, 0); if (ret) return (char)ret; =20 - /* VCtrl =3D low nibble of addr, and set PHY_NEW_REG_REQ */ - val =3D PHY_NEW_REG_REQ | (GET_LOW_NIBBLE(addr) << PHY_VCTRL_SHIFT); + /* VCtrl =3D low nibble of addr, and set reg_desc->new_reg_req */ + val =3D reg_desc->new_reg_req | (GET_LOW_NIBBLE(addr) << PHY_VCTRL_SHIFT); writel(val, reg_gusb2phyacc0); - ret =3D utmi_wait_register(reg_gusb2phyacc0, PHY_VSTS_BUSY, 0); + ret =3D utmi_wait_register(reg_gusb2phyacc0, reg_desc->vstatus_busy, 0); if (ret) return (char)ret; =20 - /* VCtrl =3D high nibble of addr, and set PHY_NEW_REG_REQ */ - val =3D PHY_NEW_REG_REQ | (GET_HIGH_NIBBLE(addr) << PHY_VCTRL_SHIFT); + /* VCtrl =3D high nibble of addr, and set reg_desc->new_reg_req */ + val =3D reg_desc->new_reg_req | (GET_HIGH_NIBBLE(addr) << PHY_VCTRL_SHIFT= ); writel(val, reg_gusb2phyacc0); - ret =3D utmi_wait_register(reg_gusb2phyacc0, PHY_VSTS_BUSY, 0); + ret =3D utmi_wait_register(reg_gusb2phyacc0, reg_desc->vstatus_busy, 0); if (ret) return (char)ret; =20 @@ -190,29 +199,31 @@ static int rtk_phy_write(struct phy_reg *phy_reg, cha= r addr, char data) unsigned int val; void __iomem *reg_wrap_vstatus =3D phy_reg->reg_wrap_vstatus; void __iomem *reg_gusb2phyacc0 =3D phy_reg->reg_gusb2phyacc0; + const struct phy_reg_desc *reg_desc =3D phy_reg->desc; int shift_bits =3D phy_reg->vstatus_index * 8; int ret =3D 0; =20 /* write data to VStatusOut2 (data output to phy) */ - writel((u32)data << shift_bits, reg_wrap_vstatus); + writel((u32)data << shift_bits, + reg_wrap_vstatus + reg_desc->vstatus_offset); =20 - ret =3D utmi_wait_register(reg_gusb2phyacc0, PHY_VSTS_BUSY, 0); + ret =3D utmi_wait_register(reg_gusb2phyacc0, reg_desc->vstatus_busy, 0); if (ret) return ret; =20 - /* VCtrl =3D low nibble of addr, set PHY_NEW_REG_REQ */ - val =3D PHY_NEW_REG_REQ | (GET_LOW_NIBBLE(addr) << PHY_VCTRL_SHIFT); + /* VCtrl =3D low nibble of addr, set reg_desc->new_reg_req */ + val =3D reg_desc->new_reg_req | (GET_LOW_NIBBLE(addr) << PHY_VCTRL_SHIFT); =20 writel(val, reg_gusb2phyacc0); - ret =3D utmi_wait_register(reg_gusb2phyacc0, PHY_VSTS_BUSY, 0); + ret =3D utmi_wait_register(reg_gusb2phyacc0, reg_desc->vstatus_busy, 0); if (ret) return ret; =20 - /* VCtrl =3D high nibble of addr, set PHY_NEW_REG_REQ */ - val =3D PHY_NEW_REG_REQ | (GET_HIGH_NIBBLE(addr) << PHY_VCTRL_SHIFT); + /* VCtrl =3D high nibble of addr, set reg_desc->new_reg_req */ + val =3D reg_desc->new_reg_req | (GET_HIGH_NIBBLE(addr) << PHY_VCTRL_SHIFT= ); =20 writel(val, reg_gusb2phyacc0); - ret =3D utmi_wait_register(reg_gusb2phyacc0, PHY_VSTS_BUSY, 0); + ret =3D utmi_wait_register(reg_gusb2phyacc0, reg_desc->vstatus_busy, 0); if (ret) return ret; =20 @@ -957,6 +968,7 @@ static int get_phy_data_by_efuse(struct rtk_phy *rtk_ph= y, =20 static int parse_phy_data(struct rtk_phy *rtk_phy) { + struct phy_cfg *phy_cfg =3D rtk_phy->phy_cfg; struct device *dev =3D rtk_phy->dev; struct device_node *np =3D dev->of_node; struct phy_parameter *phy_parameter; @@ -974,6 +986,8 @@ static int parse_phy_data(struct rtk_phy *rtk_phy) phy_parameter->phy_reg.reg_wrap_vstatus =3D of_iomap(np, 0); phy_parameter->phy_reg.reg_gusb2phyacc0 =3D of_iomap(np, 1) + index; phy_parameter->phy_reg.vstatus_index =3D index; + phy_parameter->phy_reg.desc =3D phy_cfg->reg_desc; + =20 if (of_property_read_bool(np, "realtek,inverse-hstx-sync-clock")) phy_parameter->inverse_hstx_sync_clock =3D true; @@ -1060,6 +1074,12 @@ static void rtk_usb2phy_remove(struct platform_devic= e *pdev) remove_debug_files(rtk_phy); } =20 +static const struct phy_reg_desc rtd_phy_reg_desc =3D { + .vstatus_offset =3D 0, + .vstatus_busy =3D PHY_VSTS_BUSY, + .new_reg_req =3D PHY_NEW_REG_REQ, +}; + static const struct phy_cfg rtd1295_phy_cfg =3D { .page0_size =3D MAX_USB_PHY_PAGE0_DATA_SIZE, .page0 =3D { [0] =3D {0xe0, 0x90}, @@ -1085,6 +1105,7 @@ static const struct phy_cfg rtd1295_phy_cfg =3D { .driving_updated_for_dev_dis =3D 0xf, .use_default_parameter =3D false, .is_double_sensitivity_mode =3D false, + .reg_desc =3D &rtd_phy_reg_desc, }; =20 static const struct phy_cfg rtd1395_phy_cfg =3D { @@ -1109,6 +1130,7 @@ static const struct phy_cfg rtd1395_phy_cfg =3D { .driving_updated_for_dev_dis =3D 0xf, .use_default_parameter =3D false, .is_double_sensitivity_mode =3D false, + .reg_desc =3D &rtd_phy_reg_desc, }; =20 static const struct phy_cfg rtd1395_phy_cfg_2port =3D { @@ -1133,6 +1155,7 @@ static const struct phy_cfg rtd1395_phy_cfg_2port =3D= { .driving_updated_for_dev_dis =3D 0xf, .use_default_parameter =3D false, .is_double_sensitivity_mode =3D false, + .reg_desc =3D &rtd_phy_reg_desc, }; =20 static const struct phy_cfg rtd1619_phy_cfg =3D { @@ -1155,6 +1178,7 @@ static const struct phy_cfg rtd1619_phy_cfg =3D { .driving_updated_for_dev_dis =3D 0xf, .use_default_parameter =3D false, .is_double_sensitivity_mode =3D false, + .reg_desc =3D &rtd_phy_reg_desc, }; =20 static const struct phy_cfg rtd1319_phy_cfg =3D { @@ -1181,6 +1205,7 @@ static const struct phy_cfg rtd1319_phy_cfg =3D { .driving_updated_for_dev_dis =3D 0xf, .use_default_parameter =3D false, .is_double_sensitivity_mode =3D true, + .reg_desc =3D &rtd_phy_reg_desc, }; =20 static const struct phy_cfg rtd1312c_phy_cfg =3D { @@ -1206,6 +1231,7 @@ static const struct phy_cfg rtd1312c_phy_cfg =3D { .driving_updated_for_dev_dis =3D 0xf, .use_default_parameter =3D false, .is_double_sensitivity_mode =3D true, + .reg_desc =3D &rtd_phy_reg_desc, }; =20 static const struct phy_cfg rtd1619b_phy_cfg =3D { @@ -1231,6 +1257,7 @@ static const struct phy_cfg rtd1619b_phy_cfg =3D { .driving_updated_for_dev_dis =3D 0x8, .use_default_parameter =3D false, .is_double_sensitivity_mode =3D true, + .reg_desc =3D &rtd_phy_reg_desc, }; =20 static const struct phy_cfg rtd1319d_phy_cfg =3D { @@ -1256,6 +1283,7 @@ static const struct phy_cfg rtd1319d_phy_cfg =3D { .driving_updated_for_dev_dis =3D 0x8, .use_default_parameter =3D false, .is_double_sensitivity_mode =3D true, + .reg_desc =3D &rtd_phy_reg_desc, }; =20 static const struct phy_cfg rtd1315e_phy_cfg =3D { @@ -1282,6 +1310,7 @@ static const struct phy_cfg rtd1315e_phy_cfg =3D { .driving_updated_for_dev_dis =3D 0x8, .use_default_parameter =3D false, .is_double_sensitivity_mode =3D true, + .reg_desc =3D &rtd_phy_reg_desc, }; =20 static const struct of_device_id usbphy_rtk_dt_match[] =3D { --=20 2.55.0 From nobody Mon Sep 28 23:07:56 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (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 7BAE7360EDC; Sat, 15 Aug 2026 09:14:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786785281; cv=none; b=a3XQ9OfY8YUiWwijHT1bGY5L/Mj6PrL8yXmII1DZOHrrw5r6HaOSof589c4+GnzWWi/m/mJtKNk/TSx1kkAdUtavQ/iOw+bCBdrReCZ1Aptg9kljM0qVxhdA+DhGbQBXSNhwFVoCZKdWbNCtcDINezF8nzSxoHTalVFda9Ulj/s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786785281; c=relaxed/simple; bh=qi/gWHzJoMLT99wi33nSAx6f8CFgp+JnA4bNs+DMJnI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K2erXlZ0cNpm6yoD8sXXp2pzCbFErfly1jmNhUmz/uZ1l4Fg+IcaZjO86cshegYEyUQY2hFAVYUQyw97wkFCrB5AwtulmR5BI0hPTHzI1DZprj9dRyuQh7hPEaT6JOXZ9Lfli6KMFCwlYk7fe5maTl/8ZEl/pE4DtchDJ5oo8io= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=HqPL07JX; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="HqPL07JX" Received: from mail01.layka.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id EF183882CA; Sat, 15 Aug 2026 11:14:37 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id PQPWE5oCTmlF; Sat, 15 Aug 2026 11:14:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1786785277; bh=qi/gWHzJoMLT99wi33nSAx6f8CFgp+JnA4bNs+DMJnI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HqPL07JXkgTVdLEbAbaoVMgadjSik1hqNNfBhN5LsZgqc+bDz7X3V14Gc8a2BbEPX ADGLxP7yOTodzKVGWxASzl7ZZ30nwh2wU8LYSV5EgZXdfWJAYQUtf/+YnmE7ugt/wS xqpDIwbu7HPGFAf4kN99Q3+UdJekGEAn8czamdJ4Rq2NGyttrdkwtADcnBPF7f38ix BOnM6lsbe+2sO5loluo1NvB6Do1dauYN4VnOHs2WFDx83T8gz0k0mxJjueLG7hhe/x ObW6nl+liSWQFxsmLDVzyzOQhgHTr2YSg1e2mHfl1t66ZlQkcOHVZeVoE1LItJZqGT NTzvSv3YSd1pg== From: Rustam Adilov To: Vinod Koul , Neil Armstrong , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanley Chang , Philipp Zabel , linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rustam Adilov , Michael Zavertkin Subject: [PATCH v7 2/6] phy: realtek: usb2: introduce read and write functions to phy_reg_desc struct Date: Sat, 15 Aug 2026 14:13:36 +0500 Message-ID: <20260815091340.26910-3-adilov@disroot.org> In-Reply-To: <20260815091340.26910-1-adilov@disroot.org> References: <20260815091340.26910-1-adilov@disroot.org> 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" RTL9607C is a big endian SoC with little endian USB host controller but vstatus register is from big endian memory region and thus existing writel doesn't work. It needs either __raw_writel or iowrite32be instead. To handle this situation, introduce read and write function to the phy_reg_desc struct and add a default variation that is going to be ponted by the existing rtd_phy_reg_desc. Co-developed-by: Michael Zavertkin Signed-off-by: Michael Zavertkin Signed-off-by: Rustam Adilov --- drivers/phy/realtek/phy-rtk-usb2.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/phy/realtek/phy-rtk-usb2.c b/drivers/phy/realtek/phy-r= tk-usb2.c index e8d0f0119ec0..5e483c853f02 100644 --- a/drivers/phy/realtek/phy-rtk-usb2.c +++ b/drivers/phy/realtek/phy-rtk-usb2.c @@ -64,6 +64,8 @@ struct phy_reg_desc { int vstatus_offset; u32 vstatus_busy; u32 new_reg_req; + u32 (*read)(void __iomem *reg); + void (*write)(u32 val, void __iomem *reg); }; =20 struct phy_reg { @@ -130,6 +132,16 @@ struct rtk_phy { struct dentry *debug_dir; }; =20 +static u32 rtk_usb2phy_read(void __iomem *reg) +{ + return readl(reg); +} + +static void rtk_usb2phy_write(u32 val, void __iomem *reg) +{ + writel(val, reg); +} + /* mapping 0xE0 to 0 ... 0xE7 to 7, 0xF0 to 8 ,,, 0xF7 to 15 */ static inline int page_addr_to_array_index(u8 addr) { @@ -204,8 +216,8 @@ static int rtk_phy_write(struct phy_reg *phy_reg, char = addr, char data) int ret =3D 0; =20 /* write data to VStatusOut2 (data output to phy) */ - writel((u32)data << shift_bits, - reg_wrap_vstatus + reg_desc->vstatus_offset); + reg_desc->write((u32)data << shift_bits, + reg_wrap_vstatus + reg_desc->vstatus_offset); =20 ret =3D utmi_wait_register(reg_gusb2phyacc0, reg_desc->vstatus_busy, 0); if (ret) @@ -988,7 +1000,6 @@ static int parse_phy_data(struct rtk_phy *rtk_phy) phy_parameter->phy_reg.vstatus_index =3D index; phy_parameter->phy_reg.desc =3D phy_cfg->reg_desc; =20 - if (of_property_read_bool(np, "realtek,inverse-hstx-sync-clock")) phy_parameter->inverse_hstx_sync_clock =3D true; else @@ -1078,6 +1089,8 @@ static const struct phy_reg_desc rtd_phy_reg_desc =3D= { .vstatus_offset =3D 0, .vstatus_busy =3D PHY_VSTS_BUSY, .new_reg_req =3D PHY_NEW_REG_REQ, + .read =3D rtk_usb2phy_read, + .write =3D rtk_usb2phy_write, }; =20 static const struct phy_cfg rtd1295_phy_cfg =3D { --=20 2.55.0 From nobody Mon Sep 28 23:07:56 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (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 D50FE3AA1A9; Sat, 15 Aug 2026 09:14:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786785286; cv=none; b=OXEouiJIUIeQymvtMTp0IXsrc9EndHUOSBWGtgtwbLH7STtbpeK0SuCG7SM4FcMPY94CwUrr4uAz60LqfPmfOP2oW6uFwh5r7ZThDYkpaMlcpFhmdok6LEnMIXz4wrd8nRlBDpwxJoPczrF2uCt4k0/rTz/2p7iwfbGL8YsairM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786785286; c=relaxed/simple; bh=fy1Yhltaa1Q3i0THgRe8+wftvG07v8/paH+tXjFdftg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hi+f5bM56Aoaph0zHgp6pbyQU2L8u46GkgD/XbDvsuxDU/iuW5D5PR56sl8Ae5N8OVOt9beph3QsTzm53K+NOiJFwsfkf/pHNmjAmJi2MqULjK9xQq30oaiUZ4DYTCq2y8YYDdiybo/UFEcjUkSgBM6s5uNEqkJ+ttzAfFhssXg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=dTiyPCvu; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="dTiyPCvu" Received: from mail01.layka.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 53F92882CB; Sat, 15 Aug 2026 11:14:41 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id NKqDhHViGYTz; Sat, 15 Aug 2026 11:14:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1786785280; bh=fy1Yhltaa1Q3i0THgRe8+wftvG07v8/paH+tXjFdftg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=dTiyPCvuNjw2mJ3U9xgC06JwyMT8JPvWV1j6AYiXXBuDKCsjEhtLGw5QAqh9xXMzM 3Sv/cSph5wZLLZ7DwWjd2Akjg81vdayQS47TGT1PRLtS5Fv/VdwJyRDSK2RFtrZfwJ wx0x09BCLGgwMk77tnMmJ96Pqblyv6t3tCn87gPX77SMWhEbnO1bJ+HP4nQrNs2q9W r80nLwmuetmEsL9K9HyRN7DRO9+FA97B5ojw3oKEbIIk8zmzdDKUpedmZMOzQ9d26k wN1yG6wbG4Ff4DYEDgKv+FNfecV8hzV+znMw0+PhMH7iykVxsFxC9/N1WNN324DB8I l6kjjpPVx9llg== From: Rustam Adilov To: Vinod Koul , Neil Armstrong , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanley Chang , Philipp Zabel , linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rustam Adilov , Krzysztof Kozlowski , Manivannan Sadhasivam Subject: [PATCH v7 3/6] dt-bindings: phy: realtek,usb2phy.yaml: extend for resets and RTL9607C support Date: Sat, 15 Aug 2026 14:13:37 +0500 Message-ID: <20260815091340.26910-4-adilov@disroot.org> In-Reply-To: <20260815091340.26910-1-adilov@disroot.org> References: <20260815091340.26910-1-adilov@disroot.org> 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" Add the "realtek,rtl9607-usb2phy" compatible for USB2 PHY on the RTL9607C SoC series. Add a resets property to properties to describe the usb2phy reset line. In RTL9607C, USB2 PHY reset line is from "IP Enable controller" which is multipurpose and handle activating various SoC peripherals. It is unclear whether RTD SoCs have something similar to that so set the resets to false for these devices. RTL9607C requires the "resets" to be specified so add the corresponding if check for the "realtek,rtl9607-usb2phy" compatible. Reviewed-by: Krzysztof Kozlowski Acked-by: Manivannan Sadhasivam Signed-off-by: Rustam Adilov --- .../bindings/phy/realtek,usb2phy.yaml | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/phy/realtek,usb2phy.yaml b/D= ocumentation/devicetree/bindings/phy/realtek,usb2phy.yaml index 9911ada39ee7..7b50833c8e19 100644 --- a/Documentation/devicetree/bindings/phy/realtek,usb2phy.yaml +++ b/Documentation/devicetree/bindings/phy/realtek,usb2phy.yaml @@ -11,7 +11,8 @@ maintainers: - Stanley Chang =20 description: | - Realtek USB 2.0 PHY support the digital home center (DHC) RTD series SoC= s. + Realtek USB 2.0 PHY support the digital home center (DHC) RTD and + RTL9607C series SoCs. The USB 2.0 PHY driver is designed to support the XHCI controller. The S= oCs support multiple XHCI controllers. One PHY device node maps to one XHCI controller. @@ -57,6 +58,12 @@ description: | XHCI controller#1 -- usb2phy -- phy#0 XHCI controller#2 -- usb2phy -- phy#0 =20 + RTL9607C SoCs USB + The USB architecture includes OHCI and EHCI controllers. + Both of them map to one USB2.0 PHY. + OHCI controller#0 -- usb2phy -- phy#0 + EHCI controller#0 -- usb2phy -- phy#0 + properties: compatible: enum: @@ -69,6 +76,7 @@ properties: - realtek,rtd1395-usb2phy-2port - realtek,rtd1619-usb2phy - realtek,rtd1619b-usb2phy + - realtek,rtl9607-usb2phy =20 reg: items: @@ -130,6 +138,9 @@ properties: minimum: -8 maximum: 8 =20 + resets: + maxItems: 1 + required: - compatible - reg @@ -157,6 +168,18 @@ allOf: then: properties: realtek,driving-level-compensate: false + - if: + properties: + compatible: + contains: + enum: + - realtek,rtl9607-usb2phy + then: + required: + - resets + else: + properties: + resets: false =20 additionalProperties: false =20 --=20 2.55.0 From nobody Mon Sep 28 23:07:56 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (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 4B1D43BB9EB; Sat, 15 Aug 2026 09:14:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786785292; cv=none; b=tnkW/PDWkT4vV5lvth/VAtNuaRrtBgJItrQua01FAADs07XRJdkdY+2izpm+utA2x7/t/IzwNk0dQCUvMiod8J/ylPptrEl8MlzwSnh6upQO09qiekhnKSuXkC9+rv/I4+x1XbFkEnJHDzKwEUtNmB9dQ1FDpXF/OyZB1KDmEl0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786785292; c=relaxed/simple; bh=rpnTVB2lvy7vaRGEwYc4n2Ueim6D21MwthwfXOQ60pc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dTgwF3j8Qug/YwGPynzzdxh9Yk1lcNZZU0UaDLL+DCI217abDSaVxMWzB9Mo05q/50rT/u2Ob+Jducid5sInxyUGyAWn0apg7wJTfnOHGVSKMNlF5hSNcU0dbLP71/sUcKhwkbjaB9SW3wqlj8vrxR38dddAXPbV4P5CHaldLzo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=Hfzo6tyF; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="Hfzo6tyF" Received: from mail01.layka.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id B361588362; Sat, 15 Aug 2026 11:14:44 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id MecjSrzQRqm6; Sat, 15 Aug 2026 11:14:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1786785283; bh=rpnTVB2lvy7vaRGEwYc4n2Ueim6D21MwthwfXOQ60pc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Hfzo6tyFEiG9qHwaPL704zRZjdFDIzzvw1IZ+eJ3XUEjr1onl/zTZt8HuX3Rs32GU QlYiYou/THgNmckhzjG/7ku0XXEd7m1TFLm/S4jTVOxZjOU3fnTnXU1KcRJpZWye82 dSiKn8xsRzPj6JN/WRPswfhyXDQ16Y6oQRYyrZRz3swYv66azW/v/nQJiyCzyUq7Qf AX7HSPczSv2JEnTgXOdKFIKG5tgbESu7ZCinr0ls/U2VPiCyAgfyJqL0UrAJ9ZfMsc 7T7AbT86+HTDh6W71gTsq5AuBSeFs5r8tfQTwW9nfa0T/u6eJlYkI8f2hzY4U54is0 +CYJy/0fF5mjA== From: Rustam Adilov To: Vinod Koul , Neil Armstrong , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanley Chang , Philipp Zabel , linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rustam Adilov , Michael Zavertkin Subject: [PATCH v7 4/6] phy: realtek: usb2: introduce reset controller struct Date: Sat, 15 Aug 2026 14:13:38 +0500 Message-ID: <20260815091340.26910-5-adilov@disroot.org> In-Reply-To: <20260815091340.26910-1-adilov@disroot.org> References: <20260815091340.26910-1-adilov@disroot.org> 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" In RTL9607C, there is so called "IP Enable Controller" which resemble reset controller with reset lines and is used for various things like USB, PCIE, GMAC and such. Introduce the reset_control struct to this driver to handle deasserting usb2 phy reset line. Make use of the function devm_reset_control_get_optional_exclusive() function to get the reset controller and since existing RTD SoCs don't specify the resets we can have a cleaner code. Since the vendor usb driver developed by Realtek doesn't assert the reset line (or in their case clear the register bit), we can reasonably assume reset_control_assert is not needed here. Co-developed-by: Michael Zavertkin Signed-off-by: Michael Zavertkin Signed-off-by: Rustam Adilov --- drivers/phy/realtek/phy-rtk-usb2.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/phy/realtek/phy-rtk-usb2.c b/drivers/phy/realtek/phy-r= tk-usb2.c index 5e483c853f02..2ddad7be7353 100644 --- a/drivers/phy/realtek/phy-rtk-usb2.c +++ b/drivers/phy/realtek/phy-rtk-usb2.c @@ -17,6 +17,7 @@ #include #include #include +#include #include =20 /* GUSB2PHYACCn register */ @@ -128,6 +129,7 @@ struct rtk_phy { struct phy_cfg *phy_cfg; int num_phy; struct phy_parameter *phy_parameter; + struct reset_control *phy_rst; =20 struct dentry *debug_dir; }; @@ -676,6 +678,15 @@ static int rtk_phy_init(struct phy *phy) if (!rtk_phy) return -EINVAL; =20 + if (rtk_phy->phy_rst) { + ret =3D reset_control_deassert(rtk_phy->phy_rst); + + if (ret) + return ret; + + usleep_range(5000, 6000); + } + for (i =3D 0; i < rtk_phy->num_phy; i++) ret =3D do_rtk_phy_init(rtk_phy, i); =20 @@ -1055,6 +1066,11 @@ static int rtk_usb2phy_probe(struct platform_device = *pdev) =20 rtk_phy->num_phy =3D phy_cfg->num_phy; =20 + rtk_phy->phy_rst =3D devm_reset_control_get_optional_exclusive(dev, NULL); + if (IS_ERR(rtk_phy->phy_rst)) + return dev_err_probe(dev, PTR_ERR(rtk_phy->phy_rst), + "usb2 phy reset is not working\n"); + ret =3D parse_phy_data(rtk_phy); if (ret) goto err; --=20 2.55.0 From nobody Mon Sep 28 23:07:56 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (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 DC099383998; Sat, 15 Aug 2026 09:14:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786785293; cv=none; b=KymE53lGl6jukYdxBXlzAHinB/JNl+B0rtgIQNuucXxLY0++r0QXEh9NWJ97LvNwVeiiGwpO4TY3aWtYI0Fmr3OqPDWZs3s98yYH406r6XWmFa5i2+pmyEzMLmOKKZiJ/3figspYiTkBZVtXzZebMUfrMezW60DYD9/dGCb8CaY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786785293; c=relaxed/simple; bh=iTMFW9PtcXtthHHYIKyXUPqjK5gtUDESdCp0WUlX6Q4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IsIHZRUKaL4ar4B0AgPo3Tg/hMmocgjTuqTdp+JcO9wbCX4XMX+z05uJ4fy9G+VgE2zEbCFfEZBRmm994hskYo/UI4uIOQUSOu26lN9gk07G6J8SQj/+dgHnmjfA/96A6ehYI8eqZbyJWO9nWHYougZHvXE5AV+HyqEopyyPPn0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=LWY/NZrx; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="LWY/NZrx" Received: from mail01.layka.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 5AA9A881CC; Sat, 15 Aug 2026 11:14:50 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id r1S2K92VLyO6; Sat, 15 Aug 2026 11:14:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1786785286; bh=iTMFW9PtcXtthHHYIKyXUPqjK5gtUDESdCp0WUlX6Q4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=LWY/NZrxuEuMwc4xc5Q4xjZlZG8Mi6MZLDWmcj6s4zSiV0jxlCftuFaf0Cz6BSscW 7aPSyKjiQBwhWul2jbY/cv8iJlqKN1zDMpaB2VsXqHuUq0GzoiAu2JlDss+evIxrNM d23oDfqtAxbl+0afhphAs6OmUcZ7yjESlGYmyPzs5e+Ywk1visxdfx0KR68woBx5jj PVd+BF8vesBfpGEH/FTjV+SvX9BafrN8ddSnjA1nrCQwqzPl5pMf1VLXZY4v7G6x6L ICwKqluD/jJLIP8jyE0Z3DkN7ziICytWrhJoT2cIvBRikYjQ+WoTeOmv4Hx4sBc0QQ sDayj/k861oRw== From: Rustam Adilov To: Vinod Koul , Neil Armstrong , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanley Chang , Philipp Zabel , linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rustam Adilov , Michael Zavertkin Subject: [PATCH v7 5/6] phy: realtek: usb2: add support for RTL9607C USB2 PHY Date: Sat, 15 Aug 2026 14:13:39 +0500 Message-ID: <20260815091340.26910-6-adilov@disroot.org> In-Reply-To: <20260815091340.26910-1-adilov@disroot.org> References: <20260815091340.26910-1-adilov@disroot.org> 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" Add support for the usb2 phy of RTL9607C series based SoCs. Add the macros and phy config struct for rtl9607. RTL9607C requires to clear a "force host disconnect" bit in the specific register (which is at an offset from reg_wrap_vstatus) before proceeding with phy parameter writes. Since it belongs into the vstatus register region, it requires the use of added read and write helper functions. Add the bool variable to the driver data struct and hide this whole procedure under the if statement that checks this new variable. Add the appropriate big endian read and write functions for rtl9607 and assign them to its rtl9607_phy_reg_desc struct. Co-developed-by: Michael Zavertkin Signed-off-by: Michael Zavertkin Signed-off-by: Rustam Adilov --- drivers/phy/realtek/phy-rtk-usb2.c | 66 ++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/drivers/phy/realtek/phy-rtk-usb2.c b/drivers/phy/realtek/phy-r= tk-usb2.c index 2ddad7be7353..990ceca37ef8 100644 --- a/drivers/phy/realtek/phy-rtk-usb2.c +++ b/drivers/phy/realtek/phy-rtk-usb2.c @@ -26,6 +26,12 @@ #define PHY_VCTRL_SHIFT 8 #define PHY_REG_DATA_MASK 0xff =20 +#define PHY_9607_VSTS_BUSY BIT(17) +#define PHY_9607_NEW_REG_REQ BIT(13) + +#define PHY_9607_FORCE_DISCONNECT_REG 0x10 +#define PHY_9607_FORCE_DISCONNECT_BIT BIT(5) + #define GET_LOW_NIBBLE(addr) ((addr) & 0x0f) #define GET_HIGH_NIBBLE(addr) (((addr) & 0xf0) >> 4) =20 @@ -107,6 +113,7 @@ struct phy_cfg { bool use_default_parameter; bool is_double_sensitivity_mode; const struct phy_reg_desc *reg_desc; + bool force_host_disconnect; }; =20 struct phy_parameter { @@ -144,6 +151,16 @@ static void rtk_usb2phy_write(u32 val, void __iomem *r= eg) writel(val, reg); } =20 +static u32 rtk_usb2phy_read_be(void __iomem *reg) +{ + return ioread32be(reg); +} + +static void rtk_usb2phy_write_be(u32 val, void __iomem *reg) +{ + iowrite32be(val, reg); +} + /* mapping 0xE0 to 0 ... 0xE7 to 7, 0xF0 to 8 ,,, 0xF7 to 15 */ static inline int page_addr_to_array_index(u8 addr) { @@ -600,6 +617,23 @@ static int do_rtk_phy_init(struct rtk_phy *rtk_phy, in= t index) goto do_toggle; } =20 + if (phy_cfg->force_host_disconnect) { + const struct phy_reg_desc *reg_desc =3D phy_reg->desc; + void __iomem *vstatus =3D phy_reg->reg_wrap_vstatus; + u32 temp; + + temp =3D reg_desc->read(vstatus + PHY_9607_FORCE_DISCONNECT_REG); + + /* disable force-host-disconnect */ + temp &=3D ~PHY_9607_FORCE_DISCONNECT_BIT; + + reg_desc->write(temp, vstatus + PHY_9607_FORCE_DISCONNECT_REG); + temp =3D reg_desc->read(vstatus + PHY_9607_FORCE_DISCONNECT_REG); + + /* allow IP to startup */ + usleep_range(10000, 11000); + } + /* Set page 0 */ phy_data_page =3D phy_cfg->page0; rtk_phy_set_page(phy_reg, 0); @@ -1109,6 +1143,14 @@ static const struct phy_reg_desc rtd_phy_reg_desc = =3D { .write =3D rtk_usb2phy_write, }; =20 +static const struct phy_reg_desc rtl9607_phy_reg_desc =3D { + .vstatus_offset =3D 0xc, + .vstatus_busy =3D PHY_9607_VSTS_BUSY, + .new_reg_req =3D PHY_9607_NEW_REG_REQ, + .read =3D rtk_usb2phy_read_be, + .write =3D rtk_usb2phy_write_be, +}; + static const struct phy_cfg rtd1295_phy_cfg =3D { .page0_size =3D MAX_USB_PHY_PAGE0_DATA_SIZE, .page0 =3D { [0] =3D {0xe0, 0x90}, @@ -1342,6 +1384,29 @@ static const struct phy_cfg rtd1315e_phy_cfg =3D { .reg_desc =3D &rtd_phy_reg_desc, }; =20 +static const struct phy_cfg rtl9607_phy_cfg =3D { + .page0_size =3D MAX_USB_PHY_PAGE0_DATA_SIZE, + .page0 =3D { [0] =3D {0xe0, 0x95}, + [4] =3D {0xe4, 0x6a}, + [12] =3D {0xf3, 0x31}, }, + .page1_size =3D MAX_USB_PHY_PAGE1_DATA_SIZE, + .page1 =3D { [0] =3D {0xe0, 0x26}, }, + .page2_size =3D MAX_USB_PHY_PAGE2_DATA_SIZE, + .page2 =3D { [7] =3D {0xe7, 0x33}, }, + .num_phy =3D 1, + .check_efuse_version =3D CHECK_EFUSE_V2, + .efuse_dc_driving_rate =3D EFUS_USB_DC_CAL_RATE, + .dc_driving_mask =3D 0x1f, + .efuse_dc_disconnect_rate =3D EFUS_USB_DC_DIS_RATE, + .dc_disconnect_mask =3D 0xf, + .usb_dc_disconnect_at_page0 =3D true, + .do_toggle =3D true, + .driving_updated_for_dev_dis =3D 0x8, + .is_double_sensitivity_mode =3D true, + .reg_desc =3D &rtl9607_phy_reg_desc, + .force_host_disconnect =3D true, +}; + static const struct of_device_id usbphy_rtk_dt_match[] =3D { { .compatible =3D "realtek,rtd1295-usb2phy", .data =3D &rtd1295_phy_cfg }, { .compatible =3D "realtek,rtd1312c-usb2phy", .data =3D &rtd1312c_phy_cfg= }, @@ -1352,6 +1417,7 @@ static const struct of_device_id usbphy_rtk_dt_match[= ] =3D { { .compatible =3D "realtek,rtd1395-usb2phy-2port", .data =3D &rtd1395_phy= _cfg_2port }, { .compatible =3D "realtek,rtd1619-usb2phy", .data =3D &rtd1619_phy_cfg }, { .compatible =3D "realtek,rtd1619b-usb2phy", .data =3D &rtd1619b_phy_cfg= }, + { .compatible =3D "realtek,rtl9607-usb2phy", .data =3D &rtl9607_phy_cfg }, {}, }; MODULE_DEVICE_TABLE(of, usbphy_rtk_dt_match); --=20 2.55.0 From nobody Mon Sep 28 23:07:56 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (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 DC00B37E5F3; Sat, 15 Aug 2026 09:14:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786785293; cv=none; b=O3hO9rVnbL4bVmOW/Zon7hqEs2ml+Z/dz87CwjPKsmBGT+iYNrb0n7dQXcJZhtihnwrH4AJmtFhmgnIzujlu/wi+aEsSpbvccAvZxGph8V9RoP2jb1GchDY3yMDV6CQUtfcVBfuIAXgszw/Ey12wi8eMSA9NutRjNboMPfGTIL8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786785293; c=relaxed/simple; bh=dSApdouRs74AgqrQBX4yQQP2Zh1Ae09ZBK7ma9JanCg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TJFbz+1lNDr65WarVo6mEwHsTKJ9crQdfHvYIPcSWl+jtDWdSKKl7hfLbvcf4qNeSKKvC1L2pwBbNofG0ee8l+pkPHPnp/+XpKMPDsGxKXZWQEd0DFJLuh8mkJ/tXvk7TKOaoG1wVySGL1yY11RP/LdbE9eCwt19Vn/uEpQqmpU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=dFCKoU8D; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="dFCKoU8D" Received: from mail01.layka.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id DE980882DB; Sat, 15 Aug 2026 11:14:49 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 64-xFJu9MUjY; Sat, 15 Aug 2026 11:14:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1786785289; bh=dSApdouRs74AgqrQBX4yQQP2Zh1Ae09ZBK7ma9JanCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=dFCKoU8DbL4a5Bprz4F1PUCe+ZteIm2NW0HGwhqoM6cRmR/chURAkp0/3oyBU1s3q cm2mlmRYOF6Mz1NJHuipuQb7UyjlPkL6qc4cC6vZisJhm8uhw6XwVeqg5BDZGYWyWH k3B2RjGdCK66P/lm0HyjoqXUColQtBrukbwezIteFHJtyy+tEEQGq8g+l1+0vZwdxC MFQv1U9i3vhiiqmZmm1/uhRT5CXrkjxEMmSVyzFpb4GwEwRiq4x/3vSkzF8q5mSQAe P8OUPz9CdlX+XWqId3O5IEdkPJ4Fl7rpJlmTzv0sTNdITiZuoOhSxp+llAv84UF2B6 36lqX4i93kH0w== From: Rustam Adilov To: Vinod Koul , Neil Armstrong , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanley Chang , Philipp Zabel , linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rustam Adilov , Manivannan Sadhasivam Subject: [PATCH v7 6/6] phy: realtek: Make configs available for MACH_REALTEK_RTL Date: Sat, 15 Aug 2026 14:13:40 +0500 Message-ID: <20260815091340.26910-7-adilov@disroot.org> In-Reply-To: <20260815091340.26910-1-adilov@disroot.org> References: <20260815091340.26910-1-adilov@disroot.org> 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" Add the MACH_REALTEK_RTL to the if statement to make the config options available for Realtek RTL SoCs as well. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Rustam Adilov --- drivers/phy/realtek/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/realtek/Kconfig b/drivers/phy/realtek/Kconfig index 75ac7e7c31ae..76f9215d8b94 100644 --- a/drivers/phy/realtek/Kconfig +++ b/drivers/phy/realtek/Kconfig @@ -3,7 +3,7 @@ # Phy drivers for Realtek platforms # =20 -if ARCH_REALTEK || COMPILE_TEST +if ARCH_REALTEK || MACH_REALTEK_RTL || COMPILE_TEST =20 config PHY_RTK_RTD_USB2PHY tristate "Realtek RTD USB2 PHY Transceiver Driver" @@ -29,4 +29,4 @@ config PHY_RTK_RTD_USB3PHY DWC3 USB IP. This driver will do the PHY initialization of the parameters. =20 -endif # ARCH_REALTEK || COMPILE_TEST +endif # ARCH_REALTEK || MACH_REALTEK_RTL || COMPILE_TEST --=20 2.55.0