Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2468286rdg; Mon, 14 Aug 2023 03:42:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFWVRMZXD24Y64ch5ww2cGaRVWTsQY9/ujuo33vMDk/qxxtR8ZrZq/yW1UOM3u8rkSs5BtE X-Received: by 2002:a17:906:319b:b0:98f:8481:24b3 with SMTP id 27-20020a170906319b00b0098f848124b3mr8810642ejy.37.1692009770864; Mon, 14 Aug 2023 03:42:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692009770; cv=none; d=google.com; s=arc-20160816; b=DOdo/bDvAQDOWP62J1RliAusnldzBL7hkNp46brdjhQ9vFSq0nuNGuPZ1gvPMU8/Hp cTBojEBt7F8+c/9/rssxoArKafWaulgtOuW9tRar/DtLnb4D3gmb4tfgLa/u51WSO7zQ JCTiI8uvXpL5TeIl1dcp0LlBkXElLibC1allpOrjLJGTUPAhZR0RIs/Wza3QM5VM2PPf zeeBCnsXKClcqk9gERfrY9GifO3XqVLol3nd5HOsA1X2pmrvChghUCETDXvCpVlEOkej p8iCHBjfGFuvW5EaiqmSITHaLkX8UPHvhglfJ6SUskRxzBc7JgnFQ/3vzUlzDjoQUK5T hlTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=qwGYKRRRJZy7n3umlavxW3NBP3HkUrUEnBJxfTTq5Mc=; fh=jZw1HV1JcQlsfUhaQ9VZf6p5PYd3stlUmEdgcrmYt/Q=; b=oDA23qAa3USBfQn+2izIE3fAnji2w2POXgGkxAl2YizpXKk2KyN8Av011c5+48ODTw Vll85oqYz8gGmV+or4wzp2iCbBf0WbSG5vZ/N+yWaadEFZaZu8CkDJlrdcC27pRnPvlM 51wWBVwWo8JbPgaqcrPr3mL63XMhdCG7qpXcqyR7prsc2K5tEV6gAR2DJNCx/dSXM69V qwnGOxJGDNcPyyYcOavy/N6ksrynlQwktKzso/bxZCax3Q15RjR7W59x5OAalySioCCH W4CKneYqx31fXJLZ0HKYkB97n8NBn+o86mZXgPBM6zAJWjmbYCDks3g06KfYecD6Q20x MhyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=eqmEe3xS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h11-20020a170906110b00b009888b517932si7078456eja.333.2023.08.14.03.42.26; Mon, 14 Aug 2023 03:42:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=eqmEe3xS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233833AbjHNIgY (ORCPT + 99 others); Mon, 14 Aug 2023 04:36:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232346AbjHNIfw (ORCPT ); Mon, 14 Aug 2023 04:35:52 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B71E19C; Mon, 14 Aug 2023 01:35:51 -0700 (PDT) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37E8Dlfo014154; Mon, 14 Aug 2023 08:35:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=qcppdkim1; bh=qwGYKRRRJZy7n3umlavxW3NBP3HkUrUEnBJxfTTq5Mc=; b=eqmEe3xSGlfUQFPs7o1HW5VsB2Jmd37g/ylM8wjaj/W6Hh+ArlJ3pluPLlPZvIff9TKl vOOKTDpbVoRY6QvuGw48f1qltR+1e1ZKvo0TDRfW+l6dBmf20FcUnEt3fezYacfTxTnj GfaWaMTMvGvge9ccpN+kOuFz8hyImqaO26OeGLESlC1+4gJOIxDzgYlyCaBFnoD3ktgv CRtZKkMS4xkb5UaKfYa2QZ8lTgVMXImElPXBCVffyPxcW7VpT3tGILIFPxNZjBVBFvJx QrjPvMg7a5gSH3M+2sxxuEXdlKQs5jG7CdRNZG04iRktnjEjhRlg9a+/Wq+oDmo/T+9l 1A== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3sffxt83k3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Aug 2023 08:35:15 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 37E8ZEjU000903 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Aug 2023 08:35:14 GMT Received: from varda-linux.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Mon, 14 Aug 2023 01:35:07 -0700 Date: Mon, 14 Aug 2023 14:05:04 +0530 From: Varadarajan Narayanan To: Vinod Koul CC: , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v7 2/5] phy: qcom-m31: Introduce qcom,m31 USB phy driver Message-ID: <20230814083503.GA3490@varda-linux.qualcomm.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: DZ06qSZka_sIK-LlSDnwfR2sZa7D37gN X-Proofpoint-GUID: DZ06qSZka_sIK-LlSDnwfR2sZa7D37gN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-14_03,2023-08-10_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=899 spamscore=0 malwarescore=0 clxscore=1015 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308140079 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 11, 2023 at 09:30:05AM +0100, Vinod Koul wrote: > On 10-08-23, 15:26, Varadarajan Narayanan wrote: > > Add the M31 USB2 phy driver. > . > . > . > > +#include > > +#include > > +#include > > +#include > > do you need both headers..? > > . > . > . > > + #define FREQ_24MHZ (GENMASK(6, 6) | GENMASK(4, 4)) > > why not use bit :-) > . > . > . > > +struct m31_phy_regs m31_ipq5332_regs[] = { > > + { USB_PHY_CFG0, UTMI_PHY_OVERRIDE_EN, 0 }, > > + { USB_PHY_UTMI_CTRL5, POR_EN, 15 }, > > + { USB_PHY_FSEL_SEL, FREQ_SEL, 0 }, > > + { USB_PHY_HS_PHY_CTRL_COMMON0, COMMONONN | FREQ_24MHZ | RETENABLEN, 0 }, > > + { USB_PHY_UTMI_CTRL5, POR_EN, 0 }, > > + { USB_PHY_HS_PHY_CTRL2, USB2_SUSPEND_N_SEL | USB2_SUSPEND_N | USB2_UTMI_CLK_EN, 0 }, > > + { USB2PHY_USB_PHY_M31_XCFGI_11, XCFG_COARSE_TUNE_NUM | XCFG_FINE_TUNE_NUM, 0 }, > > + { USB2PHY_USB_PHY_M31_XCFGI_4, HSTX_SLEW_RATE_565PS | PLL_CHARGING_PUMP_CURRENT_35UA | > > + ODT_VALUE_38_02_OHM, 0 }, > > + { USB2PHY_USB_PHY_M31_XCFGI_1, USB2_0_TX_ENABLE, 0 }, > > + { USB2PHY_USB_PHY_M31_XCFGI_5, ODT_VALUE_45_02_OHM | HSTX_PRE_EMPHASIS_LEVEL_0_55MA, 4 }, > > + { USB_PHY_UTMI_CTRL5, 0x0, 0 }, > > + { USB_PHY_HS_PHY_CTRL2, USB2_SUSPEND_N | USB2_UTMI_CLK_EN, 0 }, > > More readable way to code > USB_PHY_CFG0, > UTMI_PHY_OVERRIDE_EN, > 0 > > and so on, makes a better read and check for errors, one line for off, > one for val and one for delay > > -- > `~Vinod Have posted a new version addressing these (and Konrad's and Bjorn's) issues. Please review. Thanks Varada