Skip to content

Commit

Permalink
Merge tag 'tty-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/gregkh/tty

Pull tty / serial driver updates from Greg KH:
 "Here is the big set of TTY/Serial driver updates and cleanups for
  6.9-rc1. Included in here are:

   - more tty cleanups from Jiri

   - loads of 8250 driver cleanups from Andy

   - max310x driver updates

   - samsung serial driver updates

   - uart_prepare_sysrq_char() updates for many drivers

   - platform driver remove callback void cleanups

   - stm32 driver updates

   - other small tty/serial driver updates

  All of these have been in linux-next for a long time with no reported
  issues"

* tag 'tty-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (199 commits)
  dt-bindings: serial: stm32: add power-domains property
  serial: 8250_dw: Replace ACPI device check by a quirk
  serial: Lock console when calling into driver before registration
  serial: 8250_uniphier: Switch to use uart_read_port_properties()
  serial: 8250_tegra: Switch to use uart_read_port_properties()
  serial: 8250_pxa: Switch to use uart_read_port_properties()
  serial: 8250_omap: Switch to use uart_read_port_properties()
  serial: 8250_of: Switch to use uart_read_port_properties()
  serial: 8250_lpc18xx: Switch to use uart_read_port_properties()
  serial: 8250_ingenic: Switch to use uart_read_port_properties()
  serial: 8250_dw: Switch to use uart_read_port_properties()
  serial: 8250_bcm7271: Switch to use uart_read_port_properties()
  serial: 8250_bcm2835aux: Switch to use uart_read_port_properties()
  serial: 8250_aspeed_vuart: Switch to use uart_read_port_properties()
  serial: port: Introduce a common helper to read properties
  serial: core: Add UPIO_UNKNOWN constant for unknown port type
  serial: core: Move struct uart_port::quirks closer to possible values
  serial: sh-sci: Call sci_serial_{in,out}() directly
  serial: core: only stop transmit when HW fifo is empty
  serial: pch: Use uart_prepare_sysrq_char().
  ...
  • Loading branch information
torvalds committed Mar 21, 2024
2 parents e09bf86 + d6c0d89 commit 3bcb0bf
Show file tree
Hide file tree
Showing 122 changed files with 3,545 additions and 2,524 deletions.
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/serial/cdns,uart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ required:

allOf:
- $ref: serial.yaml#
- $ref: rs485.yaml#
- if:
properties:
compatible:
Expand Down
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/serial/fsl-lpuart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ properties:
- items:
- enum:
- fsl,imx93-lpuart
- fsl,imx95-lpuart
- const: fsl,imx8ulp-lpuart
- const: fsl,imx7ulp-lpuart
- items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ properties:
- renesas,hscif-r8a779a0 # R-Car V3U
- renesas,hscif-r8a779f0 # R-Car S4-8
- renesas,hscif-r8a779g0 # R-Car V4H
- renesas,hscif-r8a779h0 # R-Car V4M
- const: renesas,rcar-gen4-hscif # R-Car Gen4
- const: renesas,hscif # generic HSCIF compatible UART

Expand Down
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/serial/samsung_uart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ allOf:
then:
required:
- samsung,uart-fifosize
properties:
reg-io-width: false

unevaluatedProperties: false

Expand Down
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/serial/serial.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ properties:
TX FIFO threshold configuration (in bytes).

patternProperties:
"^(bluetooth|bluetooth-gnss|gnss|gps|mcu)$":
"^(bluetooth|bluetooth-gnss|gnss|gps|mcu|onewire)$":
if:
type: object
then:
Expand Down
55 changes: 55 additions & 0 deletions Documentation/devicetree/bindings/serial/st,asc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/serial/st,asc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: STMicroelectronics STi SoCs Serial Port

maintainers:
- Patrice Chotard <[email protected]>

allOf:
- $ref: serial.yaml#

properties:
compatible:
const: st,asc

reg:
maxItems: 1

interrupts:
maxItems: 1

clocks:
maxItems: 1

st,hw-flow-ctrl:
description: When set, enable hardware flow control.
type: boolean

st,force-m1:
description: When set, force asc to be in Mode-1. This is recommended for
high bit rates above 19.2K.
type: boolean

required:
- compatible
- reg
- interrupts
- clocks

unevaluatedProperties: false

examples:
- |
#include <dt-bindings/clock/stih407-clks.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
serial@9830000 {
compatible = "st,asc";
reg = <0x9830000 0x2c>;
interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
};
...
3 changes: 3 additions & 0 deletions Documentation/devicetree/bindings/serial/st,stm32-uart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ properties:

