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 A9A3CC7618E for ; Wed, 26 Apr 2023 16:19:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234500AbjDZQTY (ORCPT ); Wed, 26 Apr 2023 12:19:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233315AbjDZQTX (ORCPT ); Wed, 26 Apr 2023 12:19:23 -0400 Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C43587A94 for ; Wed, 26 Apr 2023 09:19:17 -0700 (PDT) Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id 15da8e56-e44e-11ed-b972-005056bdfda7; Wed, 26 Apr 2023 19:19:15 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Wed, 26 Apr 2023 19:19:14 +0300 To: Jiawen Wu 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 Message-ID: References: <20230426071434.452717-1-jiawenwu@trustnetic.com> <20230426071434.452717-5-jiawenwu@trustnetic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230426071434.452717-5-jiawenwu@trustnetic.com> Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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