0001
0002 #include <linux/device.h>
0003 #include <linux/etherdevice.h>
0004 #include <linux/gpio/driver.h>
0005
0006
0007
0008
0009 struct vsc73xx {
0010 struct device *dev;
0011 struct gpio_desc *reset;
0012 struct dsa_switch *ds;
0013 struct gpio_chip gc;
0014 u16 chipid;
0015 u8 addr[ETH_ALEN];
0016 const struct vsc73xx_ops *ops;
0017 void *priv;
0018 };
0019
0020 struct vsc73xx_ops {
0021 int (*read)(struct vsc73xx *vsc, u8 block, u8 subblock, u8 reg,
0022 u32 *val);
0023 int (*write)(struct vsc73xx *vsc, u8 block, u8 subblock, u8 reg,
0024 u32 val);
0025 };
0026
0027 int vsc73xx_is_addr_valid(u8 block, u8 subblock);
0028 int vsc73xx_probe(struct vsc73xx *vsc);
0029 void vsc73xx_remove(struct vsc73xx *vsc);
0030 void vsc73xx_shutdown(struct vsc73xx *vsc);