diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-01-27 12:29:13 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-01-27 12:29:37 +0100 |
commit | f97b12cce6dea51880a6a89d4607c29c70a6a841 (patch) | |
tree | 1f05f6d39975bd213e7506e8a73ae0a59188c75e /arch/mips/ath79/dev-spi.c | |
parent | ccaa8d657117bb1876d471bd91579d774106778d (diff) | |
parent | 1bae4ce27c9c90344f23c65ea6966c50ffeae2f5 (diff) |
Merge commit 'v2.6.38-rc2' into core/locking
Reason: Update to mainline before adding the locking cleanup
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/mips/ath79/dev-spi.c')
-rw-r--r-- | arch/mips/ath79/dev-spi.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/mips/ath79/dev-spi.c b/arch/mips/ath79/dev-spi.c new file mode 100644 index 00000000000..aa30163efbf --- /dev/null +++ b/arch/mips/ath79/dev-spi.c @@ -0,0 +1,38 @@ +/* + * Atheros AR71XX/AR724X/AR913X SPI controller device + * + * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org> + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include <linux/platform_device.h> +#include <asm/mach-ath79/ar71xx_regs.h> +#include "dev-spi.h" + +static struct resource ath79_spi_resources[] = { + { + .start = AR71XX_SPI_BASE, + .end = AR71XX_SPI_BASE + AR71XX_SPI_SIZE - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device ath79_spi_device = { + .name = "ath79-spi", + .id = -1, + .resource = ath79_spi_resources, + .num_resources = ARRAY_SIZE(ath79_spi_resources), +}; + +void __init ath79_register_spi(struct ath79_spi_platform_data *pdata, + struct spi_board_info const *info, + unsigned n) +{ + spi_register_board_info(info, n); + ath79_spi_device.dev.platform_data = pdata; + platform_device_register(&ath79_spi_device); +} |