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 A3E4BC77B7C for ; Thu, 20 Apr 2023 10:54:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234946AbjDTKyK (ORCPT ); Thu, 20 Apr 2023 06:54:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234452AbjDTKxy (ORCPT ); Thu, 20 Apr 2023 06:53:54 -0400 Received: from smtpbgsg1.qq.com (smtpbgsg1.qq.com [54.254.200.92]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81F279751; Thu, 20 Apr 2023 03:51:22 -0700 (PDT) X-QQ-mid: Yeas43t1681987787t800t23682 Received: from 7082A6556EBF4E69829842272A565F7C (jiawenwu@trustnetic.com [183.129.236.74]) X-QQ-SSF: 00400000000000F0FM9000000000000 From: =?utf-8?b?Smlhd2VuIFd1?= X-BIZMAIL-ID: 2097433834087169050 To: "'Jarkko Nikula'" Cc: , , , , , References: <20230419082739.295180-1-jiawenwu@trustnetic.com> <20230419082739.295180-3-jiawenwu@trustnetic.com> In-Reply-To: Subject: RE: [PATCH net-next v3 2/8] i2c: designware: Add driver support for Wangxun 10Gb NIC Date: Thu, 20 Apr 2023 18:49:43 +0800 Message-ID: <03f001d97375$d0d1ab70$72750250$@trustnetic.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Content-Language: zh-cn Thread-Index: AQILBR3gZkFBC9g1wrfKT5ke1rRywwLGjwA7AVhX+x6ur+k8sA== X-QQ-SENDSIZE: 520 Feedback-ID: Yeas:trustnetic.com:qybglogicsvr:qybglogicsvr5 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > > --- a/drivers/i2c/busses/i2c-designware-platdrv.c > > +++ b/drivers/i2c/busses/i2c-designware-platdrv.c > > > +static void dw_i2c_get_plat_data(struct dw_i2c_dev *dev) > > +{ > > + struct platform_device *pdev = to_platform_device(dev->dev); > > + struct dw_i2c_platform_data *pdata; > > + > > + pdata = dev_get_platdata(&pdev->dev); > > + if (!pdata) > > + return; > > + > > + dev->flags |= pdata->flags; > > + dev->base = pdata->base; > > + > > + if (pdata->ss_hcnt && pdata->ss_lcnt) { > > + dev->ss_hcnt = pdata->ss_hcnt; > > + dev->ss_lcnt = pdata->ss_lcnt; > > + } else { > > + dev->ss_hcnt = 6; > > + dev->ss_lcnt = 8; > > + } > > + > > + if (pdata->fs_hcnt && pdata->fs_lcnt) { > > + dev->fs_hcnt = pdata->fs_hcnt; > > + dev->fs_lcnt = pdata->fs_lcnt; > > + } else { > > + dev->fs_hcnt = 6; > > + dev->fs_lcnt = 8; > > + } > > +} > > + > > static const struct dmi_system_id dw_i2c_hwmon_class_dmi[] = { > > { > > .ident = "Qtechnology QT5222", > > @@ -282,6 +314,8 @@ static int dw_i2c_plat_probe(struct platform_device *pdev) > > dev->irq = irq; > > platform_set_drvdata(pdev, dev); > > > > + dw_i2c_get_plat_data(dev); > > + > Instead of this added code would it be possible to use generic timing > parameters which can come either from firmware or code? Those are > handled already here by the call to i2c_parse_fw_timings(). > > Then drivers/i2c/busses/i2c-designware-master.c: > i2c_dw_set_timings_master() takes care of calculating Designware > specific hcnt/lcnt timing parameters from those generic values. > I am confused about why fs_hcnt/fs_lcnt must be set when I use the standard mode?