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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A55CC433FE for ; Wed, 1 Jun 2022 02:09:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349103AbiFACJJ (ORCPT ); Tue, 31 May 2022 22:09:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231168AbiFACJI (ORCPT ); Tue, 31 May 2022 22:09:08 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA9D28BD03; Tue, 31 May 2022 19:09:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1654049347; x=1685585347; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=3EQ1f05IzxUDg+A5ZX7MGnnHFtboIohy1TiDF2TvXP4=; b=YCKinBalqmithB7Jvzgzzq1U9qiIYpSYeTWlbkGfbkl6ERbr3/2Kv9+m L7PxRx+2TMw98mAl+Tet6Nwu7XfHwgekvyIbskRKzXeZRhz4cIm7+mAw2 vD/LRWLC4H3iRYNQNMW/asS7N6QfQrurvUQqxJLO7OmLp836unr/8eYj1 0=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-02.qualcomm.com with ESMTP; 31 May 2022 19:09:06 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-SD-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 19:09:06 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 31 May 2022 19:09:06 -0700 Received: from hu-pkondeti-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 31 May 2022 19:09:00 -0700 Date: Wed, 1 Jun 2022 07:38:56 +0530 From: Pavan Kondeti To: Krishna Kurapati CC: Krzysztof Kozlowski , Rob Herring , Andy Gross , Bjorn Andersson , Greg Kroah-Hartman , Stephen Boyd , "Doug Anderson" , Matthias Kaehlcke , Wesley Cheng , , , , , , , , Subject: Re: [PATCH v7 2/3] phy: qcom-snps: Add support for overriding phy tuning parameters Message-ID: <20220601020856.GA20979@hu-pkondeti-hyd.qualcomm.com> References: <1654013693-21484-1-git-send-email-quic_kriskura@quicinc.com> <1654013693-21484-3-git-send-email-quic_kriskura@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1654013693-21484-3-git-send-email-quic_kriskura@quicinc.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Tue, May 31, 2022 at 09:44:52PM +0530, Krishna Kurapati wrote: > Add support for overriding electrical signal tuning parameters for > SNPS HS Phy. > > Signed-off-by: Krishna Kurapati > --- > drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 268 +++++++++++++++++++++++++- > 1 file changed, 266 insertions(+), 2 deletions(-) > > diff --git a/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c b/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c > index 5d20378..3a17216 100644 > --- a/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c > +++ b/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c > @@ -52,6 +52,12 @@ > #define USB2_SUSPEND_N BIT(2) > #define USB2_SUSPEND_N_SEL BIT(3) > > +static void qcom_snps_hsphy_override_param_update_val( > + const struct override_param_map map, > + s32 dt_val, struct phy_override_seq *seq_entry) > +{ > + int i; > + > + /* > + * Param table for each param is in increasing order > + * of dt values. We need to iterate over the list to > + * select the entry that has equal or the next highest value. > + */ > + for (i = 0; i < map.table_size - 1; i++) { > + if (map.param_table[i].value >= dt_val) > + break; > + } > + > + seq_entry->need_update = true; > + seq_entry->offset = map.reg_offset; > + seq_entry->mask = map.param_mask; > + seq_entry->value = map.param_table[i].reg << __ffs(map.param_mask); > +} > + > +static void qcom_snps_hsphy_read_override_param_seq(struct device *dev) > +{ > + struct device_node *node = dev->of_node; > + s32 val; > + int ret, i; > + struct qcom_snps_hsphy *hsphy; > + const struct override_param_map *cfg = > + (struct override_param_map *) of_device_get_match_data(dev); As mentioned in the previous patch-set, the explicit typecast is not needed. overall, looks good to me. After fixing the above, feel free to use Reviewed-by: Pavankumar Kondeti Thanks, Pavan 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 0151DC433F5 for ; Wed, 1 Jun 2022 02:09:17 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Wa8CqedhlQOzf/NZ3Plq9UPfMncChTfn3K9GEK1njqE=; b=Z078AzfVwh+Tzl lKpQm/+Vy1187p+2iKDsyvgLGg4pF/ZZthboi4nP1pXIy3Lvj4TJWZONzFaKx+YYo9JodF/NH+HV/ 7qtPZZTS3CPCoHWk/TJNLJ+j6/MUTgaA/o+3IWoDAc+qR+zt91FkSA0uR63wYoC7tJ+C/WyekP/Ku 6EIC6tXOm5Gc7yKW8HPGRF8KM9hDGx6wMz4Lb9EnhCuJU+lYm8P2OY2Pr74nsEBxa8XNzbG5e1UPs RPAkgfSPaTWjjO08i1SAI7ejC0DcUOrCMVIZOGXoOtGA+x3InFd5Lvlj0hg4zWtumE5zs+gQqxNnl ZvsJorCiXXGlEQxlVpEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwDnR-00DMjX-82; Wed, 01 Jun 2022 02:09:17 +0000 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwDnO-00DMiQ-GP for linux-phy@lists.infradead.org; Wed, 01 Jun 2022 02:09:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1654049354; x=1685585354; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=3EQ1f05IzxUDg+A5ZX7MGnnHFtboIohy1TiDF2TvXP4=; b=zZRtFKhDI4CybrYmFdU15dCKr1y0oQJRgP7Drign/CngFkWUoXD3oAtC RMwnLkmZFYNLztbqYgywE3REBZOQCIpmgpHK/+xV5U4cRhQlyoCnuiiHd Jnb/JZKi+tZvPVkBLkUzzHrT9WM3cEN7sRZbOqi+/RCiSa1hqbqSjB2Wo E=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-02.qualcomm.com with ESMTP; 31 May 2022 19:09:06 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-SD-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 19:09:06 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 31 May 2022 19:09:06 -0700 Received: from hu-pkondeti-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 31 May 2022 19:09:00 -0700 Date: Wed, 1 Jun 2022 07:38:56 +0530 From: Pavan Kondeti To: Krishna Kurapati CC: Krzysztof Kozlowski , Rob Herring , Andy Gross , Bjorn Andersson , Greg Kroah-Hartman , Stephen Boyd , "Doug Anderson" , Matthias Kaehlcke , Wesley Cheng , , , , , , , , Subject: Re: [PATCH v7 2/3] phy: qcom-snps: Add support for overriding phy tuning parameters Message-ID: <20220601020856.GA20979@hu-pkondeti-hyd.qualcomm.com> References: <1654013693-21484-1-git-send-email-quic_kriskura@quicinc.com> <1654013693-21484-3-git-send-email-quic_kriskura@quicinc.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1654013693-21484-3-git-send-email-quic_kriskura@quicinc.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220531_190914_613733_3D744BDC X-CRM114-Status: GOOD ( 19.59 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org On Tue, May 31, 2022 at 09:44:52PM +0530, Krishna Kurapati wrote: > Add support for overriding electrical signal tuning parameters for > SNPS HS Phy. > > Signed-off-by: Krishna Kurapati > --- > drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 268 +++++++++++++++++++++++++- > 1 file changed, 266 insertions(+), 2 deletions(-) > > diff --git a/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c b/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c > index 5d20378..3a17216 100644 > --- a/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c > +++ b/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c > @@ -52,6 +52,12 @@ > #define USB2_SUSPEND_N BIT(2) > #define USB2_SUSPEND_N_SEL BIT(3) > > +static void qcom_snps_hsphy_override_param_update_val( > + const struct override_param_map map, > + s32 dt_val, struct phy_override_seq *seq_entry) > +{ > + int i; > + > + /* > + * Param table for each param is in increasing order > + * of dt values. We need to iterate over the list to > + * select the entry that has equal or the next highest value. > + */ > + for (i = 0; i < map.table_size - 1; i++) { > + if (map.param_table[i].value >= dt_val) > + break; > + } > + > + seq_entry->need_update = true; > + seq_entry->offset = map.reg_offset; > + seq_entry->mask = map.param_mask; > + seq_entry->value = map.param_table[i].reg << __ffs(map.param_mask); > +} > + > +static void qcom_snps_hsphy_read_override_param_seq(struct device *dev) > +{ > + struct device_node *node = dev->of_node; > + s32 val; > + int ret, i; > + struct qcom_snps_hsphy *hsphy; > + const struct override_param_map *cfg = > + (struct override_param_map *) of_device_get_match_data(dev); As mentioned in the previous patch-set, the explicit typecast is not needed. overall, looks good to me. After fixing the above, feel free to use Reviewed-by: Pavankumar Kondeti Thanks, Pavan -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy