Lines Matching refs:info

63 	struct usb_extcon_info *info = container_of(to_delayed_work(work),  in usb_extcon_detect_cable()  local
68 id = info->id_gpiod ? in usb_extcon_detect_cable()
69 gpiod_get_value_cansleep(info->id_gpiod) : 1; in usb_extcon_detect_cable()
70 vbus = info->vbus_gpiod ? in usb_extcon_detect_cable()
71 gpiod_get_value_cansleep(info->vbus_gpiod) : id; in usb_extcon_detect_cable()
75 extcon_set_state_sync(info->edev, EXTCON_USB_HOST, false); in usb_extcon_detect_cable()
77 extcon_set_state_sync(info->edev, EXTCON_USB, false); in usb_extcon_detect_cable()
80 extcon_set_state_sync(info->edev, EXTCON_USB_HOST, true); in usb_extcon_detect_cable()
83 extcon_set_state_sync(info->edev, EXTCON_USB, true); in usb_extcon_detect_cable()
89 struct usb_extcon_info *info = dev_id; in usb_irq_handler() local
91 queue_delayed_work(system_power_efficient_wq, &info->wq_detcable, in usb_irq_handler()
92 info->debounce_jiffies); in usb_irq_handler()
101 struct usb_extcon_info *info; in usb_extcon_probe() local
107 info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); in usb_extcon_probe()
108 if (!info) in usb_extcon_probe()
111 info->dev = dev; in usb_extcon_probe()
112 info->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id", GPIOD_IN); in usb_extcon_probe()
113 info->vbus_gpiod = devm_gpiod_get_optional(&pdev->dev, "vbus", in usb_extcon_probe()
116 if (!info->id_gpiod && !info->vbus_gpiod) { in usb_extcon_probe()
121 if (IS_ERR(info->id_gpiod)) in usb_extcon_probe()
122 return PTR_ERR(info->id_gpiod); in usb_extcon_probe()
124 if (IS_ERR(info->vbus_gpiod)) in usb_extcon_probe()
125 return PTR_ERR(info->vbus_gpiod); in usb_extcon_probe()
127 info->edev = devm_extcon_dev_allocate(dev, usb_extcon_cable); in usb_extcon_probe()
128 if (IS_ERR(info->edev)) { in usb_extcon_probe()
133 ret = devm_extcon_dev_register(dev, info->edev); in usb_extcon_probe()
139 if (info->id_gpiod) in usb_extcon_probe()
140 ret = gpiod_set_debounce(info->id_gpiod, in usb_extcon_probe()
142 if (!ret && info->vbus_gpiod) in usb_extcon_probe()
143 ret = gpiod_set_debounce(info->vbus_gpiod, in usb_extcon_probe()
147 info->debounce_jiffies = msecs_to_jiffies(USB_GPIO_DEBOUNCE_MS); in usb_extcon_probe()
149 INIT_DELAYED_WORK(&info->wq_detcable, usb_extcon_detect_cable); in usb_extcon_probe()
151 if (info->id_gpiod) { in usb_extcon_probe()
152 info->id_irq = gpiod_to_irq(info->id_gpiod); in usb_extcon_probe()
153 if (info->id_irq < 0) { in usb_extcon_probe()
155 return info->id_irq; in usb_extcon_probe()
158 ret = devm_request_threaded_irq(dev, info->id_irq, NULL, in usb_extcon_probe()
162 pdev->name, info); in usb_extcon_probe()
169 if (info->vbus_gpiod) { in usb_extcon_probe()
170 info->vbus_irq = gpiod_to_irq(info->vbus_gpiod); in usb_extcon_probe()
171 if (info->vbus_irq < 0) { in usb_extcon_probe()
173 return info->vbus_irq; in usb_extcon_probe()
176 ret = devm_request_threaded_irq(dev, info->vbus_irq, NULL, in usb_extcon_probe()
180 pdev->name, info); in usb_extcon_probe()
187 platform_set_drvdata(pdev, info); in usb_extcon_probe()
191 usb_extcon_detect_cable(&info->wq_detcable.work); in usb_extcon_probe()
198 struct usb_extcon_info *info = platform_get_drvdata(pdev); in usb_extcon_remove() local
200 cancel_delayed_work_sync(&info->wq_detcable); in usb_extcon_remove()
209 struct usb_extcon_info *info = dev_get_drvdata(dev); in usb_extcon_suspend() local
213 if (info->id_gpiod) { in usb_extcon_suspend()
214 ret = enable_irq_wake(info->id_irq); in usb_extcon_suspend()
218 if (info->vbus_gpiod) { in usb_extcon_suspend()
219 ret = enable_irq_wake(info->vbus_irq); in usb_extcon_suspend()
221 if (info->id_gpiod) in usb_extcon_suspend()
222 disable_irq_wake(info->id_irq); in usb_extcon_suspend()
237 struct usb_extcon_info *info = dev_get_drvdata(dev); in usb_extcon_resume() local
244 if (info->id_gpiod) { in usb_extcon_resume()
245 ret = disable_irq_wake(info->id_irq); in usb_extcon_resume()
249 if (info->vbus_gpiod) { in usb_extcon_resume()
250 ret = disable_irq_wake(info->vbus_irq); in usb_extcon_resume()
252 if (info->id_gpiod) in usb_extcon_resume()
253 enable_irq_wake(info->id_irq); in usb_extcon_resume()
261 &info->wq_detcable, 0); in usb_extcon_resume()