Lines Matching +full:autosuspend +full:- +full:delay

1 // SPDX-License-Identifier: GPL-2.0-only
17 #include <media/rc-core.h>
33 struct device *pmdev = gpio_dev->pmdev; in gpio_ir_recv_irq()
39 * this may introduce a millisecond delay to call resume callback, in gpio_ir_recv_irq()
43 * respond to interrupt, another is delay introduced by async api. in gpio_ir_recv_irq()
48 val = gpiod_get_value(gpio_dev->gpiod); in gpio_ir_recv_irq()
50 ir_raw_event_store_edge(gpio_dev->rcdev, val == 1); in gpio_ir_recv_irq()
62 struct device *dev = &pdev->dev; in gpio_ir_recv_probe()
63 struct device_node *np = dev->of_node; in gpio_ir_recv_probe()
70 return -ENODEV; in gpio_ir_recv_probe()
74 return -ENOMEM; in gpio_ir_recv_probe()
76 gpio_dev->gpiod = devm_gpiod_get(dev, NULL, GPIOD_IN); in gpio_ir_recv_probe()
77 if (IS_ERR(gpio_dev->gpiod)) in gpio_ir_recv_probe()
78 return dev_err_probe(dev, PTR_ERR(gpio_dev->gpiod), in gpio_ir_recv_probe()
80 gpio_dev->irq = gpiod_to_irq(gpio_dev->gpiod); in gpio_ir_recv_probe()
81 if (gpio_dev->irq < 0) in gpio_ir_recv_probe()
82 return gpio_dev->irq; in gpio_ir_recv_probe()
86 return -ENOMEM; in gpio_ir_recv_probe()
88 rcdev->priv = gpio_dev; in gpio_ir_recv_probe()
89 rcdev->device_name = GPIO_IR_DEVICE_NAME; in gpio_ir_recv_probe()
90 rcdev->input_phys = GPIO_IR_DEVICE_NAME "/input0"; in gpio_ir_recv_probe()
91 rcdev->input_id.bustype = BUS_HOST; in gpio_ir_recv_probe()
92 rcdev->input_id.vendor = 0x0001; in gpio_ir_recv_probe()
93 rcdev->input_id.product = 0x0001; in gpio_ir_recv_probe()
94 rcdev->input_id.version = 0x0100; in gpio_ir_recv_probe()
95 rcdev->dev.parent = dev; in gpio_ir_recv_probe()
96 rcdev->driver_name = KBUILD_MODNAME; in gpio_ir_recv_probe()
97 rcdev->min_timeout = 1; in gpio_ir_recv_probe()
98 rcdev->timeout = IR_DEFAULT_TIMEOUT; in gpio_ir_recv_probe()
99 rcdev->max_timeout = 10 * IR_DEFAULT_TIMEOUT; in gpio_ir_recv_probe()
100 rcdev->allowed_protocols = RC_PROTO_BIT_ALL_IR_DECODER; in gpio_ir_recv_probe()
101 rcdev->map_name = of_get_property(np, "linux,rc-map-name", NULL); in gpio_ir_recv_probe()
102 if (!rcdev->map_name) in gpio_ir_recv_probe()
103 rcdev->map_name = RC_MAP_EMPTY; in gpio_ir_recv_probe()
105 gpio_dev->rcdev = rcdev; in gpio_ir_recv_probe()
106 if (of_property_read_bool(np, "wakeup-source")) in gpio_ir_recv_probe()
115 of_property_read_u32(np, "linux,autosuspend-period", &period); in gpio_ir_recv_probe()
117 gpio_dev->pmdev = dev; in gpio_ir_recv_probe()
126 return devm_request_irq(dev, gpio_dev->irq, gpio_ir_recv_irq, in gpio_ir_recv_probe()
128 "gpio-ir-recv-irq", gpio_dev); in gpio_ir_recv_probe()
134 struct device *pmdev = gpio_dev->pmdev; in gpio_ir_recv_remove()
138 cpu_latency_qos_remove_request(&gpio_dev->qos); in gpio_ir_recv_remove()
152 enable_irq_wake(gpio_dev->irq); in gpio_ir_recv_suspend()
154 disable_irq(gpio_dev->irq); in gpio_ir_recv_suspend()
164 disable_irq_wake(gpio_dev->irq); in gpio_ir_recv_resume()
166 enable_irq(gpio_dev->irq); in gpio_ir_recv_resume()
175 cpu_latency_qos_remove_request(&gpio_dev->qos); in gpio_ir_recv_runtime_suspend()
184 cpu_latency_qos_add_request(&gpio_dev->qos, 0); in gpio_ir_recv_runtime_resume()
198 { .compatible = "gpio-ir-receiver", },