/* * Disable the port */ static void atmel_shutdown(struct uart_port *port) { struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port; /* * Ensure everything is stopped. */ atmel_stop_rx(port); atmel_stop_tx(port); /* * Shut-down the DMA. */ if (atmel_port->use_dma_rx) { int i; for (i = 0; i < 2; i++) { struct atmel_dma_buffer *pdc = &atmel_port->pdc_rx[i]; dma_unmap_single(port->dev, pdc->dma_addr, pdc->dma_size, DMA_FROM_DEVICE); kfree(pdc->buf); } } if (atmel_port->use_dma_tx) { struct atmel_dma_buffer *pdc = &atmel_port->pdc_tx; dma_unmap_single(port->dev, pdc->dma_addr, pdc->dma_size, DMA_TO_DEVICE); } /* * Disable all interrupts, port and break condition. */ UART_PUT_CR(port, ATMEL_US_RSTSTA); UART_PUT_IDR(port, -1); /* * Free the interrupt */ free_irq(port->irq, port); /* * If there is a specific "close" function (to unregister * control line interrupts) */ if (atmel_close_hook) atmel_close_hook(port); }
/* * Disable the port */ static void atmel_shutdown(struct uart_port *port) { struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port; /* * Disable all interrupts, port and break condition. */ UART_PUT_CR(port, ATMEL_US_RSTSTA); UART_PUT_IDR(port, -1); /* * Free the interrupt */ free_irq(port->irq, port); /* * If there is a specific "close" function (to unregister * control line interrupts) */ if (atmel_close_hook) atmel_close_hook(port); }