From: andy.shevchenko@gmail.com
To: Jiawen Wu <jiawenwu@trustnetic.com>
Cc: netdev@vger.kernel.org, jarkko.nikula@linux.intel.com,
andriy.shevchenko@linux.intel.com,
mika.westerberg@linux.intel.com, jsd@semihalf.com,
ose.Abreu@synopsys.com, andrew@lunn.ch, hkallweit1@gmail.com,
linux@armlinux.org.uk, linux-i2c@vger.kernel.org,
linux-gpio@vger.kernel.org, mengyuanlou@net-swift.com
Subject: Re: [RFC PATCH net-next v5 4/9] net: txgbe: Register I2C platform device
Date: Wed, 26 Apr 2023 19:19:14 +0300 [thread overview]
Message-ID: <ZElPAnXAM-EwbUNe@surfacebook> (raw)
In-Reply-To: <20230426071434.452717-5-jiawenwu@trustnetic.com>
Wed, Apr 26, 2023 at 03:14:29PM +0800, Jiawen Wu kirjoitti:
> Register the platform device to use Designware I2C bus master driver.
...
> +static int txgbe_i2c_register(struct txgbe *txgbe)
> +{
> + struct pci_dev *pdev = txgbe->wx->pdev;
> + struct platform_device_info info = {};
> + struct platform_device *i2c_dev;
> + struct resource res[2] = {};
> +
> + info.parent = &pdev->dev;
> + info.fwnode = software_node_fwnode(txgbe->nodes.group[SWNODE_I2C]);
> + info.name = "i2c_designware";
> + info.id = (pdev->bus->number << 8) | pdev->devfn;
> + res[0].start = pci_resource_start(pdev, 0) + TXGBE_I2C_BASE;
> + res[0].end = pci_resource_start(pdev, 0) + TXGBE_I2C_BASE + 0x100 - 1;
> + res[0].flags = IORESOURCE_MEM;
DEFINE_RES_MEM()
> + res[1].start = pdev->irq;
> + res[1].end = pdev->irq;
> + res[1].flags = IORESOURCE_IRQ;
DEFINE_RES_IRQ()
> + info.res = res;
> + info.num_res = 2;
ARRAY_SIZE()
> + i2c_dev = platform_device_register_full(&info);
> + if (IS_ERR(i2c_dev))
> + return PTR_ERR(i2c_dev);
> +
> + txgbe->i2c_dev = i2c_dev;
> +
> + return 0;
> +}
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-04-26 16:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-26 7:14 [RFC PATCH net-next v5 0/9] TXGBE PHYLINK support Jiawen Wu
2023-04-26 7:14 ` [RFC PATCH net-next v5 1/9] net: txgbe: Add software nodes to support phylink Jiawen Wu
2023-04-28 20:47 ` Simon Horman
2023-04-26 7:14 ` [RFC PATCH net-next v5 2/9] i2c: designware: Add driver support for Wangxun 10Gb NIC Jiawen Wu
2023-04-26 15:45 ` andy.shevchenko
2023-04-27 2:15 ` Jiawen Wu
2023-04-27 5:57 ` Andy Shevchenko
2023-04-27 6:56 ` Jiawen Wu
2023-04-27 10:42 ` Andy Shevchenko
2023-04-27 7:25 ` Jiawen Wu
2023-04-26 7:14 ` [RFC PATCH net-next v5 3/9] net: txgbe: Register fixed rate clock Jiawen Wu
2023-04-26 7:14 ` [RFC PATCH net-next v5 4/9] net: txgbe: Register I2C platform device Jiawen Wu
2023-04-26 16:19 ` andy.shevchenko [this message]
2023-04-26 7:14 ` [RFC PATCH net-next v5 5/9] net: txgbe: Add SFP module identify Jiawen Wu
2023-04-26 7:14 ` [RFC PATCH net-next v5 6/9] net: txgbe: Support GPIO to SFP socket Jiawen Wu
2023-04-26 7:14 ` [RFC PATCH net-next v5 7/9] net: pcs: Add 10GBASE-R mode for Synopsys Designware XPCS Jiawen Wu
2023-05-02 8:03 ` Russell King (Oracle)
2023-04-26 7:14 ` [RFC PATCH net-next v5 8/9] net: txgbe: Implement phylink pcs Jiawen Wu
2023-04-26 7:14 ` [RFC PATCH net-next v5 9/9] net: txgbe: Support phylink MAC layer 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=ZElPAnXAM-EwbUNe@surfacebook \
--to=andy.shevchenko@gmail.com \
--cc=andrew@lunn.ch \
--cc=andriy.shevchenko@linux.intel.com \
--cc=hkallweit1@gmail.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=jiawenwu@trustnetic.com \
--cc=jsd@semihalf.com \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mengyuanlou@net-swift.com \
--cc=mika.westerberg@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=ose.Abreu@synopsys.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).