mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
ARM: device tree work
Most of these patches convert code from using static platform data to describing the hardware in the device tree. This is only the first half of the changes for v3.4 because a lot of patches for this topic came in the last week before the merge window. Signed-off-by: Arnd Bergmann <[email protected]> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIVAwUAT24/a2CrR//JCVInAQKYdxAAn+fs7yv+P4OWG/nIhGdnPw8MQ2u9fvqA pmNL3Jy0eVowbENDcRRZgfhZ3ZlWBGUYym7J1uiFSrmHyJPoMtMvVg0miPYxLlpE vr8bzuSfGOUOa7+Fk6kFVGxS3ZHZTsDvuhMQUIt/2jHgOaesqPvZ1FYFAj1bZ1fm 2CnQoF3OfnWAngHtoBXtgJxp/1r7+pHlGVbPYpmtHtikl45NmhqWza58aSQBilr+ S90cVeZs91gyveoxz5N+YrO8+Dx05te3mF+dwWuKC6aDC6d76fjLak54AvYv2Pzr I6iaQPV8GIsXi5R4wptmVQAc5mbk5oktxJ7hCIHrmaBiAXygoVAYoqcuumoO3QDb QKz10ga1yBYcKYrKvBzKxQrChw53IPU6po+Dd66ALJvLlc3KONksiJs5T/5Wma7P v3VPcmZwPrJQbz+fQu6FysHeYQY+wfiR5E9Yz2OXs+PtkSy9OYsFFirdhJeWUPgA ASjNLs1y5rxqrJBt7cjyQiBbIf1awGWyzF0yUNrlYHxmhJ6vcxHfrGoW38VRRCTM 8+JcxOHPRYrPfY7we6zsOn7ZeTWJduoUEeTxDnVS3w3zUIKCvkvkpHaJDvHvYcui T/yJnXdUD2O3E5+5k/5cCyde8RbSB9gKsNpIMNkK5BLSmbux3C72dE0sMQFysahI hS8aDCDUQUU= =fMC+ -----END PGP SIGNATURE----- Merge tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull "ARM: device tree work" from Arnd Bergmann: "Most of these patches convert code from using static platform data to describing the hardware in the device tree. This is only the first half of the changes for v3.4 because a lot of patches for this topic came in the last week before the merge window. Signed-off-by: Arnd Bergmann <[email protected]>" Fix up trivial conflicts in arch/arm/mach-vexpress/{Kconfig,core.h} * tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (86 commits) Document: devicetree: add OF documents for arch-mmp ARM: dts: append DTS file of pxa168 ARM: mmp: append OF support on pxa168 ARM: mmp: enable rtc clk in pxa168 i2c: pxa: add OF support serial: pxa: add OF support arm/dts: mt_ventoux: very basic support for TeeJet Mt.Ventoux board ARM: OMAP2+: Remove extra ifdefs for board-generic ARM: OMAP2+: Fix build error when only ARCH_OMAP2/3 or 4 is selected ASoC: DT: Add digital microphone binding to PAZ00 board. ARM: dt: Add ARM PMU to tegra*.dtsi ARM: at91: at91sam9x5cm/dt: add leds support ARM: at91: usb_a9g20/dt: add gpio-keys support ARM: at91: at91sam9m10g45ek/dt: add gpio-keys support ARM: at91: at91sam9m10g45ek/dt: add leds support ARM: at91: usb_a9g20/dt: add leds support ARM: at91/pio: add new PIO3 features ARM: at91: add sam9_smc.o to at91sam9x5 build ARM: at91/tc/clocksource: Add 32 bit variant to Timer Counter ARM: at91/tc: add device tree support to atmel_tclib ...
This commit is contained in:
commit
66f03c614c
147 changed files with 5017 additions and 1037 deletions
|
|
@ -1526,6 +1526,8 @@ void __init atmel_register_uart_fns(struct atmel_port_fns *fns)
|
|||
atmel_pops.set_wake = fns->set_wake;
|
||||
}
|
||||
|
||||
struct platform_device *atmel_default_console_device; /* the serial console device */
|
||||
|
||||
#ifdef CONFIG_SERIAL_ATMEL_CONSOLE
|
||||
static void atmel_console_putchar(struct uart_port *port, int ch)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include <linux/circ_buf.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/tty.h>
|
||||
#include <linux/tty_flip.h>
|
||||
|
|
@ -44,6 +45,8 @@
|
|||
#include <linux/io.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#define PXA_NAME_LEN 8
|
||||
|
||||
struct uart_pxa_port {
|
||||
struct uart_port port;
|
||||
unsigned char ier;
|
||||
|
|
@ -51,7 +54,7 @@ struct uart_pxa_port {
|
|||
unsigned char mcr;
|
||||
unsigned int lsr_break_flag;
|
||||
struct clk *clk;
|
||||
char *name;
|
||||
char name[PXA_NAME_LEN];
|
||||
};
|
||||
|
||||
static inline unsigned int serial_in(struct uart_pxa_port *up, int offset)
|
||||
|
|
@ -781,6 +784,31 @@ static const struct dev_pm_ops serial_pxa_pm_ops = {
|
|||
};
|
||||
#endif
|
||||
|
||||
static struct of_device_id serial_pxa_dt_ids[] = {
|
||||
{ .compatible = "mrvl,pxa-uart", },
|
||||
{ .compatible = "mrvl,mmp-uart", },
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, serial_pxa_dt_ids);
|
||||
|
||||
static int serial_pxa_probe_dt(struct platform_device *pdev,
|
||||
struct uart_pxa_port *sport)
|
||||
{
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
int ret;
|
||||
|
||||
if (!np)
|
||||
return 1;
|
||||
|
||||
ret = of_alias_get_id(np, "serial");
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "failed to get alias id, errno %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
sport->port.line = ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int serial_pxa_probe(struct platform_device *dev)
|
||||
{
|
||||
struct uart_pxa_port *sport;
|
||||
|
|
@ -808,20 +836,16 @@ static int serial_pxa_probe(struct platform_device *dev)
|
|||
sport->port.irq = irqres->start;
|
||||
sport->port.fifosize = 64;
|
||||
sport->port.ops = &serial_pxa_pops;
|
||||
sport->port.line = dev->id;
|
||||
sport->port.dev = &dev->dev;
|
||||
sport->port.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF;
|
||||
sport->port.uartclk = clk_get_rate(sport->clk);
|
||||
|
||||
switch (dev->id) {
|
||||
case 0: sport->name = "FFUART"; break;
|
||||
case 1: sport->name = "BTUART"; break;
|
||||
case 2: sport->name = "STUART"; break;
|
||||
case 3: sport->name = "HWUART"; break;
|
||||
default:
|
||||
sport->name = "???";
|
||||
break;
|
||||
}
|
||||
ret = serial_pxa_probe_dt(dev, sport);
|
||||
if (ret > 0)
|
||||
sport->port.line = dev->id;
|
||||
else if (ret < 0)
|
||||
goto err_clk;
|
||||
snprintf(sport->name, PXA_NAME_LEN - 1, "UART%d", sport->port.line + 1);
|
||||
|
||||
sport->port.membase = ioremap(mmres->start, resource_size(mmres));
|
||||
if (!sport->port.membase) {
|
||||
|
|
@ -829,7 +853,7 @@ static int serial_pxa_probe(struct platform_device *dev)
|
|||
goto err_clk;
|
||||
}
|
||||
|
||||
serial_pxa_ports[dev->id] = sport;
|
||||
serial_pxa_ports[sport->port.line] = sport;
|
||||
|
||||
uart_add_one_port(&serial_pxa_reg, &sport->port);
|
||||
platform_set_drvdata(dev, sport);
|
||||
|
|
@ -866,6 +890,7 @@ static struct platform_driver serial_pxa_driver = {
|
|||
#ifdef CONFIG_PM
|
||||
.pm = &serial_pxa_pm_ops,
|
||||
#endif
|
||||
.of_match_table = serial_pxa_dt_ids,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue