| .. | .. |
|---|
| 107 | 107 | rcdev->map_name = RC_MAP_EMPTY; |
|---|
| 108 | 108 | |
|---|
| 109 | 109 | gpio_dev->rcdev = rcdev; |
|---|
| 110 | + if (of_property_read_bool(np, "wakeup-source")) |
|---|
| 111 | + device_init_wakeup(dev, true); |
|---|
| 110 | 112 | |
|---|
| 111 | 113 | rc = devm_rc_register_device(dev, rcdev); |
|---|
| 112 | 114 | if (rc < 0) { |
|---|
| .. | .. |
|---|
| 128 | 130 | return devm_request_irq(dev, gpio_dev->irq, gpio_ir_recv_irq, |
|---|
| 129 | 131 | IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, |
|---|
| 130 | 132 | "gpio-ir-recv-irq", gpio_dev); |
|---|
| 133 | +} |
|---|
| 134 | + |
|---|
| 135 | +static int gpio_ir_recv_remove(struct platform_device *pdev) |
|---|
| 136 | +{ |
|---|
| 137 | + struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev); |
|---|
| 138 | + struct device *pmdev = gpio_dev->pmdev; |
|---|
| 139 | + |
|---|
| 140 | + if (pmdev) { |
|---|
| 141 | + pm_runtime_get_sync(pmdev); |
|---|
| 142 | + cpu_latency_qos_remove_request(&gpio_dev->qos); |
|---|
| 143 | + |
|---|
| 144 | + pm_runtime_disable(pmdev); |
|---|
| 145 | + pm_runtime_put_noidle(pmdev); |
|---|
| 146 | + pm_runtime_set_suspended(pmdev); |
|---|
| 147 | + } |
|---|
| 148 | + |
|---|
| 149 | + return 0; |
|---|
| 131 | 150 | } |
|---|
| 132 | 151 | |
|---|
| 133 | 152 | #ifdef CONFIG_PM |
|---|
| .. | .. |
|---|
| 189 | 208 | |
|---|
| 190 | 209 | static struct platform_driver gpio_ir_recv_driver = { |
|---|
| 191 | 210 | .probe = gpio_ir_recv_probe, |
|---|
| 211 | + .remove = gpio_ir_recv_remove, |
|---|
| 192 | 212 | .driver = { |
|---|
| 193 | 213 | .name = KBUILD_MODNAME, |
|---|
| 194 | 214 | .of_match_table = of_match_ptr(gpio_ir_recv_of_match), |
|---|