All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bich HEMON <bich.hemon@st.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre TORGUE <alexandre.torgue@st.com>,
	"Jiri Slaby" <jslaby@suse.com>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Bich HEMON <bich.hemon@st.com>
Subject: [PATCH 04/20] serial: stm32: make fifoen as property for each port
Date: Mon, 26 Jun 2017 12:49:10 +0000	[thread overview]
Message-ID: <1498481318-1894-5-git-send-email-bich.hemon@st.com> (raw)
In-Reply-To: <1498481318-1894-1-git-send-email-bich.hemon@st.com>

From: Bich Hemon <bich.hemon@st.com>

Signed-off-by: Gerald Baeza <gerald.baeza@st.com>
---
 drivers/tty/serial/stm32-usart.c | 10 +++++++---
 drivers/tty/serial/stm32-usart.h |  1 +
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index c6ae4fd..34e31d1 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -453,7 +453,8 @@ static int stm32_startup(struct uart_port *port)
 		return ret;
 
 	val = USART_CR1_RXNEIE | USART_CR1_TE | USART_CR1_RE;
-	val |= USART_CR1_FIFOEN;
+	if (stm32_port->fifoen)
+		val |= USART_CR1_FIFOEN;
 	stm32_set_bits(port, ofs->cr1, val);
 
 	return 0;
@@ -468,7 +469,8 @@ static void stm32_shutdown(struct uart_port *port)
 
 	val = USART_CR1_TXEIE | USART_CR1_RXNEIE | USART_CR1_TE | USART_CR1_RE;
 	val |= BIT(cfg->uart_enable_bit);
-	val |= USART_CR1_FIFOEN;
+	if (stm32_port->fifoen)
+		val |= USART_CR1_FIFOEN;
 	stm32_clr_bits(port, ofs->cr1, val);
 
 	free_irq(port->irq, port);
@@ -498,7 +500,8 @@ static void stm32_set_termios(struct uart_port *port, struct ktermios *termios,
 
 	cr1 = USART_CR1_TE | USART_CR1_RE | USART_CR1_RXNEIE;
 	cr1 |= BIT(cfg->uart_enable_bit);
-	cr1 |= USART_CR1_FIFOEN;
+	if (stm32_port->fifoen)
+		cr1 |= USART_CR1_FIFOEN;
 	cr2 = 0;
 	cr3 = 0;
 
@@ -707,6 +710,7 @@ static struct stm32_port *stm32_of_get_stm32_port(struct platform_device *pdev)
 	stm32_ports[id].hw_flow_control = of_property_read_bool(np,
 							"st,hw-flow-ctrl");
 	stm32_ports[id].port.line = id;
+	stm32_ports[id].fifoen = true;
 	return &stm32_ports[id];
 }
 
diff --git a/drivers/tty/serial/stm32-usart.h b/drivers/tty/serial/stm32-usart.h
index 33f1320..9429baf 100644
--- a/drivers/tty/serial/stm32-usart.h
+++ b/drivers/tty/serial/stm32-usart.h
@@ -224,6 +224,7 @@ struct stm32_port {
 	unsigned char *tx_buf;   /* dma tx buffer cpu address */
 	bool tx_dma_busy;	 /* dma tx busy               */
 	bool hw_flow_control;
+	bool fifoen;
 };
 
 static struct stm32_port stm32_ports[STM32_MAX_PORTS];
-- 
1.9.1

WARNING: multiple messages have this Message-ID (diff)
From: bich.hemon@st.com (Bich HEMON)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 04/20] serial: stm32: make fifoen as property for each port
Date: Mon, 26 Jun 2017 12:49:10 +0000	[thread overview]
Message-ID: <1498481318-1894-5-git-send-email-bich.hemon@st.com> (raw)
In-Reply-To: <1498481318-1894-1-git-send-email-bich.hemon@st.com>

From: Bich Hemon <bich.hemon@st.com>

Signed-off-by: Gerald Baeza <gerald.baeza@st.com>
---
 drivers/tty/serial/stm32-usart.c | 10 +++++++---
 drivers/tty/serial/stm32-usart.h |  1 +
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index c6ae4fd..34e31d1 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -453,7 +453,8 @@ static int stm32_startup(struct uart_port *port)
 		return ret;
 
 	val = USART_CR1_RXNEIE | USART_CR1_TE | USART_CR1_RE;
-	val |= USART_CR1_FIFOEN;
+	if (stm32_port->fifoen)
+		val |= USART_CR1_FIFOEN;
 	stm32_set_bits(port, ofs->cr1, val);
 
 	return 0;
@@ -468,7 +469,8 @@ static void stm32_shutdown(struct uart_port *port)
 
 	val = USART_CR1_TXEIE | USART_CR1_RXNEIE | USART_CR1_TE | USART_CR1_RE;
 	val |= BIT(cfg->uart_enable_bit);
-	val |= USART_CR1_FIFOEN;
+	if (stm32_port->fifoen)
+		val |= USART_CR1_FIFOEN;
 	stm32_clr_bits(port, ofs->cr1, val);
 
 	free_irq(port->irq, port);
