1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #include <linux/regmap.h> 3 #include <linux/device.h> 4 #include <net/dsa.h> 5 6 struct lan9303; 7 8 struct lan9303_phy_ops { 9 /* PHY 1 and 2 access*/ 10 int (*phy_read)(struct lan9303 *chip, int port, int regnum); 11 int (*phy_write)(struct lan9303 *chip, int port, 12 int regnum, u16 val); 13 }; 14 15 struct lan9303 { 16 struct device *dev; 17 struct regmap *regmap; 18 struct regmap_irq_chip_data *irq_data; 19 struct gpio_desc *reset_gpio; 20 u32 reset_duration; /* in [ms] */ 21 bool phy_addr_sel_strap; 22 struct dsa_switch *ds; 23 struct mutex indirect_mutex; /* protect indexed register access */ 24 const struct lan9303_phy_ops *ops; 25 }; 26 27 extern const struct regmap_access_table lan9303_register_set; 28 extern const struct lan9303_phy_ops lan9303_indirect_phy_ops; 29 30 int lan9303_probe(struct lan9303 *chip, struct device_node *np); 31 int lan9303_remove(struct lan9303 *chip); 32