From dcd71c4d2e01a6593cc3a3437b58cd1d0f8d71c0 Mon Sep 17 00:00:00 2001 From: blogic Date: Tue, 29 Mar 2011 07:10:50 +0000 Subject: [lantiq] * adds spi driver, thx daniel git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26355 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/lantiq/patches/942-spi3.patch | 66 ++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 target/linux/lantiq/patches/942-spi3.patch (limited to 'target/linux/lantiq/patches/942-spi3.patch') diff --git a/target/linux/lantiq/patches/942-spi3.patch b/target/linux/lantiq/patches/942-spi3.patch new file mode 100644 index 000000000..c09125f66 --- /dev/null +++ b/target/linux/lantiq/patches/942-spi3.patch @@ -0,0 +1,66 @@ +From: Daniel Schwierzeck +Date: Thu, 3 Mar 2011 20:42:26 +0000 (+0100) +Subject: MIPS: lantiq: Add device register helper for SPI controller and devices +X-Git-Url: http://nbd.name/gitweb.cgi?p=lantiq.git;a=commitdiff_plain;h=b35b07062b718ece9b9cb7b23b12d83a087eafb0;hp=653c95b8b9066c9c6ac08bd64d0ceee439e9fd90 + +MIPS: lantiq: Add device register helper for SPI controller and devices + +Signed-off-by: Daniel Schwierzeck +--- + +--- a/arch/mips/lantiq/xway/devices.c ++++ b/arch/mips/lantiq/xway/devices.c +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -332,5 +333,27 @@ + lantiq_emulate_madwifi_eep = 1; + } + ++static struct resource lq_spi_resources[] = { ++ { ++ .start = LQ_SSC_BASE_ADDR, ++ .end = LQ_SSC_BASE_ADDR + LQ_SSC_SIZE - 1, ++ .flags = IORESOURCE_MEM, ++ }, ++ IRQ_RES(spi_tx, LQ_SSC_TIR), ++ IRQ_RES(spi_rx, LQ_SSC_RIR), ++ IRQ_RES(spi_err, LQ_SSC_EIR), ++}; + ++static struct platform_device lq_spi = { ++ .name = "ltq-spi", ++ .resource = lq_spi_resources, ++ .num_resources = ARRAY_SIZE(lq_spi_resources), ++}; + ++void __init lq_register_spi(struct lq_spi_platform_data *pdata, ++ struct spi_board_info const *info, unsigned n) ++{ ++ spi_register_board_info(info, n); ++ lq_spi.dev.platform_data = pdata; ++ platform_device_register(&lq_spi); ++} +--- a/arch/mips/lantiq/xway/devices.h ++++ b/arch/mips/lantiq/xway/devices.h +@@ -11,6 +11,7 @@ + + #include + #include ++#include + + extern void __init lq_register_gpio(void); + extern void __init lq_register_gpio_stp(void); +@@ -25,5 +26,7 @@ + extern void __init lq_register_asc(int port); + extern void __init lq_register_gpio_buttons(struct gpio_button *buttons, int cnt); + extern void __init lq_register_crypto(const char *name); ++extern void lq_register_spi(struct lq_spi_platform_data *pdata, ++ struct spi_board_info const *info, unsigned n); + + #endif -- cgit v1.2.3