diff --git a/src/ithc-dma.c b/src/ithc-dma.c index 630807d..983b4fe 100644 --- a/src/ithc-dma.c +++ b/src/ithc-dma.c @@ -134,6 +134,7 @@ int ithc_dma_rx_init(struct ithc *ithc, u8 channel, const char *devname) { } void ithc_dma_rx_enable(struct ithc *ithc, u8 channel) { bitsb_set(&ithc->regs->dma_rx[channel].control, DMA_RX_CONTROL_ENABLE | DMA_RX_CONTROL_IRQ_ERROR | DMA_RX_CONTROL_IRQ_DATA); + CHECK(waitl, ithc, &ithc->regs->dma_rx[1].status, DMA_RX_STATUS_ENABLED, DMA_RX_STATUS_ENABLED); } int ithc_dma_tx_init(struct ithc *ithc) { diff --git a/src/ithc-dma.h b/src/ithc-dma.h index 76dfaf4..cba2cac 100644 --- a/src/ithc-dma.h +++ b/src/ithc-dma.h @@ -76,7 +76,5 @@ void ithc_dma_rx_enable(struct ithc *ithc, u8 channel); int ithc_dma_tx_init(struct ithc *ithc); int ithc_dma_rx(struct ithc *ithc, u8 channel); int ithc_dma_tx(struct ithc *ithc, u32 cmdcode, u32 datasize, void *cmddata); -void *ithc_data_kmap(struct ithc_dma_data_buffer *b); -void ithc_data_kunmap(struct ithc_dma_data_buffer *b, void *p); int ithc_set_multitouch(struct ithc *ithc, bool enable); diff --git a/src/ithc-main.c b/src/ithc-main.c index 7995139..370906f 100644 --- a/src/ithc-main.c +++ b/src/ithc-main.c @@ -318,7 +318,7 @@ static int ithc_poll_thread(void *arg) { static void ithc_disable(struct ithc *ithc) { bitsl_set(&ithc->regs->control_bits, CONTROL_QUIESCE); - waitl(ithc, &ithc->regs->control_bits, CONTROL_IS_QUIESCED, CONTROL_IS_QUIESCED); + CHECK(waitl, ithc, &ithc->regs->control_bits, CONTROL_IS_QUIESCED, CONTROL_IS_QUIESCED); bitsl(&ithc->regs->control_bits, CONTROL_NRESET, 0); bitsb(&ithc->regs->spi_cmd.control, SPI_CMD_CONTROL_SEND, 0); bitsb(&ithc->regs->dma_tx.control, DMA_TX_CONTROL_SEND, 0); @@ -509,17 +509,14 @@ static void ithc_remove(struct pci_dev *pci) { static int ithc_suspend(struct device *dev) { struct pci_dev *pci = to_pci_dev(dev); pci_dbg(pci, "pm suspend\n"); - pci_disable_device(pci); + devres_release_group(dev, ithc_start); return 0; } static int ithc_resume(struct device *dev) { struct pci_dev *pci = to_pci_dev(dev); - struct ithc *ithc = dev_get_drvdata(dev); pci_dbg(pci, "pm resume\n"); - CHECK_RET(pcim_enable_device, pci); - pci_set_master(pci); - return 0; + return ithc_start(pci); } static int ithc_freeze(struct device *dev) {