lan9303.h 845 B

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