Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39da979c authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull serial driver fixes from Greg KH:
 "Here are some small serial driver fixes for 4.8-rc5.  One fixes an
  oft-reported build issue with the fintek driver, another reverts a
  patch that was causing problems, one fixes a crash, and some new
  device ids were added.

  All of these have been in linux-next for a while"

* tag 'tty-4.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  serial: 8250: added acces i/o products quad and octal serial cards
  serial: 8250_mid: fix divide error bug if baud rate is 0
  Revert "tty/serial/8250: use mctrl_gpio helpers"
  8250/fintek: rename IRQ_MODE macro
parents 70dad499 c8d19242
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -42,9 +42,6 @@ Optional properties:
- auto-flow-control: one way to enable automatic flow control support. The
  driver is allowed to detect support for the capability even without this
  property.
- {rts,cts,dtr,dsr,rng,dcd}-gpios: specify a GPIO for RTS/CTS/DTR/DSR/RI/DCD
  line respectively. It will use specified GPIO instead of the peripheral
  function pin for the UART feature. If unsure, don't specify this property.

Note:
* fsl,ns16550:
@@ -66,19 +63,3 @@ Example:
		interrupts = <10>;
		reg-shift = <2>;
	};

Example for OMAP UART using GPIO-based modem control signals:

	uart4: serial@49042000 {
		compatible = "ti,omap3-uart";
		reg = <0x49042000 0x400>;
		interrupts = <80>;
		ti,hwmods = "uart4";
		clock-frequency = <48000000>;
		cts-gpios = <&gpio3 5 GPIO_ACTIVE_LOW>;
		rts-gpios = <&gpio3 6 GPIO_ACTIVE_LOW>;
		dtr-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
		dsr-gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
		dcd-gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
		rng-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
	};
+1 −34
Original line number Diff line number Diff line
@@ -15,8 +15,6 @@
#include <linux/serial_reg.h>
#include <linux/dmaengine.h>

#include "../serial_mctrl_gpio.h"

struct uart_8250_dma {
	int (*tx_dma)(struct uart_8250_port *p);
	int (*rx_dma)(struct uart_8250_port *p);
@@ -133,43 +131,12 @@ void serial8250_em485_destroy(struct uart_8250_port *p);

static inline void serial8250_out_MCR(struct uart_8250_port *up, int value)
{
	int mctrl_gpio = 0;

	serial_out(up, UART_MCR, value);

	if (value & UART_MCR_RTS)
		mctrl_gpio |= TIOCM_RTS;
	if (value & UART_MCR_DTR)
		mctrl_gpio |= TIOCM_DTR;

	mctrl_gpio_set(up->gpios, mctrl_gpio);
}

static inline int serial8250_in_MCR(struct uart_8250_port *up)
{
	int mctrl, mctrl_gpio = 0;

	mctrl = serial_in(up, UART_MCR);

	/* save current MCR values */
	if (mctrl & UART_MCR_RTS)
		mctrl_gpio |= TIOCM_RTS;
	if (mctrl & UART_MCR_DTR)
		mctrl_gpio |= TIOCM_DTR;

	mctrl_gpio = mctrl_gpio_get_outputs(up->gpios, &mctrl_gpio);

	if (mctrl_gpio & TIOCM_RTS)
		mctrl |= UART_MCR_RTS;
	else
		mctrl &= ~UART_MCR_RTS;

	if (mctrl_gpio & TIOCM_DTR)
		mctrl |= UART_MCR_DTR;
	else
		mctrl &= ~UART_MCR_DTR;

	return mctrl;
	return serial_in(up, UART_MCR);
}

#if defined(__alpha__) && !defined(CONFIG_PCI)
+0 −9
Original line number Diff line number Diff line
@@ -974,8 +974,6 @@ int serial8250_register_8250_port(struct uart_8250_port *up)

	uart = serial8250_find_match_or_unused(&up->port);
	if (uart && uart->port.type != PORT_8250_CIR) {
		struct mctrl_gpios *gpios;

		if (uart->port.dev)
			uart_remove_one_port(&serial8250_reg, &uart->port);

@@ -1013,13 +1011,6 @@ int serial8250_register_8250_port(struct uart_8250_port *up)
		if (up->port.flags & UPF_FIXED_TYPE)
			uart->port.type = up->port.type;

		gpios = mctrl_gpio_init(&uart->port, 0);
		if (IS_ERR(gpios)) {
			if (PTR_ERR(gpios) != -ENOSYS)
				return PTR_ERR(gpios);
		} else
			uart->gpios = gpios;

		serial8250_set_defaults(uart);

		/* Possibly override default I/O functions.  */
+2 −2
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@
#define IO_ADDR2 0x60
#define LDN 0x7

#define IRQ_MODE	0x70
#define FINTEK_IRQ_MODE	0x70
#define IRQ_SHARE	BIT(4)
#define IRQ_MODE_MASK	(BIT(6) | BIT(5))
#define IRQ_LEVEL_LOW	0
@@ -195,7 +195,7 @@ static int fintek_8250_set_irq_mode(struct fintek_8250 *pdata, bool level_mode)
	outb(LDN, pdata->base_port + ADDR_PORT);
	outb(pdata->index, pdata->base_port + DATA_PORT);

	outb(IRQ_MODE, pdata->base_port + ADDR_PORT);
	outb(FINTEK_IRQ_MODE, pdata->base_port + ADDR_PORT);
	tmp = inb(pdata->base_port + DATA_PORT);

	tmp &= ~IRQ_MODE_MASK;
+3 −0
Original line number Diff line number Diff line
@@ -168,6 +168,9 @@ static void mid8250_set_termios(struct uart_port *p,
	unsigned long w = BIT(24) - 1;
	unsigned long mul, div;

	/* Gracefully handle the B0 case: fall back to B9600 */
	fuart = fuart ? fuart : 9600 * 16;

	if (mid->board->freq < fuart) {
		/* Find prescaler value that satisfies Fuart < Fref */
		if (mid->board->freq > baud)
Loading