@@ -498,7 +500,8 @@ static void stm32_set_termios(struct uart_port *port, struct ktermios *termios,
 
 	cr1 = USART_CR1_TE | USART_CR1_RE | USART_CR1_RXNEIE;
 	cr1 |= BIT(cfg->uart_enable_bit);
-	cr1 |= USART_CR1_FIFOEN;
+	if (stm32_port->fifoen)
+		cr1 |= USART_CR1_FIFOEN;
 	cr2 = 0;
 	cr3 = 0;
 
@@ -707,6 +710,7 @@ static struct stm32_port *stm32_of_get_stm32_port(struct platform_device *pdev)
 	stm32_ports[id].hw_flow_control = of_property_read_bool(np,
 							"st,hw-flow-ctrl");
 	stm32_ports[id].port.line = id;
+	stm32_ports[id].fifoen = true;
 	return &stm32_ports[id];
 }
 
diff --git a/drivers/tty/serial/stm32-usart.h b/drivers/tty/serial/stm32-usart.h
index 33f1320..9429baf 100644
--- a/drivers/tty/serial/stm32-usart.h
+++ b/drivers/tty/serial/stm32-usart.h
@@ -224,6 +224,7 @@ struct stm32_port {
 	unsigned char *tx_buf;   /* dma tx buffer cpu address */
 	bool tx_dma_busy;	 /* dma tx busy               */
 	bool hw_flow_control;
+	bool fifoen;
 };
 
 static struct stm32_port stm32_ports[STM32_MAX_PORTS];
-- 
1.9.1

  parent reply	other threads:[~2017-06-26 12:55 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26 12:49 [PATCH 00/20] Update STM32 usart driver Bich HEMON
2017-06-26 12:49 ` Bich HEMON
2017-06-26 12:49 ` Bich HEMON
2017-06-26 12:49 ` [PATCH 02/20] dt-bindings: serial: each stm32 usart needs an alias Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-28 18:06   ` Rob Herring
2017-06-28 18:06     ` Rob Herring
2017-06-28 18:06     ` Rob Herring
2017-06-26 12:49 ` [PATCH 01/20] serial: stm32: adding fifo support Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49 ` [PATCH 03/20] serial: stm32: fix multi ports management Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49 ` Bich HEMON [this message]
2017-06-26 12:49   ` [PATCH 04/20] serial: stm32: make fifoen as property for each port Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49 ` [PATCH 05/20] serial: stm32: add debugfs Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49 ` [PATCH 06/20] serial: stm32: fix pio transmit timeout Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49 ` [PATCH 07/20] serial: stm32: less messages on dma alloc error Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49 ` [PATCH 08/20] serial: stm32: timeout interrupt using with dma Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49 ` [PATCH 10/20] serial: stm32: fix dma receive Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49 ` [PATCH 09/20] serial: stm32: fix end of transfer Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49 ` [PATCH 11/20] serial: stm32: add RTS support Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49 ` [PATCH 12/20] serial: stm32: fix last_res value Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49 ` [PATCH 13/20] serial: stm32: fix error handling in probe Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-29 14:50   ` Greg Kroah-Hartman
2017-06-29 14:50     ` Greg Kroah-Hartman
2017-06-29 14:50     ` Greg Kroah-Hartman
2017-06-26 12:49 ` [PATCH 14/20] dt-bindings: serial: document option wake-up interrupt for STM32 USART Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-28 18:10   ` Rob Herring
2017-06-28 18:10     ` Rob Herring
2017-06-28 18:10     ` Rob Herring
2017-06-29 14:50   ` Greg Kroah-Hartman
2017-06-29 14:50     ` Greg Kroah-Hartman
2017-06-29 14:50     ` Greg Kroah-Hartman
2017-06-26 12:49 ` [PATCH 15/20] serial: stm32: Add wakeup mechanism Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49 ` [PATCH 18/20] serial: stm32: update dma buffers length Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49 ` [PATCH 16/20] serial: stm32: fix fifo usage Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49 ` [PATCH 17/20] dt-bindings: serial: stm32: add dma using note Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-28 22:26   ` Rob Herring
2017-06-28 22:26     ` Rob Herring
2017-06-28 22:26     ` Rob Herring
2017-06-29 14:50   ` Greg Kroah-Hartman
2017-06-29 14:50     ` Greg Kroah-Hartman
2017-06-29 14:50     ` Greg Kroah-Hartman
2017-06-26 12:49 ` [PATCH 20/20] serial: stm32: fix rx interrupt handling in startup Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49 ` [PATCH 19/20] serial: stm32: add dma rx callback Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-26 12:49   ` Bich HEMON
2017-06-29 15:09 ` [PATCH 00/20] Update STM32 usart driver Alexandre Torgue
2017-06-29 15:09   ` Alexandre Torgue
2017-06-29 15:09   ` Alexandre Torgue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1498481318-1894-5-git-send-email-bich.hemon@st.com \
    --to=bich.hemon@st.com \
    --cc=alexandre.torgue@st.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.