Lines Matching refs:hub

28 static void usb4604_reset(struct usb4604 *hub, int state)  in usb4604_reset()  argument
30 gpiod_set_value_cansleep(hub->gpio_reset, state); in usb4604_reset()
37 static int usb4604_connect(struct usb4604 *hub) in usb4604_connect() argument
39 struct device *dev = hub->dev; in usb4604_connect()
44 usb4604_reset(hub, 1); in usb4604_connect()
48 usb4604_reset(hub, 0); in usb4604_connect()
52 hub->mode = USB4604_MODE_HUB; in usb4604_connect()
58 static int usb4604_switch_mode(struct usb4604 *hub, enum usb4604_mode mode) in usb4604_switch_mode() argument
60 struct device *dev = hub->dev; in usb4604_switch_mode()
65 err = usb4604_connect(hub); in usb4604_switch_mode()
69 usb4604_reset(hub, 0); in usb4604_switch_mode()
82 static int usb4604_probe(struct usb4604 *hub) in usb4604_probe() argument
84 struct device *dev = hub->dev; in usb4604_probe()
92 hub->gpio_reset = gpio; in usb4604_probe()
94 if (of_property_read_u32(np, "initial-mode", &hub->mode)) in usb4604_probe()
95 hub->mode = mode; in usb4604_probe()
97 return usb4604_switch_mode(hub, hub->mode); in usb4604_probe()
102 struct usb4604 *hub; in usb4604_i2c_probe() local
104 hub = devm_kzalloc(&i2c->dev, sizeof(*hub), GFP_KERNEL); in usb4604_i2c_probe()
105 if (!hub) in usb4604_i2c_probe()
108 i2c_set_clientdata(i2c, hub); in usb4604_i2c_probe()
109 hub->dev = &i2c->dev; in usb4604_i2c_probe()
111 return usb4604_probe(hub); in usb4604_i2c_probe()
117 struct usb4604 *hub = i2c_get_clientdata(client); in usb4604_i2c_suspend() local
119 usb4604_switch_mode(hub, USB4604_MODE_STANDBY); in usb4604_i2c_suspend()
127 struct usb4604 *hub = i2c_get_clientdata(client); in usb4604_i2c_resume() local
129 usb4604_switch_mode(hub, hub->mode); in usb4604_i2c_resume()