Lines Matching refs:info
64 struct usb_extcon_info *info = container_of(to_delayed_work(work),
69 id = info->id_gpiod ?
70 gpiod_get_value_cansleep(info->id_gpiod) : 1;
71 vbus = info->vbus_gpiod ?
72 gpiod_get_value_cansleep(info->vbus_gpiod) : id;
76 extcon_set_state_sync(info->edev, EXTCON_USB_HOST, false);
78 extcon_set_state_sync(info->edev, EXTCON_USB, false);
81 extcon_set_state_sync(info->edev, EXTCON_USB_HOST, true);
84 extcon_set_state_sync(info->edev, EXTCON_USB, true);
90 struct usb_extcon_info *info = dev_id;
92 queue_delayed_work(system_power_efficient_wq, &info->wq_detcable,
93 info->debounce_jiffies);
102 struct usb_extcon_info *info;
108 info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
109 if (!info)
112 info->dev = dev;
113 info->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id", GPIOD_IN);
114 info->vbus_gpiod = devm_gpiod_get_optional(&pdev->dev, "vbus",
117 if (!info->id_gpiod && !info->vbus_gpiod) {
122 if (IS_ERR(info->id_gpiod))
123 return PTR_ERR(info->id_gpiod);
125 if (IS_ERR(info->vbus_gpiod))
126 return PTR_ERR(info->vbus_gpiod);
128 info->edev = devm_extcon_dev_allocate(dev, usb_extcon_cable);
129 if (IS_ERR(info->edev)) {
134 ret = devm_extcon_dev_register(dev, info->edev);
140 if (info->id_gpiod)
141 ret = gpiod_set_debounce(info->id_gpiod,
143 if (!ret && info->vbus_gpiod)
144 ret = gpiod_set_debounce(info->vbus_gpiod,
148 info->debounce_jiffies = msecs_to_jiffies(USB_GPIO_DEBOUNCE_MS);
150 INIT_DELAYED_WORK(&info->wq_detcable, usb_extcon_detect_cable);
152 if (info->id_gpiod) {
153 info->id_irq = gpiod_to_irq(info->id_gpiod);
154 if (info->id_irq < 0) {
156 return info->id_irq;
159 ret = devm_request_threaded_irq(dev, info->id_irq, NULL,
163 pdev->name, info);
170 if (info->vbus_gpiod) {
171 info->vbus_irq = gpiod_to_irq(info->vbus_gpiod);
172 if (info->vbus_irq < 0) {
174 return info->vbus_irq;
177 ret = devm_request_threaded_irq(dev, info->vbus_irq, NULL,
181 pdev->name, info);
188 platform_set_drvdata(pdev, info);
192 usb_extcon_detect_cable(&info->wq_detcable.work);
199 struct usb_extcon_info *info = platform_get_drvdata(pdev);
201 cancel_delayed_work_sync(&info->wq_detcable);
210 struct usb_extcon_info *info = dev_get_drvdata(dev);
214 if (info->id_gpiod) {
215 ret = enable_irq_wake(info->id_irq);
219 if (info->vbus_gpiod) {
220 ret = enable_irq_wake(info->vbus_irq);
222 if (info->id_gpiod)
223 disable_irq_wake(info->id_irq);
235 if (info->id_gpiod)
236 disable_irq(info->id_irq);
237 if (info->vbus_gpiod)
238 disable_irq(info->vbus_irq);
248 struct usb_extcon_info *info = dev_get_drvdata(dev);
255 if (info->id_gpiod) {
256 ret = disable_irq_wake(info->id_irq);
260 if (info->vbus_gpiod) {
261 ret = disable_irq_wake(info->vbus_irq);
263 if (info->id_gpiod)
264 enable_irq_wake(info->id_irq);
271 if (info->id_gpiod)
272 enable_irq(info->id_irq);
273 if (info->vbus_gpiod)
274 enable_irq(info->vbus_irq);
277 &info->wq_detcable, 0);