diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/serial/atmel_serial.c | 9 | ||||
-rw-r--r-- | drivers/usb/gadget/atmel_usba_udc.c | 14 |
2 files changed, 15 insertions, 8 deletions
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index 8f58f7ff0dd7..b3497d7e5354 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c | |||
@@ -1020,7 +1020,8 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1020 | 1020 | ||
1021 | /* Get current mode register */ | 1021 | /* Get current mode register */ |
1022 | mode = UART_GET_MR(port) & ~(ATMEL_US_USCLKS | ATMEL_US_CHRL | 1022 | mode = UART_GET_MR(port) & ~(ATMEL_US_USCLKS | ATMEL_US_CHRL |
1023 | | ATMEL_US_NBSTOP | ATMEL_US_PAR); | 1023 | | ATMEL_US_NBSTOP | ATMEL_US_PAR |
1024 | | ATMEL_US_USMODE); | ||
1024 | 1025 | ||
1025 | baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16); | 1026 | baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16); |
1026 | quot = uart_get_divisor(port, baud); | 1027 | quot = uart_get_divisor(port, baud); |
@@ -1065,6 +1066,12 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1065 | } else | 1066 | } else |
1066 | mode |= ATMEL_US_PAR_NONE; | 1067 | mode |= ATMEL_US_PAR_NONE; |
1067 | 1068 | ||
1069 | /* hardware handshake (RTS/CTS) */ | ||
1070 | if (termios->c_cflag & CRTSCTS) | ||
1071 | mode |= ATMEL_US_USMODE_HWHS; | ||
1072 | else | ||
1073 | mode |= ATMEL_US_USMODE_NORMAL; | ||
1074 | |||
1068 | spin_lock_irqsave(&port->lock, flags); | 1075 | spin_lock_irqsave(&port->lock, flags); |
1069 | 1076 | ||
1070 | port->read_status_mask = ATMEL_US_OVRE; | 1077 | port->read_status_mask = ATMEL_US_OVRE; |
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index c22fab164113..563d57275448 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c | |||
@@ -319,7 +319,7 @@ static inline void usba_cleanup_debugfs(struct usba_udc *udc) | |||
319 | 319 | ||
320 | static int vbus_is_present(struct usba_udc *udc) | 320 | static int vbus_is_present(struct usba_udc *udc) |
321 | { | 321 | { |
322 | if (udc->vbus_pin != -1) | 322 | if (gpio_is_valid(udc->vbus_pin)) |
323 | return gpio_get_value(udc->vbus_pin); | 323 | return gpio_get_value(udc->vbus_pin); |
324 | 324 | ||
325 | /* No Vbus detection: Assume always present */ | 325 | /* No Vbus detection: Assume always present */ |
@@ -1821,7 +1821,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) | |||
1821 | DBG(DBG_GADGET, "registered driver `%s'\n", driver->driver.name); | 1821 | DBG(DBG_GADGET, "registered driver `%s'\n", driver->driver.name); |
1822 | 1822 | ||
1823 | udc->vbus_prev = 0; | 1823 | udc->vbus_prev = 0; |
1824 | if (udc->vbus_pin != -1) | 1824 | if (gpio_is_valid(udc->vbus_pin)) |
1825 | enable_irq(gpio_to_irq(udc->vbus_pin)); | 1825 | enable_irq(gpio_to_irq(udc->vbus_pin)); |
1826 | 1826 | ||
1827 | /* If Vbus is present, enable the controller and wait for reset */ | 1827 | /* If Vbus is present, enable the controller and wait for reset */ |
@@ -1852,7 +1852,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | |||
1852 | if (driver != udc->driver || !driver->unbind) | 1852 | if (driver != udc->driver || !driver->unbind) |
1853 | return -EINVAL; | 1853 | return -EINVAL; |
1854 | 1854 | ||
1855 | if (udc->vbus_pin != -1) | 1855 | if (gpio_is_valid(udc->vbus_pin)) |
1856 | disable_irq(gpio_to_irq(udc->vbus_pin)); | 1856 | disable_irq(gpio_to_irq(udc->vbus_pin)); |
1857 | 1857 | ||
1858 | spin_lock_irqsave(&udc->lock, flags); | 1858 | spin_lock_irqsave(&udc->lock, flags); |
@@ -1910,7 +1910,7 @@ static int __init usba_udc_probe(struct platform_device *pdev) | |||
1910 | udc->pdev = pdev; | 1910 | udc->pdev = pdev; |
1911 | udc->pclk = pclk; | 1911 | udc->pclk = pclk; |
1912 | udc->hclk = hclk; | 1912 | udc->hclk = hclk; |
1913 | udc->vbus_pin = -1; | 1913 | udc->vbus_pin = -ENODEV; |
1914 | 1914 | ||
1915 | ret = -ENOMEM; | 1915 | ret = -ENOMEM; |
1916 | udc->regs = ioremap(regs->start, regs->end - regs->start + 1); | 1916 | udc->regs = ioremap(regs->start, regs->end - regs->start + 1); |
@@ -1996,7 +1996,7 @@ static int __init usba_udc_probe(struct platform_device *pdev) | |||
1996 | goto err_device_add; | 1996 | goto err_device_add; |
1997 | } | 1997 | } |
1998 | 1998 | ||
1999 | if (pdata->vbus_pin >= 0) { | 1999 | if (gpio_is_valid(pdata->vbus_pin)) { |
2000 | if (!gpio_request(pdata->vbus_pin, "atmel_usba_udc")) { | 2000 | if (!gpio_request(pdata->vbus_pin, "atmel_usba_udc")) { |
2001 | udc->vbus_pin = pdata->vbus_pin; | 2001 | udc->vbus_pin = pdata->vbus_pin; |
2002 | 2002 | ||
@@ -2005,7 +2005,7 @@ static int __init usba_udc_probe(struct platform_device *pdev) | |||
2005 | "atmel_usba_udc", udc); | 2005 | "atmel_usba_udc", udc); |
2006 | if (ret) { | 2006 | if (ret) { |
2007 | gpio_free(udc->vbus_pin); | 2007 | gpio_free(udc->vbus_pin); |
2008 | udc->vbus_pin = -1; | 2008 | udc->vbus_pin = -ENODEV; |
2009 | dev_warn(&udc->pdev->dev, | 2009 | dev_warn(&udc->pdev->dev, |
2010 | "failed to request vbus irq; " | 2010 | "failed to request vbus irq; " |
2011 | "assuming always on\n"); | 2011 | "assuming always on\n"); |
@@ -2051,7 +2051,7 @@ static int __exit usba_udc_remove(struct platform_device *pdev) | |||
2051 | usba_ep_cleanup_debugfs(&usba_ep[i]); | 2051 | usba_ep_cleanup_debugfs(&usba_ep[i]); |
2052 | usba_cleanup_debugfs(udc); | 2052 | usba_cleanup_debugfs(udc); |
2053 | 2053 | ||
2054 | if (udc->vbus_pin != -1) | 2054 | if (gpio_is_valid(udc->vbus_pin)) |
2055 | gpio_free(udc->vbus_pin); | 2055 | gpio_free(udc->vbus_pin); |
2056 | 2056 | ||
2057 | free_irq(udc->irq, udc); | 2057 | free_irq(udc->irq, udc); |