All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jiawen Wu" <jiawenwu@trustnetic.com>
To: "'Andy Shevchenko'" <andriy.shevchenko@linux.intel.com>,
	<jarkko.nikula@linux.intel.com>
Cc: <netdev@vger.kernel.org>, <andrew@lunn.ch>,
	<linux@armlinux.org.uk>, <olteanv@gmail.com>,
	<hkallweit1@gmail.com>, <linux-i2c@vger.kernel.org>,
	<linux-gpio@vger.kernel.org>, <mengyuanlou@net-swift.com>
Subject: RE: [PATCH net-next v4 2/8] i2c: designware: Add driver support for Wangxun 10Gb NIC
Date: Mon, 24 Apr 2023 10:39:10 +0800	[thread overview]
Message-ID: <003801d97655$f2dc4580$d894d080$@trustnetic.com> (raw)
In-Reply-To: <ZEQKlSIIZi9941Bh@smile.fi.intel.com>

> > +++ b/include/linux/platform_data/i2c-dw.h
> 
> No way we need this in a new code.
> 
> > +struct dw_i2c_platform_data {
> > +	void __iomem *base;
> 
> You should use regmap.
> 
> > +	unsigned int flags;
> > +	unsigned int ss_hcnt;
> > +	unsigned int ss_lcnt;
> > +	unsigned int fs_hcnt;
> > +	unsigned int fs_lcnt;
> 
> No, use device properties.
> 
> > +};
> 
> --
> With Best Regards,
> Andy Shevchenko
> 

Is it acceptable to add such a function into dw_i2c_plat_probe()?
Otherwise I really can't find a way to get these parameters without DT and ACPI.

+static void i2c_dw_parse_property(struct dw_i2c_dev *dev)
+{
+       if (!is_software_node(dev_fwnode(dev->dev)))
+               return;
+
+       if (!dev->flags)
+               device_property_read_u32(dev->dev, "dw-i2c-flags", &dev->flags);
+
+       device_property_read_u16(dev->dev, "i2c-ss-scl-hcnt", &dev->ss_hcnt);
+       device_property_read_u16(dev->dev, "i2c-ss-scl-lcnt", &dev->ss_lcnt);
+       device_property_read_u16(dev->dev, "i2c-fs-scl-hcnt", &dev->fs_hcnt);
+       device_property_read_u16(dev->dev, "i2c-fs-scl-lcnt", &dev->fs_lcnt);
+
+       if (!dev->ss_hcnt || !dev->ss_lcnt) {
+               dev->ss_hcnt = 6;
+               dev->ss_lcnt = 8;
+       }
+       if (!dev->fs_hcnt || !dev->fs_lcnt) {
+               dev->fs_hcnt = 6;
+               dev->fs_lcnt = 8;
+       }
+}




  parent reply	other threads:[~2023-04-24  2:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-22  4:56 [PATCH net-next v4 0/8] TXGBE PHYLINK support Jiawen Wu
2023-04-22  4:56 ` [PATCH net-next v4 1/8] net: txgbe: Add software nodes to support phylink Jiawen Wu
2023-04-23 19:47   ` Simon Horman
2023-04-22  4:56 ` [PATCH net-next v4 2/8] i2c: designware: Add driver support for Wangxun 10Gb NIC Jiawen Wu
2023-04-22 16:25   ` Andy Shevchenko
2023-04-23  2:31     ` Jiawen Wu
2023-04-24 13:28       ` 'Andy Shevchenko'
2023-04-24  2:39     ` Jiawen Wu [this message]
2023-04-25 14:08     ` Andi Shyti
2023-05-01 18:28       ` Andy Shevchenko
2023-04-22  4:56 ` [PATCH net-next v4 3/8] net: txgbe: Register I2C platform device Jiawen Wu
2023-04-25 15:06   ` Andi Shyti
2023-04-25 15:16     ` Andi Shyti
2023-04-22  4:56 ` [PATCH net-next v4 4/8] net: txgbe: Add SFP module identify Jiawen Wu
2023-04-22  4:56 ` [PATCH net-next v4 5/8] net: txgbe: Support GPIO to SFP socket Jiawen Wu
2023-04-22  4:56 ` [PATCH net-next v4 6/8] net: pcs: Add 10GBASE-R mode for Synopsys Designware XPCS Jiawen Wu
2023-05-02  8:01   ` Russell King (Oracle)
2023-04-22  4:56 ` [PATCH net-next v4 7/8] net: txgbe: Implement phylink pcs Jiawen Wu
2023-04-22  4:56 ` [PATCH net-next v4 8/8] net: txgbe: Support phylink MAC layer Jiawen Wu
2023-04-23 19:57   ` Simon Horman
2023-04-24  1:49     ` Jiawen Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='003801d97655$f2dc4580$d894d080$@trustnetic.com' \
    --to=jiawenwu@trustnetic.com \
    --cc=andrew@lunn.ch \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=hkallweit1@gmail.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mengyuanlou@net-swift.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.