wakeup-source: true

power-domains:
maxItems: 1

rx-threshold:
description:
If value is set to 1, RX FIFO threshold is disabled.
Expand Down
18 changes: 0 additions & 18 deletions Documentation/devicetree/bindings/serial/st-asc.txt

This file was deleted.

59 changes: 59 additions & 0 deletions Documentation/devicetree/bindings/w1/w1-uart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/w1/w1-uart.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: UART 1-Wire Bus

maintainers:
- Christoph Winklhofer <[email protected]>

description: |
UART 1-wire bus. Utilizes the UART interface via the Serial Device Bus
to create the 1-Wire timing patterns.
The UART peripheral must support full-duplex and operate in open-drain
mode. The timing patterns are generated by a specific combination of
baud-rate and transmitted byte, which corresponds to a 1-Wire read bit,
write bit or reset pulse.
The default baud-rate for reset and presence detection is 9600 and for
a 1-Wire read or write operation 115200. In case the actual baud-rate
is different from the requested one, the transmitted byte is adapted
to generate the 1-Wire timing patterns.
https://www.analog.com/en/technical-articles/using-a-uart-to-implement-a-1wire-bus-master.html
properties:
compatible:
const: w1-uart

reset-bps:
default: 9600
description:
The baud rate for the 1-Wire reset and presence detect.

write-0-bps:
default: 115200
description:
The baud rate for the 1-Wire write-0 cycle.

write-1-bps:
default: 115200
description:
The baud rate for the 1-Wire write-1 and read cycle.

required:
- compatible

additionalProperties:
type: object

examples:
- |
serial {
onewire {
compatible = "w1-uart";
};
};
45 changes: 45 additions & 0 deletions Documentation/driver-api/tty/console.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.. SPDX-License-Identifier: GPL-2.0
=======
Console
=======

.. contents:: :local:

Struct Console
==============

.. kernel-doc:: include/linux/console.h
:identifiers: console cons_flags

Internals
---------

.. kernel-doc:: include/linux/console.h
:identifiers: nbcon_state nbcon_prio nbcon_context nbcon_write_context

Struct Consw
============

.. kernel-doc:: include/linux/console.h
:identifiers: consw

Console functions
=================

.. kernel-doc:: include/linux/console.h
:identifiers: console_srcu_read_flags console_srcu_write_flags
console_is_registered for_each_console_srcu for_each_console

.. kernel-doc:: drivers/tty/vt/selection.c
:export:
.. kernel-doc:: drivers/tty/vt/vt.c
:export:

Internals
---------

.. kernel-doc:: drivers/tty/vt/selection.c
:internal:
.. kernel-doc:: drivers/tty/vt/vt.c
:internal:
1 change: 1 addition & 0 deletions Documentation/driver-api/tty/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ In-detail description of the named TTY structures is in separate documents:
tty_buffer
tty_ioctl
tty_internals
console

Writing TTY Driver
==================
Expand Down
1 change: 1 addition & 0 deletions Documentation/w1/masters/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
mxc-w1
omap-hdq
w1-gpio
w1-uart
54 changes: 54 additions & 0 deletions Documentation/w1/masters/w1-uart.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
.. SPDX-License-Identifier: GPL-2.0-or-later
=====================
Kernel driver w1-uart
=====================

Author: Christoph Winklhofer <[email protected]>


Description
-----------

UART 1-Wire bus driver. The driver utilizes the UART interface via the
Serial Device Bus to create the 1-Wire timing patterns as described in
the document `"Using a UART to Implement a 1-Wire Bus Master"`_.

.. _"Using a UART to Implement a 1-Wire Bus Master": https://www.analog.com/en/technical-articles/using-a-uart-to-implement-a-1wire-bus-master.html

In short, the UART peripheral must support full-duplex and operate in
open-drain mode. The timing patterns are generated by a specific
combination of baud-rate and transmitted byte, which corresponds to a
1-Wire read bit, write bit or reset pulse.

For instance the timing pattern for a 1-Wire reset and presence detect uses
the baud-rate 9600, i.e. 104.2 us per bit. The transmitted byte 0xf0 over
UART (least significant bit first, start-bit low) sets the reset low time
for 1-Wire to 521 us. A present 1-Wire device changes the received byte by
pulling the line low, which is used by the driver to evaluate the result of
the 1-Wire operation.

