[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54CA5128.8050500@gmail.com>
Date: Thu, 29 Jan 2015 20:56:32 +0530
From: Varka Bhadram <varkabhadram@...il.com>
To: Chunyan Zhang <chunyan.zhang@...eadtrum.com>,
gregkh@...uxfoundation.org
CC: robh+dt@...nel.org, mark.rutland@....com, arnd@...db.de,
gnomes@...rguk.ukuu.org.uk, peter@...leysoftware.com,
pawel.moll@....com, ijc+devicetree@...lion.org.uk,
galak@...eaurora.org, grant.likely@...aro.org, jslaby@...e.cz,
heiko@...ech.de, jason@...edaemon.net, florian.vaussard@...l.ch,
andrew@...n.ch, hytszk@...il.com, antonynpavlov@...il.com,
shawn.guo@...aro.org, orsonzhai@...il.com, geng.ren@...eadtrum.com,
zhizhou.zhang@...eadtrum.com, lanqing.liu@...eadtrum.com,
zhang.lyra@...il.com, wei.qiao@...eadtrum.com,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-serial@...r.kernel.org, linux-api@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v10 2/2] tty/serial: Add Spreadtrum sc9836-uart driver
support
Hi,
On Wednesday 28 January 2015 04:38 PM, Chunyan Zhang wrote:
> Add a full sc9836-uart driver for SC9836 SoC which is based on the
> spreadtrum sharkl64 platform.
> This driver also support earlycon.
>
> Originally-by: Lanqing Liu <lanqing.liu@...eadtrum.com>
> Signed-off-by: Orson Zhai <orson.zhai@...eadtrum.com>
> Signed-off-by: Chunyan Zhang <chunyan.zhang@...eadtrum.com>
> Acked-by: Arnd Bergmann <arnd@...db.de>
> Reviewed-by: Peter Hurley <peter@...leysoftware.com>
> ---
> drivers/tty/serial/Kconfig | 18 +
> drivers/tty/serial/Makefile | 1 +
> drivers/tty/serial/sprd_serial.c | 793 ++++++++++++++++++++++++++++++++++++++
> include/uapi/linux/serial_core.h | 3 +
> 4 files changed, 815 insertions(+)
> create mode 100644 drivers/tty/serial/sprd_serial.c
>
(...)
> +static int sprd_probe(struct platform_device *pdev)
> +{
> + struct resource *res;
> + struct uart_port *up;
> + struct clk *clk;
> + int irq;
> + int index;
> + int ret;
> +
> + for (index = 0; index < ARRAY_SIZE(sprd_port); index++)
> + if (sprd_port[index] == NULL)
> + break;
> +
> + if (index == ARRAY_SIZE(sprd_port))
> + return -EBUSY;
> +
> + index = sprd_probe_dt_alias(index, &pdev->dev);
> +
> + sprd_port[index] = devm_kzalloc(&pdev->dev,
> + sizeof(*sprd_port[index]), GFP_KERNEL);
> + if (!sprd_port[index])
> + return -ENOMEM;
> +
> + up = &sprd_port[index]->port;
> + up->dev = &pdev->dev;
> + up->line = index;
> + up->type = PORT_SPRD;
> + up->iotype = SERIAL_IO_PORT;
> + up->uartclk = SPRD_DEF_RATE;
> + up->fifosize = SPRD_FIFO_SIZE;
> + up->ops = &serial_sprd_ops;
> + up->flags = UPF_BOOT_AUTOCONF;
> +
> + clk = devm_clk_get(&pdev->dev, NULL);
> + if (!IS_ERR(clk))
> + up->uartclk = clk_get_rate(clk);
> +
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + if (!res) {
> + dev_err(&pdev->dev, "not provide mem resource\n");
> + return -ENODEV;
> + }
This check is not required. It will be done by devm_ioremap_resource()
> + up->mapbase = res->start;
> + up->membase = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(up->membase))
> + return PTR_ERR(up->membase);
> +
>
--
Thanks,
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