[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240823030242.3083528-2-jiawenwu@trustnetic.com>
Date: Fri, 23 Aug 2024 11:02:40 +0800
From: Jiawen Wu <jiawenwu@...stnetic.com>
To: andi.shyti@...nel.org,
jarkko.nikula@...ux.intel.com,
andriy.shevchenko@...ux.intel.com,
mika.westerberg@...ux.intel.com,
jsd@...ihalf.com,
davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
rmk+kernel@...linux.org.uk,
piotr.raczynski@...el.com,
andrew@...n.ch,
linux-i2c@...r.kernel.org,
netdev@...r.kernel.org
Cc: mengyuanlou@...-swift.com,
duanqiangwen@...-swift.com,
Jiawen Wu <jiawenwu@...stnetic.com>,
stable@...r.kernel.org
Subject: [PATCH net 1/3] net: txgbe: add IO address in I2C platform device data
Consider the necessity of reading/writing the IO address to acquire and
release the lock between software and firmware, add the IO address as
the platform data to register I2C platform device.
Cc: stable@...r.kernel.org
Fixes: c625e72561f6 ("net: txgbe: Register I2C platform device")
Signed-off-by: Jiawen Wu <jiawenwu@...stnetic.com>
---
drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 5 +++++
include/linux/platform_data/i2c-wx.h | 11 +++++++++++
2 files changed, 16 insertions(+)
create mode 100644 include/linux/platform_data/i2c-wx.h
diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
index 5f502265f0a6..781a3a34aa4c 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
@@ -9,6 +9,7 @@
#include <linux/i2c.h>
#include <linux/pci.h>
#include <linux/platform_device.h>
+#include <linux/platform_data/i2c-wx.h>
#include <linux/regmap.h>
#include <linux/pcs/pcs-xpcs.h>
#include <linux/phylink.h>
@@ -618,6 +619,7 @@ static const struct regmap_config i2c_regmap_config = {
static int txgbe_i2c_register(struct txgbe *txgbe)
{
+ struct txgbe_i2c_platform_data pdata = {};
struct platform_device_info info = {};
struct platform_device *i2c_dev;
struct regmap *i2c_regmap;
@@ -636,6 +638,9 @@ static int txgbe_i2c_register(struct txgbe *txgbe)
info.fwnode = software_node_fwnode(txgbe->nodes.group[SWNODE_I2C]);
info.name = "i2c_designware";
info.id = pci_dev_id(pdev);
+ pdata.hw_addr = wx->hw_addr;
+ info.data = &pdata;
+ info.size_data = sizeof(pdata);
info.res = &DEFINE_RES_IRQ(pdev->irq);
info.num_res = 1;
diff --git a/include/linux/platform_data/i2c-wx.h b/include/linux/platform_data/i2c-wx.h
new file mode 100644
index 000000000000..b46777fa1d85
--- /dev/null
+++ b/include/linux/platform_data/i2c-wx.h
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright (c) 2015 - 2024 Beijing WangXun Technology Co., Ltd. */
+
+#ifndef _I2C_WX_H_
+#define _I2C_WX_H_
+
+struct txgbe_i2c_platform_data {
+ void __iomem *hw_addr;
+};
+
+#endif /* _I2C_WX_H_ */
--
2.27.0
Powered by blists - more mailing lists