Commit 97ed9790 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Greg Kroah-Hartman

serial: sh-sci: Remove unused platform data capabilities field

The field isn't set by any platform but is only used internally in the
driver to hold data parsed from DT. Move it to the sci_port structure.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d5cb1319
...@@ -149,6 +149,7 @@ struct sci_port { ...@@ -149,6 +149,7 @@ struct sci_port {
unsigned int rx_timeout; unsigned int rx_timeout;
#endif #endif
bool has_rtscts;
bool autorts; bool autorts;
}; };
...@@ -680,7 +681,7 @@ static void sci_init_pins(struct uart_port *port, unsigned int cflag) ...@@ -680,7 +681,7 @@ static void sci_init_pins(struct uart_port *port, unsigned int cflag)
/* Enable RXD and TXD pin functions */ /* Enable RXD and TXD pin functions */
ctrl &= ~(SCPCR_RXDC | SCPCR_TXDC); ctrl &= ~(SCPCR_RXDC | SCPCR_TXDC);
if (to_sci_port(port)->cfg->capabilities & SCIx_HAVE_RTSCTS) { if (to_sci_port(port)->has_rtscts) {
/* RTS# is output, driven 1 */ /* RTS# is output, driven 1 */
ctrl |= SCPCR_RTSC; ctrl |= SCPCR_RTSC;
serial_port_out(port, SCPDR, serial_port_out(port, SCPDR,
...@@ -1738,7 +1739,7 @@ static void sci_set_mctrl(struct uart_port *port, unsigned int mctrl) ...@@ -1738,7 +1739,7 @@ static void sci_set_mctrl(struct uart_port *port, unsigned int mctrl)
mctrl_gpio_set(s->gpios, mctrl); mctrl_gpio_set(s->gpios, mctrl);
if (!(s->cfg->capabilities & SCIx_HAVE_RTSCTS)) if (!s->has_rtscts)
return; return;
if (!(mctrl & TIOCM_RTS)) { if (!(mctrl & TIOCM_RTS)) {
...@@ -2809,6 +2810,7 @@ sci_parse_dt(struct platform_device *pdev, unsigned int *dev_id) ...@@ -2809,6 +2810,7 @@ sci_parse_dt(struct platform_device *pdev, unsigned int *dev_id)
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
const struct of_device_id *match; const struct of_device_id *match;
struct plat_sci_port *p; struct plat_sci_port *p;
struct sci_port *sp;
int id; int id;
if (!IS_ENABLED(CONFIG_OF) || !np) if (!IS_ENABLED(CONFIG_OF) || !np)
...@@ -2829,13 +2831,14 @@ sci_parse_dt(struct platform_device *pdev, unsigned int *dev_id) ...@@ -2829,13 +2831,14 @@ sci_parse_dt(struct platform_device *pdev, unsigned int *dev_id)
return NULL; return NULL;
} }
sp = &sci_ports[id];
*dev_id = id; *dev_id = id;
p->type = SCI_OF_TYPE(match->data); p->type = SCI_OF_TYPE(match->data);
p->regtype = SCI_OF_REGTYPE(match->data); p->regtype = SCI_OF_REGTYPE(match->data);
if (of_find_property(np, "uart-has-rtscts", NULL)) if (of_find_property(np, "uart-has-rtscts", NULL))
p->capabilities |= SCIx_HAVE_RTSCTS; sp->has_rtscts = true;
return p; return p;
} }
...@@ -2863,7 +2866,7 @@ static int sci_probe_single(struct platform_device *dev, ...@@ -2863,7 +2866,7 @@ static int sci_probe_single(struct platform_device *dev,
if (IS_ERR(sciport->gpios) && PTR_ERR(sciport->gpios) != -ENOSYS) if (IS_ERR(sciport->gpios) && PTR_ERR(sciport->gpios) != -ENOSYS)
return PTR_ERR(sciport->gpios); return PTR_ERR(sciport->gpios);
if (p->capabilities & SCIx_HAVE_RTSCTS) { if (sciport->has_rtscts) {
if (!IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(sciport->gpios, if (!IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(sciport->gpios,
UART_GPIO_CTS)) || UART_GPIO_CTS)) ||
!IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(sciport->gpios, !IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(sciport->gpios,
......
...@@ -43,18 +43,12 @@ struct plat_sci_port_ops { ...@@ -43,18 +43,12 @@ struct plat_sci_port_ops {
void (*init_pins)(struct uart_port *, unsigned int cflag); void (*init_pins)(struct uart_port *, unsigned int cflag);
}; };
/*
* Port-specific capabilities
*/
#define SCIx_HAVE_RTSCTS BIT(0)
/* /*
* Platform device specific platform_data struct * Platform device specific platform_data struct
*/ */
struct plat_sci_port { struct plat_sci_port {
unsigned int type; /* SCI / SCIF / IRDA / HSCIF */ unsigned int type; /* SCI / SCIF / IRDA / HSCIF */
upf_t flags; /* UPF_* flags */ upf_t flags; /* UPF_* flags */
unsigned long capabilities; /* Port features/capabilities */
unsigned int sampling_rate; unsigned int sampling_rate;
unsigned int scscr; /* SCSCR initialization */ unsigned int scscr; /* SCSCR initialization */
......
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