vitesse-vsc73xx.h 707 B

123456789101112131415161718192021222324252627282930
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #include <linux/device.h>
  3. #include <linux/etherdevice.h>
  4. #include <linux/gpio/driver.h>
  5. /**
  6. * struct vsc73xx - VSC73xx state container
  7. */
  8. struct vsc73xx {
  9. struct device *dev;
  10. struct gpio_desc *reset;
  11. struct dsa_switch *ds;
  12. struct gpio_chip gc;
  13. u16 chipid;
  14. u8 addr[ETH_ALEN];
  15. const struct vsc73xx_ops *ops;
  16. void *priv;
  17. };
  18. struct vsc73xx_ops {
  19. int (*read)(struct vsc73xx *vsc, u8 block, u8 subblock, u8 reg,
  20. u32 *val);
  21. int (*write)(struct vsc73xx *vsc, u8 block, u8 subblock, u8 reg,
  22. u32 val);
  23. };
  24. int vsc73xx_is_addr_valid(u8 block, u8 subblock);
  25. int vsc73xx_probe(struct vsc73xx *vsc);
  26. int vsc73xx_remove(struct vsc73xx *vsc);