Similar for a 1-Wire read bit or write bit, which uses the baud-rate
115200, i.e. 8.7 us per bit. The transmitted byte 0x80 is used for a
Write-0 operation (low time 69.6us) and the byte 0xff for Read-0, Read-1
and Write-1 (low time 8.7us).

The default baud-rate for reset and presence detection is 9600 and for
a 1-Wire read or write operation 115200. In case the actual baud-rate
is different from the requested one, the transmitted byte is adapted
to generate the 1-Wire timing patterns.


Usage
-----

Specify the UART 1-wire bus in the device tree by adding the single child
onewire to the serial node (e.g. uart0). For example:
::

@uart0 {
...
onewire {
compatible = "w1-uart";
};
};
2 changes: 1 addition & 1 deletion arch/m68k/amiga/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,6 @@ static void amiga_get_hardware_list(struct seq_file *m)
* The Amiga keyboard driver needs key_maps, but we cannot export it in
* drivers/char/defkeymap.c, as it is autogenerated
*/
#ifdef CONFIG_HW_CONSOLE
#ifdef CONFIG_VT
EXPORT_SYMBOL_GPL(key_maps);
#endif
6 changes: 1 addition & 5 deletions arch/m68k/hp300/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <linux/module.h>
#include <linux/init.h>
#include <linux/serial_8250.h>
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/console.h>
Expand Down Expand Up @@ -67,9 +68,6 @@ static char *hp300_models[] __initdata = {
static char hp300_model_name[13] = "HP9000/";

extern void hp300_reset(void);
#ifdef CONFIG_SERIAL_8250_CONSOLE
extern int hp300_setup_serial_console(void) __init;
#endif

int __init hp300_parse_bootinfo(const struct bi_record *record)
{
Expand Down Expand Up @@ -263,7 +261,5 @@ void __init config_hp300(void)
} else {
panic("Unknown HP9000 Model");
}
#ifdef CONFIG_SERIAL_8250_CONSOLE
hp300_setup_serial_console();
#endif
}
4 changes: 2 additions & 2 deletions drivers/bluetooth/btmtkuart.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ static void btmtkuart_recv(struct hci_dev *hdev, const u8 *data, size_t count)
}
}

static ssize_t btmtkuart_receive_buf(struct serdev_device *serdev,
const u8 *data, size_t count)
static size_t btmtkuart_receive_buf(struct serdev_device *serdev,
const u8 *data, size_t count)
{
struct btmtkuart_dev *bdev = serdev_device_get_drvdata(serdev);

Expand Down
4 changes: 2 additions & 2 deletions drivers/bluetooth/btnxpuart.c
Original file line number Diff line number Diff line change
Expand Up @@ -1285,8 +1285,8 @@ static const struct h4_recv_pkt nxp_recv_pkts[] = {
{ NXP_RECV_FW_REQ_V3, .recv = nxp_recv_fw_req_v3 },
};

static ssize_t btnxpuart_receive_buf(struct serdev_device *serdev,
const u8 *data, size_t count)
static size_t btnxpuart_receive_buf(struct serdev_device *serdev,
const u8 *data, size_t count)
{
struct btnxpuart_dev *nxpdev = serdev_device_get_drvdata(serdev);

Expand Down
4 changes: 2 additions & 2 deletions drivers/bluetooth/hci_serdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ static void hci_uart_write_wakeup(struct serdev_device *serdev)
*
* Return: number of processed bytes
*/
static ssize_t hci_uart_receive_buf(struct serdev_device *serdev,
const u8 *data, size_t count)
static size_t hci_uart_receive_buf(struct serdev_device *serdev,
const u8 *data, size_t count)
{
struct hci_uart *hu = serdev_device_get_drvdata(serdev);

Expand Down
2 changes: 1 addition & 1 deletion drivers/gnss/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static const struct gnss_operations gnss_serial_gnss_ops = {
.write_raw = gnss_serial_write_raw,
};

static ssize_t gnss_serial_receive_buf(struct serdev_device *serdev,
static size_t gnss_serial_receive_buf(struct serdev_device *serdev,
const u8 *buf, size_t count)
{
struct gnss_serial *gserial = serdev_device_get_drvdata(serdev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gnss/sirf.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static const struct gnss_operations sirf_gnss_ops = {
.write_raw = sirf_write_raw,
};

static ssize_t sirf_receive_buf(struct serdev_device *serdev,
static size_t sirf_receive_buf(struct serdev_device *serdev,
const u8 *buf, size_t count)
{
struct sirf_data *data = serdev_device_get_drvdata(serdev);
Expand Down
Loading

0 comments on commit 3bcb0bf

Please sign in to comment.