Commit 59c221f8 authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by Greg Kroah-Hartman

serial: 8250_exar: Fill in rs485_supported

Add information on supported serial_rs485 features.
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220606100433.13793-8-ilpo.jarvinen@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 62a4b3d2
...@@ -113,6 +113,7 @@ struct exar8250; ...@@ -113,6 +113,7 @@ struct exar8250;
struct exar8250_platform { struct exar8250_platform {
int (*rs485_config)(struct uart_port *, struct serial_rs485 *); int (*rs485_config)(struct uart_port *, struct serial_rs485 *);
const struct serial_rs485 *rs485_supported;
int (*register_gpio)(struct pci_dev *, struct uart_8250_port *); int (*register_gpio)(struct pci_dev *, struct uart_8250_port *);
void (*unregister_gpio)(struct uart_8250_port *); void (*unregister_gpio)(struct uart_8250_port *);
}; };
...@@ -431,10 +432,15 @@ static int generic_rs485_config(struct uart_port *port, ...@@ -431,10 +432,15 @@ static int generic_rs485_config(struct uart_port *port,
return 0; return 0;
} }
static const struct serial_rs485 generic_rs485_supported = {
.flags = SER_RS485_ENABLED,
};
static const struct exar8250_platform exar8250_default_platform = { static const struct exar8250_platform exar8250_default_platform = {
.register_gpio = xr17v35x_register_gpio, .register_gpio = xr17v35x_register_gpio,
.unregister_gpio = xr17v35x_unregister_gpio, .unregister_gpio = xr17v35x_unregister_gpio,
.rs485_config = generic_rs485_config, .rs485_config = generic_rs485_config,
.rs485_supported = &generic_rs485_supported,
}; };
static int iot2040_rs485_config(struct uart_port *port, static int iot2040_rs485_config(struct uart_port *port,
...@@ -470,6 +476,10 @@ static int iot2040_rs485_config(struct uart_port *port, ...@@ -470,6 +476,10 @@ static int iot2040_rs485_config(struct uart_port *port,
return generic_rs485_config(port, rs485); return generic_rs485_config(port, rs485);
} }
static const struct serial_rs485 iot2040_rs485_supported = {
.flags = SER_RS485_ENABLED | SER_RS485_RX_DURING_TX | SER_RS485_TERMINATE_BUS,
};
static const struct property_entry iot2040_gpio_properties[] = { static const struct property_entry iot2040_gpio_properties[] = {
PROPERTY_ENTRY_U32("exar,first-pin", 10), PROPERTY_ENTRY_U32("exar,first-pin", 10),
PROPERTY_ENTRY_U32("ngpios", 1), PROPERTY_ENTRY_U32("ngpios", 1),
...@@ -498,6 +508,7 @@ static int iot2040_register_gpio(struct pci_dev *pcidev, ...@@ -498,6 +508,7 @@ static int iot2040_register_gpio(struct pci_dev *pcidev,
static const struct exar8250_platform iot2040_platform = { static const struct exar8250_platform iot2040_platform = {
.rs485_config = iot2040_rs485_config, .rs485_config = iot2040_rs485_config,
.rs485_supported = &iot2040_rs485_supported,
.register_gpio = iot2040_register_gpio, .register_gpio = iot2040_register_gpio,
.unregister_gpio = xr17v35x_unregister_gpio, .unregister_gpio = xr17v35x_unregister_gpio,
}; };
...@@ -540,6 +551,7 @@ pci_xr17v35x_setup(struct exar8250 *priv, struct pci_dev *pcidev, ...@@ -540,6 +551,7 @@ pci_xr17v35x_setup(struct exar8250 *priv, struct pci_dev *pcidev,
port->port.uartclk = baud * 16; port->port.uartclk = baud * 16;
port->port.rs485_config = platform->rs485_config; port->port.rs485_config = platform->rs485_config;
port->port.rs485_supported = platform->rs485_supported;
/* /*
* Setup the UART clock for the devices on expansion slot to * Setup the UART clock for the devices on expansion slot to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment