Lines Matching +full:tx +full:- +full:enable

1 // SPDX-License-Identifier: GPL-2.0-or-later
27 #include <media/rc-core.h>
37 outb(reg >> 8, dev->hw_io + ENE_ADDR_HI); in ene_set_reg_addr()
38 outb(reg & 0xFF, dev->hw_io + ENE_ADDR_LO); in ene_set_reg_addr()
46 retval = inb(dev->hw_io + ENE_IO); in ene_read_reg()
54 dbg_regs("reg %04x <- %02x", reg, value); in ene_write_reg()
56 outb(value, dev->hw_io + ENE_IO); in ene_write_reg()
64 outb(inb(dev->hw_io + ENE_IO) | mask, dev->hw_io + ENE_IO); in ene_set_reg_mask()
72 outb(inb(dev->hw_io + ENE_IO) & ~mask, dev->hw_io + ENE_IO); in ene_clear_reg_mask()
100 dev->pll_freq = (ene_read_reg(dev, ENE_PLLFRH) << 4) + in ene_hw_detect()
104 dev->rx_period_adjust = in ene_hw_detect()
105 dev->pll_freq == ENE_DEFAULT_PLL_FREQ ? 2 : 4; in ene_hw_detect()
109 pr_warn("send a mail to lirc-list@lists.sourceforge.net\n"); in ene_hw_detect()
111 return -ENODEV; in ene_hw_detect()
114 pr_notice("chip is 0x%02x%02x - kbver = 0x%02x, rev = 0x%02x\n", in ene_hw_detect()
117 pr_notice("PLL freq = %d\n", dev->pll_freq); in ene_hw_detect()
121 return -ENODEV; in ene_hw_detect()
125 dev->hw_revision = ENE_HW_C; in ene_hw_detect()
128 dev->hw_revision = ENE_HW_B; in ene_hw_detect()
131 dev->hw_revision = ENE_HW_D; in ene_hw_detect()
136 if (dev->hw_revision < ENE_HW_C) in ene_hw_detect()
144 dev->hw_use_gpio_0a = !!(fw_reg2 & ENE_FW2_GP0A); in ene_hw_detect()
145 dev->hw_learning_and_tx_capable = !!(fw_reg2 & ENE_FW2_LEARNING); in ene_hw_detect()
146 dev->hw_extra_buffer = !!(fw_reg1 & ENE_FW1_HAS_EXTRA_BUF); in ene_hw_detect()
148 if (dev->hw_learning_and_tx_capable) in ene_hw_detect()
149 dev->hw_fan_input = !!(fw_reg2 & ENE_FW2_FAN_INPUT); in ene_hw_detect()
153 if (dev->hw_learning_and_tx_capable) { in ene_hw_detect()
158 pr_notice(" lirc-list@lists.sourceforge.net\n"); in ene_hw_detect()
162 dev->hw_use_gpio_0a ? "40" : "0A"); in ene_hw_detect()
164 if (dev->hw_fan_input) in ene_hw_detect()
168 if (!dev->hw_fan_input) in ene_hw_detect()
170 dev->hw_use_gpio_0a ? "0A" : "40"); in ene_hw_detect()
172 if (dev->hw_extra_buffer) in ene_hw_detect()
183 dev->r_pointer = dev->w_pointer; in ene_rx_setup_hw_buffer()
185 if (!dev->hw_extra_buffer) { in ene_rx_setup_hw_buffer()
186 dev->buffer_len = ENE_FW_PACKET_SIZE * 2; in ene_rx_setup_hw_buffer()
192 dev->extra_buf1_address = tmp; in ene_rx_setup_hw_buffer()
194 dev->extra_buf1_len = ene_read_reg(dev, ENE_FW_SAMPLE_BUFFER + 2); in ene_rx_setup_hw_buffer()
198 dev->extra_buf2_address = tmp; in ene_rx_setup_hw_buffer()
200 dev->extra_buf2_len = ene_read_reg(dev, ENE_FW_SAMPLE_BUFFER + 5); in ene_rx_setup_hw_buffer()
202 dev->buffer_len = dev->extra_buf1_len + dev->extra_buf2_len + 8; in ene_rx_setup_hw_buffer()
205 pr_notice(" 0x%04x - len : %d\n", in ene_rx_setup_hw_buffer()
206 dev->extra_buf1_address, dev->extra_buf1_len); in ene_rx_setup_hw_buffer()
207 pr_notice(" 0x%04x - len : %d\n", in ene_rx_setup_hw_buffer()
208 dev->extra_buf2_address, dev->extra_buf2_len); in ene_rx_setup_hw_buffer()
210 pr_notice("Total buffer len = %d\n", dev->buffer_len); in ene_rx_setup_hw_buffer()
212 if (dev->buffer_len > 64 || dev->buffer_len < 16) in ene_rx_setup_hw_buffer()
215 if (dev->extra_buf1_address > 0xFBFC || in ene_rx_setup_hw_buffer()
216 dev->extra_buf1_address < 0xEC00) in ene_rx_setup_hw_buffer()
219 if (dev->extra_buf2_address > 0xFBFC || in ene_rx_setup_hw_buffer()
220 dev->extra_buf2_address < 0xEC00) in ene_rx_setup_hw_buffer()
223 if (dev->r_pointer > dev->buffer_len) in ene_rx_setup_hw_buffer()
230 dev->hw_extra_buffer = false; in ene_rx_setup_hw_buffer()
235 /* Restore the pointers to extra buffers - to make module reload work*/
238 if (!dev->hw_extra_buffer) in ene_rx_restore_hw_buffer()
242 dev->extra_buf1_address & 0xFF); in ene_rx_restore_hw_buffer()
244 dev->extra_buf1_address >> 8); in ene_rx_restore_hw_buffer()
245 ene_write_reg(dev, ENE_FW_SAMPLE_BUFFER + 2, dev->extra_buf1_len); in ene_rx_restore_hw_buffer()
248 dev->extra_buf2_address & 0xFF); in ene_rx_restore_hw_buffer()
250 dev->extra_buf2_address >> 8); in ene_rx_restore_hw_buffer()
252 dev->extra_buf2_len); in ene_rx_restore_hw_buffer()
259 if (dev->hw_extra_buffer) in ene_rx_read_hw_pointer()
260 dev->w_pointer = ene_read_reg(dev, ENE_FW_RX_POINTER); in ene_rx_read_hw_pointer()
262 dev->w_pointer = ene_read_reg(dev, ENE_FW2) in ene_rx_read_hw_pointer()
266 dev->w_pointer, dev->r_pointer); in ene_rx_read_hw_pointer()
274 if (dev->r_pointer == dev->w_pointer) { in ene_rx_get_sample_reg()
279 if (dev->r_pointer == dev->w_pointer) { in ene_rx_get_sample_reg()
280 dbg_verbose("RB: end of data at %d", dev->r_pointer); in ene_rx_get_sample_reg()
284 dbg_verbose("RB: reading at offset %d", dev->r_pointer); in ene_rx_get_sample_reg()
285 r_pointer = dev->r_pointer; in ene_rx_get_sample_reg()
287 dev->r_pointer++; in ene_rx_get_sample_reg()
288 if (dev->r_pointer == dev->buffer_len) in ene_rx_get_sample_reg()
289 dev->r_pointer = 0; in ene_rx_get_sample_reg()
291 dbg_verbose("RB: next read will be from offset %d", dev->r_pointer); in ene_rx_get_sample_reg()
298 r_pointer -= 8; in ene_rx_get_sample_reg()
300 if (r_pointer < dev->extra_buf1_len) { in ene_rx_get_sample_reg()
302 return dev->extra_buf1_address + r_pointer; in ene_rx_get_sample_reg()
305 r_pointer -= dev->extra_buf1_len; in ene_rx_get_sample_reg()
307 if (r_pointer < dev->extra_buf2_len) { in ene_rx_get_sample_reg()
309 return dev->extra_buf2_address + r_pointer; in ene_rx_get_sample_reg()
338 if (dev->carrier_detect_enabled) { in ene_rx_sense_carrier()
344 ir_raw_event_store(dev->rdev, &ev); in ene_rx_sense_carrier()
349 static void ene_rx_enable_cir_engine(struct ene_device *dev, bool enable) in ene_rx_enable_cir_engine() argument
352 ENE_CIRCFG_RX_EN | ENE_CIRCFG_RX_IRQ, enable); in ene_rx_enable_cir_engine()
365 static void ene_rx_enable_fan_input(struct ene_device *dev, bool enable) in ene_rx_enable_fan_input() argument
367 if (!dev->hw_fan_input) in ene_rx_enable_fan_input()
370 if (!enable) in ene_rx_enable_fan_input()
381 bool learning_mode = dev->learning_mode_enabled || in ene_rx_setup()
382 dev->carrier_detect_enabled; in ene_rx_setup()
394 dev->pll_freq == ENE_DEFAULT_PLL_FREQ ? 1 : 2; in ene_rx_setup()
400 if (dev->hw_revision < ENE_HW_C) in ene_rx_setup()
405 WARN_ON(!dev->hw_learning_and_tx_capable); in ene_rx_setup()
407 /* Enable the opposite of the normal input in ene_rx_setup()
412 ene_rx_select_input(dev, !dev->hw_use_gpio_0a); in ene_rx_setup()
413 dev->rx_fan_input_inuse = false; in ene_rx_setup()
415 /* Enable carrier demodulation */ in ene_rx_setup()
418 /* Enable carrier detection */ in ene_rx_setup()
421 dev->carrier_detect_enabled || debug); in ene_rx_setup()
423 if (dev->hw_fan_input) in ene_rx_setup()
424 dev->rx_fan_input_inuse = true; in ene_rx_setup()
426 ene_rx_select_input(dev, dev->hw_use_gpio_0a); in ene_rx_setup()
434 if (dev->rx_fan_input_inuse) { in ene_rx_setup()
435 dev->rdev->rx_resolution = ENE_FW_SAMPLE_PERIOD_FAN; in ene_rx_setup()
439 dev->rdev->min_timeout = dev->rdev->max_timeout = in ene_rx_setup()
443 dev->rdev->rx_resolution = sample_period; in ene_rx_setup()
450 dev->rdev->min_timeout = 127 * sample_period; in ene_rx_setup()
451 dev->rdev->max_timeout = 200000; in ene_rx_setup()
454 if (dev->hw_learning_and_tx_capable) in ene_rx_setup()
455 dev->rdev->tx_resolution = sample_period; in ene_rx_setup()
457 if (dev->rdev->timeout > dev->rdev->max_timeout) in ene_rx_setup()
458 dev->rdev->timeout = dev->rdev->max_timeout; in ene_rx_setup()
459 if (dev->rdev->timeout < dev->rdev->min_timeout) in ene_rx_setup()
460 dev->rdev->timeout = dev->rdev->min_timeout; in ene_rx_setup()
463 /* Enable the device for receive */
468 /* Enable system interrupt */ in ene_rx_enable_hw()
469 if (dev->hw_revision < ENE_HW_C) { in ene_rx_enable_hw()
470 ene_write_reg(dev, ENEB_IRQ, dev->irq << 1); in ene_rx_enable_hw()
476 reg_value |= (dev->irq & ENE_IRQ_MASK); in ene_rx_enable_hw()
480 /* Enable inputs */ in ene_rx_enable_hw()
481 ene_rx_enable_fan_input(dev, dev->rx_fan_input_inuse); in ene_rx_enable_hw()
482 ene_rx_enable_cir_engine(dev, !dev->rx_fan_input_inuse); in ene_rx_enable_hw()
484 /* ack any pending irqs - just in case */ in ene_rx_enable_hw()
487 /* enable firmware bits */ in ene_rx_enable_hw()
491 ir_raw_event_set_idle(dev->rdev, true); in ene_rx_enable_hw()
494 /* Enable the device for receive - wrapper to track the state*/
498 dev->rx_enabled = true; in ene_rx_enable()
510 ir_raw_event_set_idle(dev->rdev, true); in ene_rx_disable_hw()
513 /* Disable the device receiver - wrapper to track the state */
517 dev->rx_enabled = false; in ene_rx_disable()
529 /* Set up the TX carrier frequency and duty cycle */
535 spin_lock_irqsave(&dev->hw_lock, flags); in ene_tx_set_carrier()
538 ENE_CIRCFG_TX_CARR, dev->tx_period > 0); in ene_tx_set_carrier()
540 if (!dev->tx_period) in ene_tx_set_carrier()
543 BUG_ON(dev->tx_duty_cycle >= 100 || dev->tx_duty_cycle <= 0); in ene_tx_set_carrier()
545 tx_puls_width = dev->tx_period / (100 / dev->tx_duty_cycle); in ene_tx_set_carrier()
550 dbg("TX: pulse distance = %d * 500 ns", dev->tx_period); in ene_tx_set_carrier()
551 dbg("TX: pulse width = %d * 500 ns", tx_puls_width); in ene_tx_set_carrier()
553 ene_write_reg(dev, ENE_CIRMOD_PRD, dev->tx_period | ENE_CIRMOD_PRD_POL); in ene_tx_set_carrier()
556 spin_unlock_irqrestore(&dev->hw_lock, flags); in ene_tx_set_carrier()
559 /* Enable/disable transmitters */
564 spin_lock_irqsave(&dev->hw_lock, flags); in ene_tx_set_transmitters()
566 !!(dev->transmitter_mask & 0x01)); in ene_tx_set_transmitters()
568 !!(dev->transmitter_mask & 0x02)); in ene_tx_set_transmitters()
569 spin_unlock_irqrestore(&dev->hw_lock, flags); in ene_tx_set_transmitters()
578 dev->saved_conf1 = conf1; in ene_tx_enable()
582 dbg("TX: Transmitter #1 is connected"); in ene_tx_enable()
585 dbg("TX: Transmitter #2 is connected"); in ene_tx_enable()
588 pr_warn("TX: transmitter cable isn't connected!\n"); in ene_tx_enable()
591 if (dev->hw_revision == ENE_HW_C) in ene_tx_enable()
594 /* Enable TX engine */ in ene_tx_enable()
602 ene_write_reg(dev, ENE_CIRCFG, dev->saved_conf1); in ene_tx_disable()
603 dev->tx_buffer = NULL; in ene_tx_disable()
607 /* TX one sample - must be called with dev->hw_lock*/
612 bool pulse = dev->tx_sample_pulse; in ene_tx_sample()
614 if (!dev->tx_buffer) { in ene_tx_sample()
615 pr_warn("TX: BUG: attempt to transmit NULL buffer\n"); in ene_tx_sample()
619 /* Grab next TX sample */ in ene_tx_sample()
620 if (!dev->tx_sample) { in ene_tx_sample()
622 if (dev->tx_pos == dev->tx_len) { in ene_tx_sample()
623 if (!dev->tx_done) { in ene_tx_sample()
624 dbg("TX: no more data to send"); in ene_tx_sample()
625 dev->tx_done = true; in ene_tx_sample()
628 dbg("TX: last sample sent by hardware"); in ene_tx_sample()
630 complete(&dev->tx_complete); in ene_tx_sample()
635 sample = dev->tx_buffer[dev->tx_pos++]; in ene_tx_sample()
636 dev->tx_sample_pulse = !dev->tx_sample_pulse; in ene_tx_sample()
638 dev->tx_sample = DIV_ROUND_CLOSEST(sample, sample_period); in ene_tx_sample()
640 if (!dev->tx_sample) in ene_tx_sample()
641 dev->tx_sample = 1; in ene_tx_sample()
644 raw_tx = min(dev->tx_sample , (unsigned int)ENE_CIRRLC_OUT_MASK); in ene_tx_sample()
645 dev->tx_sample -= raw_tx; in ene_tx_sample()
647 dbg("TX: sample %8d (%s)", raw_tx * sample_period, in ene_tx_sample()
653 dev->tx_reg ? ENE_CIRRLC_OUT1 : ENE_CIRRLC_OUT0, raw_tx); in ene_tx_sample()
655 dev->tx_reg = !dev->tx_reg; in ene_tx_sample()
657 /* simulate TX done interrupt */ in ene_tx_sample()
659 mod_timer(&dev->tx_sim_timer, jiffies + HZ / 500); in ene_tx_sample()
662 /* timer to simulate tx done interrupt */
668 spin_lock_irqsave(&dev->hw_lock, flags); in ene_tx_irqsim()
670 spin_unlock_irqrestore(&dev->hw_lock, flags); in ene_tx_irqsim()
683 if (dev->hw_revision < ENE_HW_C) { in ene_irq_status()
697 /* original driver does that twice - a workaround ? */ in ene_irq_status()
707 /* check TX interrupt */ in ene_irq_status()
728 spin_lock_irqsave(&dev->hw_lock, flags); in ene_isr()
740 dbg_verbose("TX interrupt"); in ene_isr()
741 if (!dev->hw_learning_and_tx_capable) { in ene_isr()
742 dbg("TX interrupt on unsupported device!"); in ene_isr()
753 if (dev->hw_learning_and_tx_capable) in ene_isr()
758 if (!dev->hw_extra_buffer) in ene_isr()
759 dev->r_pointer = dev->w_pointer == 0 ? ENE_FW_PACKET_SIZE : 0; in ene_isr()
771 if (dev->rx_fan_input_inuse) { in ene_isr()
773 int offset = ENE_FW_SMPL_BUF_FAN - ENE_FW_SAMPLE_BUFFER; in ene_isr()
788 if (dev->rx_period_adjust) { in ene_isr()
790 hw_sample /= (100 + dev->rx_period_adjust); in ene_isr()
794 if (!dev->hw_extra_buffer && !hw_sample) { in ene_isr()
795 dev->r_pointer = dev->w_pointer; in ene_isr()
803 ir_raw_event_store_with_filter(dev->rdev, &ev); in ene_isr()
806 ir_raw_event_handle(dev->rdev); in ene_isr()
808 spin_unlock_irqrestore(&dev->hw_lock, flags); in ene_isr()
815 dev->tx_period = 32; in ene_setup_default_settings()
816 dev->tx_duty_cycle = 50; /*%*/ in ene_setup_default_settings()
817 dev->transmitter_mask = 0x03; in ene_setup_default_settings()
818 dev->learning_mode_enabled = learning_mode_force; in ene_setup_default_settings()
821 dev->rdev->timeout = MS_TO_US(150); in ene_setup_default_settings()
827 if (dev->hw_learning_and_tx_capable) { in ene_setup_hw_settings()
838 struct ene_device *dev = rdev->priv; in ene_open()
841 spin_lock_irqsave(&dev->hw_lock, flags); in ene_open()
843 spin_unlock_irqrestore(&dev->hw_lock, flags); in ene_open()
850 struct ene_device *dev = rdev->priv; in ene_close()
852 spin_lock_irqsave(&dev->hw_lock, flags); in ene_close()
855 spin_unlock_irqrestore(&dev->hw_lock, flags); in ene_close()
861 struct ene_device *dev = rdev->priv; in ene_set_tx_mask()
862 dbg("TX: attempt to set transmitter mask %02x", tx_mask); in ene_set_tx_mask()
866 dbg("TX: invalid mask"); in ene_set_tx_mask()
871 dev->transmitter_mask = tx_mask; in ene_set_tx_mask()
876 /* outside interface : set tx carrier */
879 struct ene_device *dev = rdev->priv; in ene_set_tx_carrier()
882 dbg("TX: attempt to set tx carrier to %d kHz", carrier); in ene_set_tx_carrier()
884 return -EINVAL; in ene_set_tx_carrier()
890 dbg("TX: out of range %d-%d kHz carrier", in ene_set_tx_carrier()
892 return -EINVAL; in ene_set_tx_carrier()
895 dev->tx_period = period; in ene_set_tx_carrier()
900 /*outside interface : set tx duty cycle */
903 struct ene_device *dev = rdev->priv; in ene_set_tx_duty_cycle()
904 dbg("TX: setting duty cycle to %d%%", duty_cycle); in ene_set_tx_duty_cycle()
905 dev->tx_duty_cycle = duty_cycle; in ene_set_tx_duty_cycle()
910 /* outside interface: enable learning mode */
911 static int ene_set_learning_mode(struct rc_dev *rdev, int enable) in ene_set_learning_mode() argument
913 struct ene_device *dev = rdev->priv; in ene_set_learning_mode()
915 if (enable == dev->learning_mode_enabled) in ene_set_learning_mode()
918 spin_lock_irqsave(&dev->hw_lock, flags); in ene_set_learning_mode()
919 dev->learning_mode_enabled = enable; in ene_set_learning_mode()
923 spin_unlock_irqrestore(&dev->hw_lock, flags); in ene_set_learning_mode()
927 static int ene_set_carrier_report(struct rc_dev *rdev, int enable) in ene_set_carrier_report() argument
929 struct ene_device *dev = rdev->priv; in ene_set_carrier_report()
932 if (enable == dev->carrier_detect_enabled) in ene_set_carrier_report()
935 spin_lock_irqsave(&dev->hw_lock, flags); in ene_set_carrier_report()
936 dev->carrier_detect_enabled = enable; in ene_set_carrier_report()
940 spin_unlock_irqrestore(&dev->hw_lock, flags); in ene_set_carrier_report()
944 /* outside interface: enable or disable idle mode */
947 struct ene_device *dev = rdev->priv; in ene_set_idle()
958 struct ene_device *dev = rdev->priv; in ene_transmit()
961 dev->tx_buffer = buf; in ene_transmit()
962 dev->tx_len = n; in ene_transmit()
963 dev->tx_pos = 0; in ene_transmit()
964 dev->tx_reg = 0; in ene_transmit()
965 dev->tx_done = 0; in ene_transmit()
966 dev->tx_sample = 0; in ene_transmit()
967 dev->tx_sample_pulse = false; in ene_transmit()
969 dbg("TX: %d samples", dev->tx_len); in ene_transmit()
971 spin_lock_irqsave(&dev->hw_lock, flags); in ene_transmit()
979 spin_unlock_irqrestore(&dev->hw_lock, flags); in ene_transmit()
981 if (wait_for_completion_timeout(&dev->tx_complete, 2 * HZ) == 0) { in ene_transmit()
982 dbg("TX: timeout"); in ene_transmit()
983 spin_lock_irqsave(&dev->hw_lock, flags); in ene_transmit()
985 spin_unlock_irqrestore(&dev->hw_lock, flags); in ene_transmit()
987 dbg("TX: done"); in ene_transmit()
994 int error = -ENOMEM; in ene_probe()
1005 error = -ENODEV; in ene_probe()
1007 /* init these to -1, as 0 is valid for both */ in ene_probe()
1008 dev->hw_io = -1; in ene_probe()
1009 dev->irq = -1; in ene_probe()
1018 spin_lock_init(&dev->hw_lock); in ene_probe()
1020 dev->hw_io = pnp_port_start(pnp_dev, 0); in ene_probe()
1021 dev->irq = pnp_irq(pnp_dev, 0); in ene_probe()
1025 dev->pnp_dev = pnp_dev; in ene_probe()
1036 if (!dev->hw_learning_and_tx_capable && txsim) { in ene_probe()
1037 dev->hw_learning_and_tx_capable = true; in ene_probe()
1038 timer_setup(&dev->tx_sim_timer, ene_tx_irqsim, 0); in ene_probe()
1039 pr_warn("Simulation of TX activated\n"); in ene_probe()
1042 if (!dev->hw_learning_and_tx_capable) in ene_probe()
1045 rdev->allowed_protocols = RC_PROTO_BIT_ALL_IR_DECODER; in ene_probe()
1046 rdev->priv = dev; in ene_probe()
1047 rdev->open = ene_open; in ene_probe()
1048 rdev->close = ene_close; in ene_probe()
1049 rdev->s_idle = ene_set_idle; in ene_probe()
1050 rdev->driver_name = ENE_DRIVER_NAME; in ene_probe()
1051 rdev->map_name = RC_MAP_RC6_MCE; in ene_probe()
1052 rdev->device_name = "ENE eHome Infrared Remote Receiver"; in ene_probe()
1054 if (dev->hw_learning_and_tx_capable) { in ene_probe()
1055 rdev->s_learning_mode = ene_set_learning_mode; in ene_probe()
1056 init_completion(&dev->tx_complete); in ene_probe()
1057 rdev->tx_ir = ene_transmit; in ene_probe()
1058 rdev->s_tx_mask = ene_set_tx_mask; in ene_probe()
1059 rdev->s_tx_carrier = ene_set_tx_carrier; in ene_probe()
1060 rdev->s_tx_duty_cycle = ene_set_tx_duty_cycle; in ene_probe()
1061 rdev->s_carrier_report = ene_set_carrier_report; in ene_probe()
1062 rdev->device_name = "ENE eHome Infrared Remote Transceiver"; in ene_probe()
1065 dev->rdev = rdev; in ene_probe()
1071 device_set_wakeup_capable(&pnp_dev->dev, true); in ene_probe()
1072 device_set_wakeup_enable(&pnp_dev->dev, true); in ene_probe()
1079 error = -EBUSY; in ene_probe()
1080 if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) { in ene_probe()
1084 if (request_irq(dev->irq, ene_isr, in ene_probe()
1093 release_region(dev->hw_io, ENE_IO_SIZE); in ene_probe()
1109 spin_lock_irqsave(&dev->hw_lock, flags); in ene_remove()
1112 spin_unlock_irqrestore(&dev->hw_lock, flags); in ene_remove()
1114 free_irq(dev->irq, dev); in ene_remove()
1115 release_region(dev->hw_io, ENE_IO_SIZE); in ene_remove()
1116 rc_unregister_device(dev->rdev); in ene_remove()
1120 /* enable wake on IR (wakes on specific button on original remote) */
1121 static void ene_enable_wake(struct ene_device *dev, bool enable) in ene_enable_wake() argument
1123 dbg("wake on IR %s", enable ? "enabled" : "disabled"); in ene_enable_wake()
1124 ene_set_clear_reg_mask(dev, ENE_FW1, ENE_FW1_WAKE, enable); in ene_enable_wake()
1131 bool wake = device_may_wakeup(&dev->pnp_dev->dev); in ene_suspend()
1133 if (!wake && dev->rx_enabled) in ene_suspend()
1145 if (dev->rx_enabled) in ene_resume()
1185 MODULE_PARM_DESC(learning_mode_force, "Enable learning mode by default");
1192 "Simulate TX features on unsupported hardware (dangerous)");