Lines Matching +full:tx +full:- +full:freq

1 // SPDX-License-Identifier: GPL-2.0-or-later
8 * skeleton provided by the nuvoton-cir driver.
10 * The lirc_it87 driver was originally written by Hans-Gunter Lutke Uphues
13 * <jimbo-lirc@edwardsclan.net>.
16 * <spmf2004-lirc@yahoo.fr> in 2008.
29 #include <media/rc-core.h>
32 #include "ite-cir.h"
42 static int model_number = -1;
47 /* HW-independent code functions */
50 static inline bool ite_is_high_carrier_freq(unsigned int freq) in ite_is_high_carrier_freq() argument
52 return freq >= ITE_HCF_MIN_CARRIER_FREQ; in ite_is_high_carrier_freq()
57 static u8 ite_get_carrier_freq_bits(unsigned int freq) in ite_get_carrier_freq_bits() argument
59 if (ite_is_high_carrier_freq(freq)) { in ite_get_carrier_freq_bits()
60 if (freq < 425000) in ite_get_carrier_freq_bits()
63 else if (freq < 465000) in ite_get_carrier_freq_bits()
66 else if (freq < 490000) in ite_get_carrier_freq_bits()
73 if (freq < ITE_LCF_MIN_CARRIER_FREQ) in ite_get_carrier_freq_bits()
74 freq = ITE_LCF_MIN_CARRIER_FREQ; in ite_get_carrier_freq_bits()
75 if (freq > ITE_LCF_MAX_CARRIER_FREQ) in ite_get_carrier_freq_bits()
76 freq = ITE_LCF_MAX_CARRIER_FREQ; in ite_get_carrier_freq_bits()
78 /* convert to kHz and subtract the base freq */ in ite_get_carrier_freq_bits()
79 freq = DIV_ROUND_CLOSEST(freq - ITE_LCF_MIN_CARRIER_FREQ, 1000); in ite_get_carrier_freq_bits()
81 return (u8) freq; in ite_get_carrier_freq_bits()
86 static u8 ite_get_pulse_width_bits(unsigned int freq, int duty_cycle) in ite_get_pulse_width_bits() argument
90 /* sanitize freq into range */ in ite_get_pulse_width_bits()
91 if (freq < ITE_LCF_MIN_CARRIER_FREQ) in ite_get_pulse_width_bits()
92 freq = ITE_LCF_MIN_CARRIER_FREQ; in ite_get_pulse_width_bits()
93 if (freq > ITE_HCF_MAX_CARRIER_FREQ) in ite_get_pulse_width_bits()
94 freq = ITE_HCF_MAX_CARRIER_FREQ; in ite_get_pulse_width_bits()
96 period_ns = 1000000000UL / freq; in ite_get_pulse_width_bits()
99 if (ite_is_high_carrier_freq(freq)) { in ite_get_pulse_width_bits()
132 /* decode raw bytes as received by the hardware, and push them to the ir-core
150 ir_raw_event_store_with_filter(dev->rdev, &ev); in ite_decode_bytes()
156 ev.duration = ITE_BITS_TO_US(next_zero - next_one, sample_period); in ite_decode_bytes()
157 ir_raw_event_store_with_filter(dev->rdev, &ev); in ite_decode_bytes()
162 ev.duration = ITE_BITS_TO_US(next_one - next_zero, in ite_decode_bytes()
164 ir_raw_event_store_with_filter(dev->rdev, &ev); in ite_decode_bytes()
169 ir_raw_event_handle(dev->rdev); in ite_decode_bytes()
171 dev_dbg(&dev->rdev->dev, "decoded %d bytes\n", length); in ite_decode_bytes()
174 /* set all the rx/tx carrier parameters; this must be called with the device
178 unsigned int freq, low_freq, high_freq; in ite_set_carrier_params() local
181 bool for_tx = dev->transmitting; in ite_set_carrier_params()
185 freq = dev->tx_carrier_freq; in ite_set_carrier_params()
189 low_freq = dev->rx_low_carrier_freq; in ite_set_carrier_params()
190 high_freq = dev->rx_high_carrier_freq; in ite_set_carrier_params()
194 freq = ITE_DEFAULT_CARRIER_FREQ; in ite_set_carrier_params()
198 /* calculate the middle freq */ in ite_set_carrier_params()
199 freq = (low_freq + high_freq) / 2; in ite_set_carrier_params()
203 DIV_ROUND_CLOSEST(10000 * (high_freq - low_freq), in ite_set_carrier_params()
217 /* set the carrier parameters in a device-dependent way */ in ite_set_carrier_params()
218 dev->params->set_carrier_params(dev, ite_is_high_carrier_freq(freq), in ite_set_carrier_params()
219 use_demodulator, ite_get_carrier_freq_bits(freq), allowance, in ite_set_carrier_params()
220 ite_get_pulse_width_bits(freq, dev->tx_duty_cycle)); in ite_set_carrier_params()
233 spin_lock(&dev->lock); in ite_cir_isr()
236 iflags = dev->params->get_irq_causes(dev); in ite_cir_isr()
240 dev_warn(&dev->rdev->dev, "receive overflow\n"); in ite_cir_isr()
241 ir_raw_event_overflow(dev->rdev); in ite_cir_isr()
247 rx_bytes = dev->params->get_rx_bytes(dev, rx_buf, in ite_cir_isr()
250 dev_dbg(&dev->rdev->dev, "interrupt %d RX bytes\n", rx_bytes); in ite_cir_isr()
253 /* drop the spinlock, since the ir-core layer in ite_cir_isr()
256 spin_unlock(&dev->lock); in ite_cir_isr()
262 spin_lock(&dev->lock); in ite_cir_isr()
269 dev_dbg(&dev->rdev->dev, "interrupt TX FIFO\n"); in ite_cir_isr()
272 wake_up_interruptible(&dev->tx_queue); in ite_cir_isr()
279 spin_unlock(&dev->lock); in ite_cir_isr()
284 /* set the rx carrier freq range, guess it's in Hz... */
289 struct ite_dev *dev = rcdev->priv; in ite_set_rx_carrier_range()
291 spin_lock_irqsave(&dev->lock, flags); in ite_set_rx_carrier_range()
292 dev->rx_low_carrier_freq = carrier_low; in ite_set_rx_carrier_range()
293 dev->rx_high_carrier_freq = carrier_high; in ite_set_rx_carrier_range()
295 spin_unlock_irqrestore(&dev->lock, flags); in ite_set_rx_carrier_range()
300 /* set the tx carrier freq, guess it's in Hz... */
304 struct ite_dev *dev = rcdev->priv; in ite_set_tx_carrier()
306 spin_lock_irqsave(&dev->lock, flags); in ite_set_tx_carrier()
307 dev->tx_carrier_freq = carrier; in ite_set_tx_carrier()
309 spin_unlock_irqrestore(&dev->lock, flags); in ite_set_tx_carrier()
314 /* set the tx duty cycle by controlling the pulse width */
318 struct ite_dev *dev = rcdev->priv; in ite_set_tx_duty_cycle()
320 spin_lock_irqsave(&dev->lock, flags); in ite_set_tx_duty_cycle()
321 dev->tx_duty_cycle = duty_cycle; in ite_set_tx_duty_cycle()
323 spin_unlock_irqrestore(&dev->lock, flags); in ite_set_tx_duty_cycle()
334 struct ite_dev *dev = rcdev->priv; in ite_tx_ir()
345 spin_lock_irqsave(&dev->lock, flags); in ite_tx_ir()
348 dev->transmitting = true; in ite_tx_ir()
359 dev->params->disable_rx(dev); in ite_tx_ir()
365 fifo_avail = ITE_TX_FIFO_LEN - dev->params->get_tx_used_slots(dev); in ite_tx_ir()
371 n--; in ite_tx_ir()
373 dev_dbg(&dev->rdev->dev, "%s: %d\n", in ite_tx_ir()
376 /* repeat while the pulse is non-zero length */ in ite_tx_ir()
384 remaining_us -= next_rle_us; in ite_tx_ir()
394 val = (val - 1) & ITE_TX_RLE_MASK; in ite_tx_ir()
408 fifo_avail = ITE_TX_FIFO_LEN - dev->params->get_tx_used_slots(dev); in ite_tx_ir()
412 /* enable the tx interrupt */ in ite_tx_ir()
413 dev->params->enable_tx_interrupt(dev); in ite_tx_ir()
416 spin_unlock_irqrestore(&dev->lock, flags); in ite_tx_ir()
419 wait_event_interruptible(dev->tx_queue, in ite_tx_ir()
420 (fifo_avail = ITE_TX_FIFO_LEN - dev->params->get_tx_used_slots(dev)) >= 8); in ite_tx_ir()
423 spin_lock_irqsave(&dev->lock, flags); in ite_tx_ir()
425 /* disable the tx interrupt again. */ in ite_tx_ir()
426 dev->params->disable_tx_interrupt(dev); in ite_tx_ir()
430 dev->params->put_tx_byte(dev, val); in ite_tx_ir()
431 fifo_avail--; in ite_tx_ir()
437 * TX ones while the transmission is still being performed! */ in ite_tx_ir()
438 fifo_remaining = dev->params->get_tx_used_slots(dev); in ite_tx_ir()
441 fifo_remaining--; in ite_tx_ir()
442 last_idx--; in ite_tx_ir()
443 last_idx &= (ITE_TX_FIFO_LEN - 1); in ite_tx_ir()
449 spin_unlock_irqrestore(&dev->lock, flags); in ite_tx_ir()
455 spin_lock_irqsave(&dev->lock, flags); in ite_tx_ir()
458 dev->transmitting = false; in ite_tx_ir()
463 /* re-enable the receiver */ in ite_tx_ir()
464 dev->params->enable_rx(dev); in ite_tx_ir()
467 wake_up_interruptible(&dev->tx_ended); in ite_tx_ir()
469 spin_unlock_irqrestore(&dev->lock, flags); in ite_tx_ir()
478 struct ite_dev *dev = rcdev->priv; in ite_s_idle()
481 spin_lock_irqsave(&dev->lock, flags); in ite_s_idle()
482 dev->params->idle_rx(dev); in ite_s_idle()
483 spin_unlock_irqrestore(&dev->lock, flags); in ite_s_idle()
488 /* IT8712F HW-specific functions */
499 iflags = inb(dev->cir_addr + IT87_IIR) & IT87_II; in it87_get_irq_causes()
525 val = inb(dev->cir_addr + IT87_RCR) in it87_set_carrier_params()
536 outb(val, dev->cir_addr + IT87_RCR); in it87_set_carrier_params()
540 dev->cir_addr + IT87_TCR2); in it87_set_carrier_params()
550 fifo = inb(dev->cir_addr + IT87_RSR) & IT87_RXFBC; in it87_get_rx_bytes()
553 *(buf++) = inb(dev->cir_addr + IT87_DR); in it87_get_rx_bytes()
554 fifo--; in it87_get_rx_bytes()
556 buf_size--; in it87_get_rx_bytes()
563 * with the device spinlock NOT HELD while waiting for the TX FIFO to get
567 return inb(dev->cir_addr + IT87_TSR) & IT87_TXFBC; in it87_get_tx_used_slots()
570 /* put a byte to the TX fifo; this should be called with the spinlock held */
573 outb(value, dev->cir_addr + IT87_DR); in it87_put_tx_byte()
581 outb(inb(dev->cir_addr + IT87_RCR) | IT87_RXACT, in it87_idle_rx()
582 dev->cir_addr + IT87_RCR); in it87_idle_rx()
585 outb(inb(dev->cir_addr + IT87_TCR1) | IT87_FIFOCLR, in it87_idle_rx()
586 dev->cir_addr + IT87_TCR1); in it87_idle_rx()
593 outb(inb(dev->cir_addr + IT87_IER) & ~(IT87_RDAIE | IT87_RFOIE), in it87_disable_rx()
594 dev->cir_addr + IT87_IER); in it87_disable_rx()
597 outb(inb(dev->cir_addr + IT87_RCR) & ~IT87_RXEN, in it87_disable_rx()
598 dev->cir_addr + IT87_RCR); in it87_disable_rx()
609 outb(inb(dev->cir_addr + IT87_RCR) | IT87_RXEN, in it87_enable_rx()
610 dev->cir_addr + IT87_RCR); in it87_enable_rx()
616 outb(inb(dev->cir_addr + IT87_IER) | IT87_RDAIE | IT87_RFOIE | IT87_IEC, in it87_enable_rx()
617 dev->cir_addr + IT87_IER); in it87_enable_rx()
625 outb(inb(dev->cir_addr + IT87_IER) & ~IT87_TLDLIE, in it87_disable_tx_interrupt()
626 dev->cir_addr + IT87_IER); in it87_disable_tx_interrupt()
634 outb(inb(dev->cir_addr + IT87_IER) | IT87_TLDLIE | IT87_IEC, in it87_enable_tx_interrupt()
635 dev->cir_addr + IT87_IER); in it87_enable_tx_interrupt()
642 outb(inb(dev->cir_addr + IT87_IER) & in it87_disable()
644 dev->cir_addr + IT87_IER); in it87_disable()
650 outb(IT87_FIFOCLR | inb(dev->cir_addr + IT87_TCR1), in it87_disable()
651 dev->cir_addr + IT87_TCR1); in it87_disable()
659 outb((inb(dev->cir_addr + IT87_IER) & in it87_init_hardware()
661 dev->cir_addr + IT87_IER); in it87_init_hardware()
664 outb(ITE_BAUDRATE_DIVISOR & 0xff, dev->cir_addr + IT87_BDLR); in it87_init_hardware()
665 outb((ITE_BAUDRATE_DIVISOR >> 8) & 0xff, dev->cir_addr + IT87_BDHR); in it87_init_hardware()
668 outb(inb(dev->cir_addr + IT87_IER) & ~IT87_BR, in it87_init_hardware()
669 dev->cir_addr + IT87_IER); in it87_init_hardware()
672 outb(ITE_RXDCR_DEFAULT, dev->cir_addr + IT87_RCR); in it87_init_hardware()
677 dev->cir_addr + IT87_TCR1); in it87_init_hardware()
683 /* IT8512F on ITE8708 HW-specific functions */
694 iflags = inb(dev->cir_addr + IT8708_C0IIR); in it8708_get_irq_causes()
715 outb(inb(dev->cir_addr + IT8708_BANKSEL) | IT8708_HRAE, in it8708_set_carrier_params()
716 dev->cir_addr + IT8708_BANKSEL); in it8708_set_carrier_params()
718 val = (inb(dev->cir_addr + IT8708_C0CFR) in it8708_set_carrier_params()
724 outb(val, dev->cir_addr + IT8708_C0CFR); in it8708_set_carrier_params()
726 outb(inb(dev->cir_addr + IT8708_BANKSEL) & ~IT8708_HRAE, in it8708_set_carrier_params()
727 dev->cir_addr + IT8708_BANKSEL); in it8708_set_carrier_params()
730 val = inb(dev->cir_addr + IT8708_C0RCR) in it8708_set_carrier_params()
738 outb(val, dev->cir_addr + IT8708_C0RCR); in it8708_set_carrier_params()
741 val = inb(dev->cir_addr + IT8708_C0TCR) & ~IT85_TXMPW; in it8708_set_carrier_params()
743 outb(val, dev->cir_addr + IT8708_C0TCR); in it8708_set_carrier_params()
753 fifo = inb(dev->cir_addr + IT8708_C0RFSR) & IT85_RXFBC; in it8708_get_rx_bytes()
756 *(buf++) = inb(dev->cir_addr + IT8708_C0DR); in it8708_get_rx_bytes()
757 fifo--; in it8708_get_rx_bytes()
759 buf_size--; in it8708_get_rx_bytes()
766 * with the device spinlock NOT HELD while waiting for the TX FIFO to get
770 return inb(dev->cir_addr + IT8708_C0TFSR) & IT85_TXFBC; in it8708_get_tx_used_slots()
773 /* put a byte to the TX fifo; this should be called with the spinlock held */
776 outb(value, dev->cir_addr + IT8708_C0DR); in it8708_put_tx_byte()
784 outb(inb(dev->cir_addr + IT8708_C0RCR) | IT85_RXACT, in it8708_idle_rx()
785 dev->cir_addr + IT8708_C0RCR); in it8708_idle_rx()
788 outb(inb(dev->cir_addr + IT8708_C0MSTCR) | IT85_FIFOCLR, in it8708_idle_rx()
789 dev->cir_addr + IT8708_C0MSTCR); in it8708_idle_rx()
796 outb(inb(dev->cir_addr + IT8708_C0IER) & in it8708_disable_rx()
798 dev->cir_addr + IT8708_C0IER); in it8708_disable_rx()
801 outb(inb(dev->cir_addr + IT8708_C0RCR) & ~IT85_RXEN, in it8708_disable_rx()
802 dev->cir_addr + IT8708_C0RCR); in it8708_disable_rx()
813 outb(inb(dev->cir_addr + IT8708_C0RCR) | IT85_RXEN, in it8708_enable_rx()
814 dev->cir_addr + IT8708_C0RCR); in it8708_enable_rx()
820 outb(inb(dev->cir_addr + IT8708_C0IER) in it8708_enable_rx()
822 dev->cir_addr + IT8708_C0IER); in it8708_enable_rx()
830 outb(inb(dev->cir_addr + IT8708_C0IER) & ~IT85_TLDLIE, in it8708_disable_tx_interrupt()
831 dev->cir_addr + IT8708_C0IER); in it8708_disable_tx_interrupt()
839 outb(inb(dev->cir_addr + IT8708_C0IER) in it8708_enable_tx_interrupt()
841 dev->cir_addr + IT8708_C0IER); in it8708_enable_tx_interrupt()
848 outb(inb(dev->cir_addr + IT8708_C0IER) & in it8708_disable()
850 dev->cir_addr + IT8708_C0IER); in it8708_disable()
856 outb(IT85_FIFOCLR | inb(dev->cir_addr + IT8708_C0MSTCR), in it8708_disable()
857 dev->cir_addr + IT8708_C0MSTCR); in it8708_disable()
864 outb(inb(dev->cir_addr + IT8708_C0IER) & in it8708_init_hardware()
866 dev->cir_addr + IT8708_C0IER); in it8708_init_hardware()
869 outb(inb(dev->cir_addr + IT8708_BANKSEL) | IT8708_HRAE, in it8708_init_hardware()
870 dev->cir_addr + IT8708_BANKSEL); in it8708_init_hardware()
872 outb(ITE_BAUDRATE_DIVISOR & 0xff, dev->cir_addr + IT8708_C0BDLR); in it8708_init_hardware()
874 dev->cir_addr + IT8708_C0BDHR); in it8708_init_hardware()
876 outb(inb(dev->cir_addr + IT8708_BANKSEL) & ~IT8708_HRAE, in it8708_init_hardware()
877 dev->cir_addr + IT8708_BANKSEL); in it8708_init_hardware()
880 outb((inb(dev->cir_addr + IT8708_C0MSTCR) & in it8708_init_hardware()
884 dev->cir_addr + IT8708_C0MSTCR); in it8708_init_hardware()
887 outb((inb(dev->cir_addr + IT8708_C0RCR) & in it8708_init_hardware()
891 dev->cir_addr + IT8708_C0RCR); in it8708_init_hardware()
894 outb((inb(dev->cir_addr + IT8708_C0TCR) & in it8708_init_hardware()
898 dev->cir_addr + IT8708_C0TCR); in it8708_init_hardware()
904 /* IT8512F on ITE8709 HW-specific functions */
909 outb(index, dev->cir_addr + IT8709_RAM_IDX); in it8709_rm()
910 return inb(dev->cir_addr + IT8709_RAM_VAL); in it8709_rm()
916 outb(index, dev->cir_addr + IT8709_RAM_IDX); in it8709_wm()
917 outb(val, dev->cir_addr + IT8709_RAM_VAL); in it8709_wm()
1026 fifo--; in it8709_get_rx_bytes()
1028 buf_size--; in it8709_get_rx_bytes()
1040 * with the device spinlock NOT HELD while waiting for the TX FIFO to get
1047 /* put a byte to the TX fifo; this should be called with the spinlock held */
1175 struct ite_dev *dev = rcdev->priv; in ite_open()
1178 spin_lock_irqsave(&dev->lock, flags); in ite_open()
1181 dev->params->enable_rx(dev); in ite_open()
1183 spin_unlock_irqrestore(&dev->lock, flags); in ite_open()
1191 struct ite_dev *dev = rcdev->priv; in ite_close()
1194 spin_lock_irqsave(&dev->lock, flags); in ite_close()
1197 spin_unlock_irqrestore(&dev->lock, flags); in ite_close()
1198 wait_event_interruptible(dev->tx_ended, !dev->transmitting); in ite_close()
1199 spin_lock_irqsave(&dev->lock, flags); in ite_close()
1201 dev->params->disable(dev); in ite_close()
1203 spin_unlock_irqrestore(&dev->lock, flags); in ite_close()
1292 {"ITE8709", 3}, /* SRAM-Bridged IT8512 */
1303 int ret = -ENOMEM; in ite_probe()
1311 /* input device for IR remote (and tx) */ in ite_probe()
1315 itdev->rdev = rdev; in ite_probe()
1317 ret = -ENODEV; in ite_probe()
1320 model_no = (int)dev_id->driver_data; in ite_probe()
1321 dev_dbg(&pdev->dev, "Auto-detected model: %s\n", in ite_probe()
1326 dev_info(&pdev->dev, "model has been forced to: %s", in ite_probe()
1332 io_rsrc_no = dev_desc->io_rsrc_no; in ite_probe()
1336 pnp_port_len(pdev, io_rsrc_no) < dev_desc->io_region_size) { in ite_probe()
1337 dev_err(&pdev->dev, "IR PNP Port not valid!\n"); in ite_probe()
1342 dev_err(&pdev->dev, "PNP IRQ not valid!\n"); in ite_probe()
1347 itdev->cir_addr = pnp_port_start(pdev, io_rsrc_no); in ite_probe()
1348 itdev->cir_irq = pnp_irq(pdev, 0); in ite_probe()
1351 spin_lock_init(&itdev->lock); in ite_probe()
1355 itdev->pdev = pdev; in ite_probe()
1358 init_waitqueue_head(&itdev->tx_queue); in ite_probe()
1359 init_waitqueue_head(&itdev->tx_ended); in ite_probe()
1361 /* Set model-specific parameters */ in ite_probe()
1362 itdev->params = dev_desc; in ite_probe()
1365 itdev->tx_duty_cycle = 33; in ite_probe()
1366 itdev->tx_carrier_freq = ITE_DEFAULT_CARRIER_FREQ; in ite_probe()
1367 itdev->params->init_hardware(itdev); in ite_probe()
1369 /* set up ir-core props */ in ite_probe()
1370 rdev->priv = itdev; in ite_probe()
1371 rdev->dev.parent = &pdev->dev; in ite_probe()
1372 rdev->allowed_protocols = RC_PROTO_BIT_ALL_IR_DECODER; in ite_probe()
1373 rdev->open = ite_open; in ite_probe()
1374 rdev->close = ite_close; in ite_probe()
1375 rdev->s_idle = ite_s_idle; in ite_probe()
1376 rdev->s_rx_carrier_range = ite_set_rx_carrier_range; in ite_probe()
1378 rdev->min_timeout = 17 * 8 * ITE_BAUDRATE_DIVISOR * in ite_probe()
1380 rdev->timeout = IR_DEFAULT_TIMEOUT; in ite_probe()
1381 rdev->max_timeout = 10 * IR_DEFAULT_TIMEOUT; in ite_probe()
1382 rdev->rx_resolution = ITE_BAUDRATE_DIVISOR * sample_period / 1000; in ite_probe()
1385 rdev->tx_ir = ite_tx_ir; in ite_probe()
1386 rdev->s_tx_carrier = ite_set_tx_carrier; in ite_probe()
1387 rdev->s_tx_duty_cycle = ite_set_tx_duty_cycle; in ite_probe()
1389 rdev->device_name = dev_desc->model; in ite_probe()
1390 rdev->input_id.bustype = BUS_HOST; in ite_probe()
1391 rdev->input_id.vendor = PCI_VENDOR_ID_ITE; in ite_probe()
1392 rdev->input_id.product = 0; in ite_probe()
1393 rdev->input_id.version = 0; in ite_probe()
1394 rdev->driver_name = ITE_DRIVER_NAME; in ite_probe()
1395 rdev->map_name = RC_MAP_RC6_MCE; in ite_probe()
1401 ret = -EBUSY; in ite_probe()
1403 if (!request_region(itdev->cir_addr, in ite_probe()
1404 dev_desc->io_region_size, ITE_DRIVER_NAME)) in ite_probe()
1407 if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED, in ite_probe()
1414 release_region(itdev->cir_addr, itdev->params->io_region_size); in ite_probe()
1430 spin_lock_irqsave(&dev->lock, flags); in ite_remove()
1433 dev->params->disable(dev); in ite_remove()
1435 spin_unlock_irqrestore(&dev->lock, flags); in ite_remove()
1438 free_irq(dev->cir_irq, dev); in ite_remove()
1439 release_region(dev->cir_addr, dev->params->io_region_size); in ite_remove()
1441 rc_unregister_device(dev->rdev); in ite_remove()
1452 wait_event_interruptible(dev->tx_ended, !dev->transmitting); in ite_suspend()
1454 spin_lock_irqsave(&dev->lock, flags); in ite_suspend()
1457 dev->params->disable(dev); in ite_suspend()
1459 spin_unlock_irqrestore(&dev->lock, flags); in ite_suspend()
1469 spin_lock_irqsave(&dev->lock, flags); in ite_resume()
1472 dev->params->init_hardware(dev); in ite_resume()
1474 dev->params->enable_rx(dev); in ite_resume()
1476 spin_unlock_irqrestore(&dev->lock, flags); in ite_resume()
1486 spin_lock_irqsave(&dev->lock, flags); in ite_shutdown()
1489 dev->params->disable(dev); in ite_shutdown()
1491 spin_unlock_irqrestore(&dev->lock, flags); in ite_shutdown()