Merge "Merge android-5.4.7 (861433ef) into msm-5.4"

This commit is contained in:
qctecmdr 2020-02-21 19:28:06 -08:00 • committed by Gerrit - the friendly Code Review server
commit 3ffb183dd9
572 changed files with 69794 additions and 61780 deletions

View file

@ -31,7 +31,18 @@ static ssize_t modalias_show(struct device *dev,
if (len != -ENODEV)
return len;
return of_device_modalias(dev, buf, PAGE_SIZE);
len = of_device_modalias(dev, buf, PAGE_SIZE);
if (len != -ENODEV)
return len;
if (dev->parent->parent->bus == &platform_bus_type) {
struct platform_device *pdev =
to_platform_device(dev->parent->parent);
len = snprintf(buf, PAGE_SIZE, "platform:%s\n", pdev->name);
}
return len;
}
static DEVICE_ATTR_RO(modalias);
@ -45,13 +56,18 @@ static int serdev_device_uevent(struct device *dev, struct kobj_uevent_env *env)
{
int rc;
/* TODO: platform modalias */
rc = acpi_device_uevent_modalias(dev, env);
if (rc != -ENODEV)
return rc;
return of_device_uevent_modalias(dev, env);
rc = of_device_uevent_modalias(dev, env);
if (rc != -ENODEV)
return rc;
if (dev->parent->parent->bus == &platform_bus_type)
rc = dev->parent->parent->bus->uevent(dev->parent->parent, env);
return rc;
}
static void serdev_device_release(struct device *dev)
@ -87,11 +103,17 @@ static int serdev_device_match(struct device *dev, struct device_driver *drv)
if (!is_serdev_device(dev))
return 0;
/* TODO: platform matching */
if (acpi_driver_match_device(dev, drv))
return 1;
return of_driver_match_device(dev, drv);
if (of_driver_match_device(dev, drv))
return 1;
if (dev->parent->parent->bus == &platform_bus_type &&
dev->parent->parent->bus->match(dev->parent->parent, drv))
return 1;
return 0;
}
/**
@ -620,6 +642,33 @@ static inline int acpi_serdev_register_devices(struct serdev_controller *ctrl)
}
#endif /* CONFIG_ACPI */
static int platform_serdev_register_devices(struct serdev_controller *ctrl)
{
struct serdev_device *serdev;
int err;
if (ctrl->dev.parent->bus != &platform_bus_type)
return -ENODEV;
serdev = serdev_device_alloc(ctrl);
if (!serdev) {
dev_err(&ctrl->dev, "failed to allocate serdev device for %s\n",
dev_name(ctrl->dev.parent));
return -ENOMEM;
}
pm_runtime_no_callbacks(&serdev->dev);
err = serdev_device_add(serdev);
if (err) {
dev_err(&serdev->dev,
"failure adding device. status %d\n", err);
serdev_device_put(serdev);
}
return err;
}
/**
* serdev_controller_add() - Add an serdev controller
* @ctrl: controller to be registered.
@ -629,7 +678,7 @@ static inline int acpi_serdev_register_devices(struct serdev_controller *ctrl)
*/
int serdev_controller_add(struct serdev_controller *ctrl)
{
int ret_of, ret_acpi, ret;
int ret_of, ret_acpi, ret_platform, ret;
/* Can't register until after driver model init */
if (WARN_ON(!is_registered))
@ -643,9 +692,11 @@ int serdev_controller_add(struct serdev_controller *ctrl)
ret_of = of_serdev_register_devices(ctrl);
ret_acpi = acpi_serdev_register_devices(ctrl);
if (ret_of && ret_acpi) {
dev_dbg(&ctrl->dev, "no devices registered: of:%d acpi:%d\n",
ret_of, ret_acpi);
ret_platform = platform_serdev_register_devices(ctrl);
if (ret_of && ret_acpi && ret_platform) {
dev_dbg(&ctrl->dev, "no devices registered: of:%d acpi:%d "
"platform:%d\n",
ret_of, ret_acpi, ret_platform);
ret = -ENODEV;
goto err_rpm_disable;
}

View file

@ -2270,27 +2270,6 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,
mode |= ATMEL_US_USMODE_NORMAL;
}
/* set the mode, clock divisor, parity, stop bits and data size */
atmel_uart_writel(port, ATMEL_US_MR, mode);
/*
* when switching the mode, set the RTS line state according to the
* new mode, otherwise keep the former state
*/
if ((old_mode & ATMEL_US_USMODE) != (mode & ATMEL_US_USMODE)) {
unsigned int rts_state;
if ((mode & ATMEL_US_USMODE) == ATMEL_US_USMODE_HWHS) {
/* let the hardware control the RTS line */
rts_state = ATMEL_US_RTSDIS;
} else {
/* force RTS line to low level */
rts_state = ATMEL_US_RTSEN;
}
atmel_uart_writel(port, ATMEL_US_CR, rts_state);
}
/*
* Set the baud rate:
* Fractional baudrate allows to setup output frequency more
@ -2317,6 +2296,28 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,
if (!(port->iso7816.flags & SER_ISO7816_ENABLED))
atmel_uart_writel(port, ATMEL_US_BRGR, quot);
/* set the mode, clock divisor, parity, stop bits and data size */
atmel_uart_writel(port, ATMEL_US_MR, mode);
/*
* when switching the mode, set the RTS line state according to the
* new mode, otherwise keep the former state
*/
if ((old_mode & ATMEL_US_USMODE) != (mode & ATMEL_US_USMODE)) {
unsigned int rts_state;
if ((mode & ATMEL_US_USMODE) == ATMEL_US_USMODE_HWHS) {
/* let the hardware control the RTS line */
rts_state = ATMEL_US_RTSDIS;
} else {
/* force RTS line to low level */
rts_state = ATMEL_US_RTSEN;
}
atmel_uart_writel(port, ATMEL_US_CR, rts_state);
}
atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);
atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN | ATMEL_US_RXEN);
atmel_port->tx_stopped = false;

View file

@ -2603,6 +2603,7 @@ struct tty_driver *uart_console_device(struct console *co, int *index)
*index = co->index;
return p->tty_driver;
}
EXPORT_SYMBOL_GPL(uart_console_device);
static ssize_t uart_get_attr_uartclk(struct device *dev,
struct device_attribute *attr, char *buf)

View file

@ -679,6 +679,9 @@ static irqreturn_t sprd_handle_irq(int irq, void *dev_id)
if (ims & SPRD_IMSR_TIMEOUT)
serial_out(port, SPRD_ICLR, SPRD_ICLR_TIMEOUT);
if (ims & SPRD_IMSR_BREAK_DETECT)
serial_out(port, SPRD_ICLR, SPRD_IMSR_BREAK_DETECT);
if (ims & (SPRD_IMSR_RX_FIFO_FULL | SPRD_IMSR_BREAK_DETECT |
SPRD_IMSR_TIMEOUT))
sprd_rx(port);