[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53E0C633.7060600@gmail.com>
Date: Tue, 05 Aug 2014 17:25:31 +0530
From: Varka Bhadram <varkabhadram@...il.com>
To: Matthias Brugger <matthias.bgg@...il.com>,
linux-kernel@...r.kernel.org
CC: robh+dt@...nel.org, pawel.moll@....com, mark.rutland@....com,
ijc+devicetree@...lion.org.uk, galak@...eaurora.org,
rdunlap@...radead.org, gregkh@...uxfoundation.org, jslaby@...e.cz,
grant.likely@...aro.org, heikki.krogerus@...ux.intel.com,
alan@...ux.intel.com, paul.gortmaker@...driver.com,
asierra@...-inc.com, mwelling@...e.org, dianders@...omium.org,
m-karicheri2@...com, jschultz@...-inc.com, mingo@...e.hu,
balbi@...com, heiko@...ech.de, devicetree@...r.kernel.org,
linux-doc@...r.kernel.org, linux-serial@...r.kernel.org,
linux-api@...r.kernel.org
Subject: Re: [PATCH 2/3] tty: serial: 8250: Add Mediatek UART driver
On 08/05/2014 04:24 PM, Matthias Brugger wrote:
(...)
> +#include <linux/io.h>
> +#include <linux/module.h>
> +#include <linux/serial_8250.h>
> +#include <linux/of_irq.h>
> +#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
> +#include <linux/clk.h>
> +#include <linux/pm_runtime.h>
> +#include "8250.h"
> +
Better if we have includes in alphabetical order..
> +#define MTK_UART_RATE_FIX 0x0D /* UART Rate Fix Register */
> +
> +struct mtk8250_data {
> + int line;
> + struct clk *clk;
> +};
> +
> +static void
> +mtk8250_do_pm(struct uart_port *port, unsigned int state, unsigned int old)
> +{
> + if (!state)
> + pm_runtime_get_sync(port->dev);
> +
> + serial8250_do_pm(port, state, old);
> +
> + if (state)
> + pm_runtime_put_sync_suspend(port->dev);
> +}
> +
> +static int mtk8250_probe_of(struct uart_port *p,
> + struct mtk8250_data *data)
static int mtk8250_probe_of(struct uart_port *p,
struct mtk8250_data *data)
> +{
> + int err;
> + struct device_node *np = p->dev->of_node;
> +
> + data->clk = of_clk_get(np, 0);
> + if (IS_ERR(data->clk)) {
> + pr_warn("Can't get timer clock");
missed terminating new line...
> + return PTR_ERR(data->clk);
> + }
> +
> + err = clk_prepare_enable(data->clk);
> + if (err) {
> + pr_warn("Can't prepare clock");
same...
> + clk_put(data->clk);
> + return err;
> + }
> + p->uartclk = clk_get_rate(data->clk);
> +
> + return 0;
> +}
(...)
> +static struct platform_driver mtk8250_platform_driver = {
> + .driver = {
> + .name = "mt6577-uart",
> + .owner = THIS_MODULE,
No need to update this field...
> + .pm = &mtk8250_pm_ops,
> + .of_match_table = mtk8250_of_match,
> + },
> + .probe = mtk8250_probe,
> + .remove = mtk8250_remove,
> +};
> +module_platform_driver(mtk8250_platform_driver);
>
--
Regards,
Varka Bhadram.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists