Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] ite-cir: finish tx before suspending

Continuing with IR transmit after resuming from suspend seems fairly
useless, given that the only place we can actually end up suspending is
after IR has been send and we're simply mdelay'ing. Lets simplify the
resume path by just waiting on tx to complete in the suspend path, then
we know we can't be transmitting on resume, and reinitialization of the
hardware registers becomes more straight-forward.

CC: Juan Jesús García de Soria <skandalfo@gmail.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Jarod Wilson and committed by
Mauro Carvalho Chehab
c8120454 f0c1629d

+7 -9
+7 -9
drivers/media/rc/ite-cir.c
··· 1650 1650 1651 1651 ite_dbg("%s called", __func__); 1652 1652 1653 + /* wait for any transmission to end */ 1654 + wait_event_interruptible(dev->tx_ended, !dev->transmitting); 1655 + 1653 1656 spin_lock_irqsave(&dev->lock, flags); 1654 1657 1655 1658 /* disable all interrupts */ ··· 1673 1670 1674 1671 spin_lock_irqsave(&dev->lock, flags); 1675 1672 1676 - if (dev->transmitting) { 1677 - /* wake up the transmitter */ 1678 - wake_up_interruptible(&dev->tx_queue); 1679 - } else { 1680 - /* reinitialize hardware config registers */ 1681 - dev->params.init_hardware(dev); 1682 - /* enable the receiver */ 1683 - dev->params.enable_rx(dev); 1684 - } 1673 + /* reinitialize hardware config registers */ 1674 + dev->params.init_hardware(dev); 1675 + /* enable the receiver */ 1676 + dev->params.enable_rx(dev); 1685 1677 1686 1678 spin_unlock_irqrestore(&dev->lock, flags); 1687 1679