• Home
  • Raw
  • Download

Lines Matching +full:pm8941 +full:- +full:misc

1 // SPDX-License-Identifier: GPL-2.0-only
3 * extcon-qcom-spmi-misc.c - Qualcomm USB extcon driver to support USB ID
4 * detection based on extcon-usb-gpio.c.
10 #include <linux/extcon-provider.h>
43 ret = irq_get_irqchip_state(info->irq, IRQCHIP_STATE_LINE_LEVEL, &id); in qcom_usb_extcon_detect_cable()
47 extcon_set_state_sync(info->edev, EXTCON_USB_HOST, !id); in qcom_usb_extcon_detect_cable()
54 queue_delayed_work(system_power_efficient_wq, &info->wq_detcable, in qcom_usb_irq_handler()
55 info->debounce_jiffies); in qcom_usb_irq_handler()
62 struct device *dev = &pdev->dev; in qcom_usb_extcon_probe()
68 return -ENOMEM; in qcom_usb_extcon_probe()
70 info->edev = devm_extcon_dev_allocate(dev, qcom_usb_extcon_cable); in qcom_usb_extcon_probe()
71 if (IS_ERR(info->edev)) { in qcom_usb_extcon_probe()
73 return -ENOMEM; in qcom_usb_extcon_probe()
76 ret = devm_extcon_dev_register(dev, info->edev); in qcom_usb_extcon_probe()
82 info->debounce_jiffies = msecs_to_jiffies(USB_ID_DEBOUNCE_MS); in qcom_usb_extcon_probe()
83 INIT_DELAYED_WORK(&info->wq_detcable, qcom_usb_extcon_detect_cable); in qcom_usb_extcon_probe()
85 info->irq = platform_get_irq_byname(pdev, "usb_id"); in qcom_usb_extcon_probe()
86 if (info->irq < 0) in qcom_usb_extcon_probe()
87 return info->irq; in qcom_usb_extcon_probe()
89 ret = devm_request_threaded_irq(dev, info->irq, NULL, in qcom_usb_extcon_probe()
93 pdev->name, info); in qcom_usb_extcon_probe()
103 qcom_usb_extcon_detect_cable(&info->wq_detcable.work); in qcom_usb_extcon_probe()
112 cancel_delayed_work_sync(&info->wq_detcable); in qcom_usb_extcon_remove()
124 ret = enable_irq_wake(info->irq); in qcom_usb_extcon_suspend()
135 ret = disable_irq_wake(info->irq); in qcom_usb_extcon_resume()
145 { .compatible = "qcom,pm8941-misc", },
154 .name = "extcon-pm8941-misc",