[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <03f001d97375$d0d1ab70$72750250$@trustnetic.com>
Date: Thu, 20 Apr 2023 18:49:43 +0800
From: Jiawen Wu <jiawenwu@...stnetic.com>
To: "'Jarkko Nikula'" <jarkko.nikula@...ux.intel.com>
Cc: <linux-i2c@...r.kernel.org>, <linux-gpio@...r.kernel.org>,
<olteanv@...il.com>, <mengyuanlou@...-swift.com>,
<netdev@...r.kernel.org>, <linux@...linux.org.uk>
Subject: RE: [PATCH net-next v3 2/8] i2c: designware: Add driver support for Wangxun 10Gb NIC
> > --- 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?
Powered by blists - more mailing lists