From: Mark Rutland <mark.rutland@arm.com>
To: Yuan Yao <yao.yuan@freescale.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"shawn.guo@linaro.org" <shawn.guo@linaro.org>,
"linux@arm.linux.org.uk" <linux@arm.linux.org.uk>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"arnd@arndb.de" <arnd@arndb.de>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>
Subject: Re: [PATCH v3 2/2] serial: fsl_lpuart: add DMA support
Date: Wed, 15 Jan 2014 11:05:37 +0000 [thread overview]
Message-ID: <20140115110537.GA25824@e106331-lin.cambridge.arm.com> (raw)
In-Reply-To: <1389763265-27300-3-git-send-email-yao.yuan@freescale.com>
On Wed, Jan 15, 2014 at 05:21:05AM +0000, Yuan Yao wrote:
> Add dma support for lpuart. This function depend on DMA driver.
> You can turn on it by SERIAL_FSL_LPUART_DMA=y. And It works if dts node has dma properties.
>
> Signed-off-by: Yuan Yao <yao.yuan@freescale.com>
> ---
> .../devicetree/bindings/serial/fsl-lpuart.txt | 21 +-
> drivers/tty/serial/Kconfig | 7 +
> drivers/tty/serial/fsl_lpuart.c | 457 ++++++++++++++++++++-
> 3 files changed, 473 insertions(+), 12 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/serial/fsl-lpuart.txt b/Documentation/devicetree/bindings/serial/fsl-lpuart.txt
> index 6fd1dd1..7509080 100644
> --- a/Documentation/devicetree/bindings/serial/fsl-lpuart.txt
> +++ b/Documentation/devicetree/bindings/serial/fsl-lpuart.txt
> @@ -4,11 +4,24 @@ Required properties:
> - compatible : Should be "fsl,<soc>-lpuart"
> - reg : Address and length of the register set for the device
> - interrupts : Should contain uart interrupt
> +- clocks : from common clock binding: handle to uart clock
> +- clock-names : from common clock binding: Shall be "ipg"
Why are these now requried if they weren't previously? That breaks old
dts. I can't see any new code touching clocks. Was this an old but
undocumented requirement?
Could you please reword this so clocks is defined in terms of
clock-names so as to make the relationship between them clear:
- clocks: a list of phandles + clock-specifier pairs, one for each entry
in clock-names
- clock-names: should contain:
* "ipg" - the uart clock
> +
> +Optional properties:
> +- dma-names: Should contain "lpuart-tx" for transmit and "lpuart-rx" for receive channels
> +- dmas: Should contain dma specifiers for transmit and receive channels
Likewise could you please define dmas in terms of dma-names please. Why
not just "tx" and "rx" as other bindings use?
[...]
> +#ifdef CONFIG_SERIAL_FSL_LPUART_DMA
> + struct platform_device *pdev = to_platform_device(port->dev);
> + struct device_node *np = pdev->dev.of_node;
> +
> + if (of_get_property(np, "dmas", NULL)) {
> + sport->lpuart_dma_use = true;
> + lpuart_dma_tx_request(port);
> + lpuart_dma_rx_request(port);
> + temp = readb(port->membase + UARTCR5);
> + writeb(temp | UARTCR5_TDMAS, port->membase + UARTCR5);
Rather than reading the raw dt to find out if you have dmas, can you not
just attempt to request the dmas and if either fail give up on using
them?
> + } else
> + sport->lpuart_dma_use = false;
Nit: if you have brackets on one half of an if-else, they should be on
the other half too (even if i's a single line).
Cheers,
Mark.
next prev parent reply other threads:[~2014-01-15 11:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-15 5:21 [PATCH v3 1/2] ARM: dts: vf610: lpuart: Add eDMA support Yuan Yao
2014-01-15 5:21 ` [PATCH v3 2/2] serial: fsl_lpuart: add DMA support Yuan Yao
2014-01-15 9:25 ` Arnd Bergmann
2014-01-16 6:02 ` Yao Yuan
2014-01-16 8:19 ` Yao Yuan
2014-01-16 10:47 ` Arnd Bergmann
2014-01-15 11:05 ` Mark Rutland [this message]
2014-01-15 11:17 ` Arnd Bergmann
2014-01-15 13:50 ` Mark Rutland
2014-01-16 6:54 ` Yao Yuan
2014-01-22 3:41 ` Yao Yuan
-- strict thread matches above, loose matches on Subject: below --
2014-01-15 5:24 [PATCH v3 0/2] " Yuan Yao
2014-01-15 5:24 ` [PATCH v3 2/2] " Yuan Yao
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=20140115110537.GA25824@e106331-lin.cambridge.arm.com \
--to=mark.rutland@arm.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=shawn.guo@linaro.org \
--cc=yao.yuan@freescale.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).