.. | .. |
---|
5 | 5 | * Copyright (C) 2003-2013 STMicroelectronics (R&D) Limited |
---|
6 | 6 | */ |
---|
7 | 7 | |
---|
8 | | -#if defined(CONFIG_SERIAL_ST_ASC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) |
---|
9 | | -#define SUPPORT_SYSRQ |
---|
10 | | -#endif |
---|
11 | | - |
---|
12 | 8 | #include <linux/module.h> |
---|
13 | 9 | #include <linux/serial.h> |
---|
14 | 10 | #include <linux/console.h> |
---|
.. | .. |
---|
508 | 504 | struct ktermios *old) |
---|
509 | 505 | { |
---|
510 | 506 | struct asc_port *ascport = to_asc_port(port); |
---|
511 | | - struct device_node *np = port->dev->of_node; |
---|
512 | 507 | struct gpio_desc *gpiod; |
---|
513 | 508 | unsigned int baud; |
---|
514 | 509 | u32 ctrl_val; |
---|
.. | .. |
---|
540 | 535 | /* set character length */ |
---|
541 | 536 | if ((cflag & CSIZE) == CS7) { |
---|
542 | 537 | ctrl_val |= ASC_CTL_MODE_7BIT_PAR; |
---|
| 538 | + cflag |= PARENB; |
---|
543 | 539 | } else { |
---|
544 | 540 | ctrl_val |= (cflag & PARENB) ? ASC_CTL_MODE_8BIT_PAR : |
---|
545 | 541 | ASC_CTL_MODE_8BIT; |
---|
| 542 | + cflag &= ~CSIZE; |
---|
| 543 | + cflag |= CS8; |
---|
546 | 544 | } |
---|
| 545 | + termios->c_cflag = cflag; |
---|
547 | 546 | |
---|
548 | 547 | /* set stop bit */ |
---|
549 | 548 | ctrl_val |= (cflag & CSTOPB) ? ASC_CTL_STOP_2BIT : ASC_CTL_STOP_1BIT; |
---|
.. | .. |
---|
570 | 569 | pinctrl_select_state(ascport->pinctrl, |
---|
571 | 570 | ascport->states[NO_HW_FLOWCTRL]); |
---|
572 | 571 | |
---|
573 | | - gpiod = devm_fwnode_get_gpiod_from_child(port->dev, |
---|
574 | | - "rts", |
---|
575 | | - &np->fwnode, |
---|
576 | | - GPIOD_OUT_LOW, |
---|
577 | | - np->name); |
---|
578 | | - if (!IS_ERR(gpiod)) |
---|
| 572 | + gpiod = devm_gpiod_get(port->dev, "rts", GPIOD_OUT_LOW); |
---|
| 573 | + if (!IS_ERR(gpiod)) { |
---|
| 574 | + gpiod_set_consumer_name(gpiod, |
---|
| 575 | + port->dev->of_node->name); |
---|
579 | 576 | ascport->rts = gpiod; |
---|
| 577 | + } |
---|
580 | 578 | } |
---|
581 | 579 | } |
---|
582 | 580 | |
---|
.. | .. |
---|
730 | 728 | port->fifosize = ASC_FIFO_SIZE; |
---|
731 | 729 | port->dev = &pdev->dev; |
---|
732 | 730 | port->irq = platform_get_irq(pdev, 0); |
---|
| 731 | + port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_ST_ASC_CONSOLE); |
---|
733 | 732 | |
---|
734 | 733 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
---|
735 | 734 | port->membase = devm_ioremap_resource(&pdev->dev, res); |
---|