From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 99384C3601E for ; Tue, 8 Apr 2025 02:35:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:CC:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8tkLU/q9k4bzXOFaIPnKaXKZ9vxRAORbRLbV0GT2sj4=; b=oNSOSyL0kmZJa48hbSwxpZa2xx CTfSfBZinScecr8Cje60ZlZN7y/Q9e6EnF4bjlp6RZAkrbNdsJWeDHyJsAi94EvM6MP8dL4VpiPyB wTERKREaw3wztuE5XVCuvo+NRgph4t6lw7ZbF70sk7ziWWp+9n7M91gV5kXVdHv8VsUPifKaM2gn5 ON6c9kMo38fKf0KHkcmaC7zkVKhVwzSG4V9bu2MrC1qjGbMUoL2W1G/S0iG5VrSOwgc9451ClgOKA tzBfxZS0Tgnh+FGVvxNxdbB0fq3K2qivfPRvgHdgDw+b2qb3pamerTZlmc1LOPmjCdH8XCsKtqKsB YWcxmQFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1u1yo4-00000002X2Y-3fs0; Tue, 08 Apr 2025 02:35:20 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1u1ymI-00000002Wn1-2tT0; Tue, 08 Apr 2025 02:33:32 +0000 Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5382GPej019664; Tue, 8 Apr 2025 02:32:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 8tkLU/q9k4bzXOFaIPnKaXKZ9vxRAORbRLbV0GT2sj4=; b=SIAaWqhZKCRyXT5b LPOPvCKqjpkCu4mwv6zyomN6MHZkgmlw0so8HPOIgFTvYq9Cf0A5r6JjZrxaZXeX OvSmKVyc0wqaJiV6Ici0LY8qoLGCe9CFuvsFTbncuBBYcapvFSp6QRA+NlhNZBMA YZracMLeBdI3rOiAtyyfMvzSSgrV9iS26Q/4pRmCEW59Rb+JkDisEovKEPAZMAHx 8G92RknUmauD2coG9zoNEIUFGGyckGXdiK/JEne37Ai79LhaYsRwU7OyUnl9SneG MYCt2UZ2tEpMAw3SRTBU9KAAYZ8jF8DTs4J/VIldsAvFodejUY9NvJbK+gTiWQSq pD0VDg== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45twg3e566-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Apr 2025 02:32:56 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 5382WtF9000584 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 8 Apr 2025 02:32:55 GMT Received: from [10.110.75.38] (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Mon, 7 Apr 2025 19:32:54 -0700 Message-ID: <73499d82-e7e5-b88a-41a4-160529efc988@quicinc.com> Date: Mon, 7 Apr 2025 19:32:53 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v3 06/10] phy: qcom: Add M31 based eUSB2 PHY driver Content-Language: en-US To: Dmitry Baryshkov , Melody Olvera CC: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , Philipp Zabel , "Bjorn Andersson" , Konrad Dybcio , Catalin Marinas , Will Deacon , , , , , , References: <20250324-sm8750_usb_master-v3-0-13e096dc88fd@quicinc.com> <20250324-sm8750_usb_master-v3-6-13e096dc88fd@quicinc.com> From: Wesley Cheng In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 21XJomGnkL8m6ur2pvtTBprBrwIZ3tQc X-Proofpoint-ORIG-GUID: 21XJomGnkL8m6ur2pvtTBprBrwIZ3tQc X-Authority-Analysis: v=2.4 cv=I/9lRMgg c=1 sm=1 tr=0 ts=67f48ad8 cx=c_pps a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=XR8D0OoHHMoA:10 a=COk6AnOGAAAA:8 a=IJHOkPr1J-CqusO2T_sA:9 a=QEXdDO2ut3YA:10 a=RVmHIydaz68A:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-07_07,2025-04-07_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 lowpriorityscore=0 spamscore=0 clxscore=1015 malwarescore=0 adultscore=0 priorityscore=1501 impostorscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504080016 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250407_193330_875460_F2D8E0C7 X-CRM114-Status: GOOD ( 20.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Dmitry, On 3/26/2025 7:33 AM, Dmitry Baryshkov wrote: > On Mon, Mar 24, 2025 at 01:18:34PM -0700, Melody Olvera wrote: >> From: Wesley Cheng >> >> SM8750 utilizes an eUSB2 PHY from M31. Add the initialization >> sequences to bring it out of reset and into an operational state. This >> differs to the M31 USB driver, in that the M31 eUSB2 driver will >> require a connection to an eUSB2 repeater. This PHY driver will handle >> the initialization of the associated eUSB2 repeater when required. >> >> Signed-off-by: Wesley Cheng >> Signed-off-by: Melody Olvera >> --- >> drivers/phy/qualcomm/Kconfig | 10 + >> drivers/phy/qualcomm/Makefile | 1 + >> drivers/phy/qualcomm/phy-qcom-m31-eusb2.c | 297 ++++++++++++++++++++++++++++++ >> 3 files changed, 308 insertions(+) >> >> diff --git a/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c >> new file mode 100644 >> index 0000000000000000000000000000000000000000..b18aab968122683e2e87287a4b570321d376870a >> --- /dev/null >> +++ b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c >> @@ -0,0 +1,297 @@ >> +// SPDX-License-Identifier: GPL-2.0+ > > GPL-2.0-only > Will fix. >> +/* >> + * Copyright (c) 2024-2025 Qualcomm Innovation Center, Inc. All rights reserved. >> + */ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include >> + >> +#define USB_PHY_UTMI_CTRL0 (0x3c) >> + >> +#define USB_PHY_UTMI_CTRL5 (0x50) >> + >> +#define USB_PHY_HS_PHY_CTRL_COMMON0 (0x54) >> +#define FSEL GENMASK(6, 4) >> +#define FSEL_38_4_MHZ_VAL (0x6) >> + >> +#define USB_PHY_HS_PHY_CTRL2 (0x64) >> + >> +#define USB_PHY_CFG0 (0x94) >> +#define USB_PHY_CFG1 (0x154) >> + >> +#define USB_PHY_FSEL_SEL (0xb8) >> + >> +#define USB_PHY_XCFGI_39_32 (0x16c) >> +#define USB_PHY_XCFGI_71_64 (0x17c) >> +#define USB_PHY_XCFGI_31_24 (0x168) >> +#define USB_PHY_XCFGI_7_0 (0x15c) >> + >> +#define M31_EUSB_PHY_INIT_CFG(o, b, v) \ >> +{ \ >> + .off = o, \ >> + .mask = b, \ >> + .val = v, \ >> +} >> + >> +struct m31_phy_tbl_entry { >> + u32 off; >> + u32 mask; >> + u32 val; >> +}; >> + >> +struct m31_eusb2_priv_data { >> + const struct m31_phy_tbl_entry *setup_seq; >> + unsigned int setup_seq_nregs; >> + const struct m31_phy_tbl_entry *override_seq; >> + unsigned int override_seq_nregs; >> + const struct m31_phy_tbl_entry *reset_seq; >> + unsigned int reset_seq_nregs; >> + unsigned int fsel; >> +}; >> + >> +static const struct m31_phy_tbl_entry m31_eusb2_setup_tbl[] = { >> + M31_EUSB_PHY_INIT_CFG(USB_PHY_CFG0, BIT(1), 1), >> + M31_EUSB_PHY_INIT_CFG(USB_PHY_UTMI_CTRL5, BIT(1), 1), >> + M31_EUSB_PHY_INIT_CFG(USB_PHY_CFG1, BIT(0), 1), >> + M31_EUSB_PHY_INIT_CFG(USB_PHY_FSEL_SEL, BIT(0), 1), > > I suppose, we can not expect to have #defines for all used bitfields? > Added the bitfields as requested. >> +}; >> + > > [...] > >> + >> +static const struct phy_ops m31eusb2_phy_gen_ops = { >> + .init = m31eusb2_phy_init, >> + .exit = m31eusb2_phy_exit, > > I think, you have a missing .set_mode callback here. > Added this to properly set the mode on the repeater as well. >> + .owner = THIS_MODULE, >> +}; >> + >> +static int m31eusb2_phy_probe(struct platform_device *pdev) >> +{ >> + struct phy_provider *phy_provider; >> + const struct m31_eusb2_priv_data *data; >> + struct device *dev = &pdev->dev; >> + struct m31eusb2_phy *phy; >> + int ret; >> + >> + phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); >> + if (!phy) >> + return -ENOMEM; >> + >> + data = of_device_get_match_data(dev); > > device_get_match_data() > Done. Thanks Wesley Cheng From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5731C36010 for ; Tue, 8 Apr 2025 02:33:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:CC:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iNJW3ZvaGDSivFw5Uhc5GYnp2aL6ndfoBzEMUgmmgFU=; b=G6haJH46GMvgGL gc4oo8OAG2wvsmS4oisPz8UAkYQjE5RmmGoSQYpF7bmUfXgYPNFy1UYyhMwBOmh3VrVgXYPPyD0JF 5BBG6wtKYRFo5jqNUX1yo3dIc+f5C21vWtojpK1j7DOow7Byjx4b8Ajqz75dkt9HRTheZ6H0zmCJ3 rGI+HtLueRrY7fZh4imow3arpbtuQIt3Rafqc+p2vgwet+rZDcxGgGwO20hiDktdo6LDtA1ALxGb7 qcdaKNgz2ZCDq6g4m/gcp06u0+NCiDcZGOdWEx1doYjjrAZvBrMv3yO5d9PTYwFm2Ti7+/oWrMgDc Nc+tbnT9Z2aejtsX647A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1u1ymL-00000002Wpo-1o65; Tue, 08 Apr 2025 02:33:33 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1u1ymI-00000002Wn1-2tT0; Tue, 08 Apr 2025 02:33:32 +0000 Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5382GPej019664; Tue, 8 Apr 2025 02:32:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 8tkLU/q9k4bzXOFaIPnKaXKZ9vxRAORbRLbV0GT2sj4=; b=SIAaWqhZKCRyXT5b LPOPvCKqjpkCu4mwv6zyomN6MHZkgmlw0so8HPOIgFTvYq9Cf0A5r6JjZrxaZXeX OvSmKVyc0wqaJiV6Ici0LY8qoLGCe9CFuvsFTbncuBBYcapvFSp6QRA+NlhNZBMA YZracMLeBdI3rOiAtyyfMvzSSgrV9iS26Q/4pRmCEW59Rb+JkDisEovKEPAZMAHx 8G92RknUmauD2coG9zoNEIUFGGyckGXdiK/JEne37Ai79LhaYsRwU7OyUnl9SneG MYCt2UZ2tEpMAw3SRTBU9KAAYZ8jF8DTs4J/VIldsAvFodejUY9NvJbK+gTiWQSq pD0VDg== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45twg3e566-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Apr 2025 02:32:56 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 5382WtF9000584 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 8 Apr 2025 02:32:55 GMT Received: from [10.110.75.38] (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Mon, 7 Apr 2025 19:32:54 -0700 Message-ID: <73499d82-e7e5-b88a-41a4-160529efc988@quicinc.com> Date: Mon, 7 Apr 2025 19:32:53 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v3 06/10] phy: qcom: Add M31 based eUSB2 PHY driver Content-Language: en-US To: Dmitry Baryshkov , Melody Olvera CC: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , Philipp Zabel , "Bjorn Andersson" , Konrad Dybcio , Catalin Marinas , Will Deacon , , , , , , References: <20250324-sm8750_usb_master-v3-0-13e096dc88fd@quicinc.com> <20250324-sm8750_usb_master-v3-6-13e096dc88fd@quicinc.com> From: Wesley Cheng In-Reply-To: X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 21XJomGnkL8m6ur2pvtTBprBrwIZ3tQc X-Proofpoint-ORIG-GUID: 21XJomGnkL8m6ur2pvtTBprBrwIZ3tQc X-Authority-Analysis: v=2.4 cv=I/9lRMgg c=1 sm=1 tr=0 ts=67f48ad8 cx=c_pps a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=XR8D0OoHHMoA:10 a=COk6AnOGAAAA:8 a=IJHOkPr1J-CqusO2T_sA:9 a=QEXdDO2ut3YA:10 a=RVmHIydaz68A:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-07_07,2025-04-07_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 lowpriorityscore=0 spamscore=0 clxscore=1015 malwarescore=0 adultscore=0 priorityscore=1501 impostorscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504080016 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250407_193330_875460_F2D8E0C7 X-CRM114-Status: GOOD ( 20.50 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Hi Dmitry, On 3/26/2025 7:33 AM, Dmitry Baryshkov wrote: > On Mon, Mar 24, 2025 at 01:18:34PM -0700, Melody Olvera wrote: >> From: Wesley Cheng >> >> SM8750 utilizes an eUSB2 PHY from M31. Add the initialization >> sequences to bring it out of reset and into an operational state. This >> differs to the M31 USB driver, in that the M31 eUSB2 driver will >> require a connection to an eUSB2 repeater. This PHY driver will handle >> the initialization of the associated eUSB2 repeater when required. >> >> Signed-off-by: Wesley Cheng >> Signed-off-by: Melody Olvera >> --- >> drivers/phy/qualcomm/Kconfig | 10 + >> drivers/phy/qualcomm/Makefile | 1 + >> drivers/phy/qualcomm/phy-qcom-m31-eusb2.c | 297 ++++++++++++++++++++++++++++++ >> 3 files changed, 308 insertions(+) >> >> diff --git a/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c >> new file mode 100644 >> index 0000000000000000000000000000000000000000..b18aab968122683e2e87287a4b570321d376870a >> --- /dev/null >> +++ b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c >> @@ -0,0 +1,297 @@ >> +// SPDX-License-Identifier: GPL-2.0+ > > GPL-2.0-only > Will fix. >> +/* >> + * Copyright (c) 2024-2025 Qualcomm Innovation Center, Inc. All rights reserved. >> + */ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include >> + >> +#define USB_PHY_UTMI_CTRL0 (0x3c) >> + >> +#define USB_PHY_UTMI_CTRL5 (0x50) >> + >> +#define USB_PHY_HS_PHY_CTRL_COMMON0 (0x54) >> +#define FSEL GENMASK(6, 4) >> +#define FSEL_38_4_MHZ_VAL (0x6) >> + >> +#define USB_PHY_HS_PHY_CTRL2 (0x64) >> + >> +#define USB_PHY_CFG0 (0x94) >> +#define USB_PHY_CFG1 (0x154) >> + >> +#define USB_PHY_FSEL_SEL (0xb8) >> + >> +#define USB_PHY_XCFGI_39_32 (0x16c) >> +#define USB_PHY_XCFGI_71_64 (0x17c) >> +#define USB_PHY_XCFGI_31_24 (0x168) >> +#define USB_PHY_XCFGI_7_0 (0x15c) >> + >> +#define M31_EUSB_PHY_INIT_CFG(o, b, v) \ >> +{ \ >> + .off = o, \ >> + .mask = b, \ >> + .val = v, \ >> +} >> + >> +struct m31_phy_tbl_entry { >> + u32 off; >> + u32 mask; >> + u32 val; >> +}; >> + >> +struct m31_eusb2_priv_data { >> + const struct m31_phy_tbl_entry *setup_seq; >> + unsigned int setup_seq_nregs; >> + const struct m31_phy_tbl_entry *override_seq; >> + unsigned int override_seq_nregs; >> + const struct m31_phy_tbl_entry *reset_seq; >> + unsigned int reset_seq_nregs; >> + unsigned int fsel; >> +}; >> + >> +static const struct m31_phy_tbl_entry m31_eusb2_setup_tbl[] = { >> + M31_EUSB_PHY_INIT_CFG(USB_PHY_CFG0, BIT(1), 1), >> + M31_EUSB_PHY_INIT_CFG(USB_PHY_UTMI_CTRL5, BIT(1), 1), >> + M31_EUSB_PHY_INIT_CFG(USB_PHY_CFG1, BIT(0), 1), >> + M31_EUSB_PHY_INIT_CFG(USB_PHY_FSEL_SEL, BIT(0), 1), > > I suppose, we can not expect to have #defines for all used bitfields? > Added the bitfields as requested. >> +}; >> + > > [...] > >> + >> +static const struct phy_ops m31eusb2_phy_gen_ops = { >> + .init = m31eusb2_phy_init, >> + .exit = m31eusb2_phy_exit, > > I think, you have a missing .set_mode callback here. > Added this to properly set the mode on the repeater as well. >> + .owner = THIS_MODULE, >> +}; >> + >> +static int m31eusb2_phy_probe(struct platform_device *pdev) >> +{ >> + struct phy_provider *phy_provider; >> + const struct m31_eusb2_priv_data *data; >> + struct device *dev = &pdev->dev; >> + struct m31eusb2_phy *phy; >> + int ret; >> + >> + phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); >> + if (!phy) >> + return -ENOMEM; >> + >> + data = of_device_get_match_data(dev); > > device_get_match_data() > Done. Thanks Wesley Cheng -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy