mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
TTY/Serial patches for 4.20-rc1
Here is the big tty and serial pull request for 4.20-rc1 Lots of little things here, including a merge from the SPI tree in order to keep things simpler for everyone to sync around for one platform. Major stuff is: - tty buffer clearing after use - atmel_serial fixes and additions - xilinx uart driver updates and of course, lots of tiny fixes and additions to individual serial drivers. All of these have been in linux-next with no reported issues for a while. Signed-off-by: Greg Kroah-Hartman <[email protected]> -----BEGIN PGP SIGNATURE----- iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCW9bW0w8cZ3JlZ0Brcm9h aC5jb20ACgkQMUfUDdst+ymYhgCfbxr0T+4lF/rpGxNXNnV4u5boRJUAn2L8R+1y URbAWHvKfaby2AVfQ1z0 =qTHH -----END PGP SIGNATURE----- Merge tag 'tty-4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial updates from Greg KH: "Here is the big tty and serial pull request for 4.20-rc1 Lots of little things here, including a merge from the SPI tree in order to keep things simpler for everyone to sync around for one platform. Major stuff is: - tty buffer clearing after use - atmel_serial fixes and additions - xilinx uart driver updates and of course, lots of tiny fixes and additions to individual serial drivers. All of these have been in linux-next with no reported issues for a while" * tag 'tty-4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (66 commits) of: base: Change logic in of_alias_get_alias_list() of: base: Fix english spelling in of_alias_get_alias_list() serial: sh-sci: do not warn if DMA transfers are not supported serial: uartps: Do not allow use aliases >= MAX_UART_INSTANCES tty: check name length in tty_find_polling_driver() serial: sh-sci: Add r8a77990 support tty: wipe buffer if not echoing data tty: wipe buffer. serial: fsl_lpuart: Remove the alias node dependence TTY: sn_console: Replace spin_is_locked() with spin_trylock() Revert "serial:serial_core: Allow use of CTS for PPS line discipline" serial: 8250_uniphier: add auto-flow-control support serial: 8250_uniphier: flatten probe function serial: 8250_uniphier: remove unused "fifo-size" property dt-bindings: serial: sh-sci: Document r8a7744 bindings serial: uartps: Fix missing unlock on error in cdns_get_id() tty/serial: atmel: add ISO7816 support tty/serial_core: add ISO7816 infrastructure serial:serial_core: Allow use of CTS for PPS line discipline serial: docs: Fix filename for serial reference implementation ...
This commit is contained in:
commit
5bd4af34a0
43 changed files with 977 additions and 380 deletions
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#define pr_fmt(fmt) "OF: " fmt
|
||||
|
||||
#include <linux/bitmap.h>
|
||||
#include <linux/console.h>
|
||||
#include <linux/ctype.h>
|
||||
#include <linux/cpu.h>
|
||||
|
|
@ -1985,6 +1986,59 @@ int of_alias_get_id(struct device_node *np, const char *stem)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(of_alias_get_id);
|
||||
|
||||
/**
|
||||
* of_alias_get_alias_list - Get alias list for the given device driver
|
||||
* @matches: Array of OF device match structures to search in
|
||||
* @stem: Alias stem of the given device_node
|
||||
* @bitmap: Bitmap field pointer
|
||||
* @nbits: Maximum number of alias IDs which can be recorded in bitmap
|
||||
*
|
||||
* The function travels the lookup table to record alias ids for the given
|
||||
* device match structures and alias stem.
|
||||
*
|
||||
* Return: 0 or -ENOSYS when !CONFIG_OF or
|
||||
* -EOVERFLOW if alias ID is greater then allocated nbits
|
||||
*/
|
||||
int of_alias_get_alias_list(const struct of_device_id *matches,
|
||||
const char *stem, unsigned long *bitmap,
|
||||
unsigned int nbits)
|
||||
{
|
||||
struct alias_prop *app;
|
||||
int ret = 0;
|
||||
|
||||
/* Zero bitmap field to make sure that all the time it is clean */
|
||||
bitmap_zero(bitmap, nbits);
|
||||
|
||||
mutex_lock(&of_mutex);
|
||||
pr_debug("%s: Looking for stem: %s\n", __func__, stem);
|
||||
list_for_each_entry(app, &aliases_lookup, link) {
|
||||
pr_debug("%s: stem: %s, id: %d\n",
|
||||
__func__, app->stem, app->id);
|
||||
|
||||
if (strcmp(app->stem, stem) != 0) {
|
||||
pr_debug("%s: stem comparison didn't pass %s\n",
|
||||
__func__, app->stem);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (of_match_node(matches, app->np)) {
|
||||
pr_debug("%s: Allocated ID %d\n", __func__, app->id);
|
||||
|
||||
if (app->id >= nbits) {
|
||||
pr_warn("%s: ID %d >= than bitmap field %d\n",
|
||||
__func__, app->id, nbits);
|
||||
ret = -EOVERFLOW;
|
||||
} else {
|
||||
set_bit(app->id, bitmap);
|
||||
}
|
||||
}
|
||||
}
|
||||
mutex_unlock(&of_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(of_alias_get_alias_list);
|
||||
|
||||
/**
|
||||
* of_alias_get_highest_id - Get highest alias id for the given stem
|
||||
* @stem: Alias stem to be examined
|
||||
|
|
|
|||
Loading…
Reference in a new issue