diff options
author | James <> | 2013-03-17 12:16:37 +0000 |
---|---|---|
committer | James <> | 2013-03-17 12:16:37 +0000 |
commit | 27b76ab0671089c47506615a796a261e993896a7 (patch) | |
tree | 61213d67e7fa87b20356b23798558e2c4212c42f /package/system/wrt55agv2-spidevs | |
download | trunk-36060-27b76ab0671089c47506615a796a261e993896a7.tar.gz trunk-36060-27b76ab0671089c47506615a796a261e993896a7.tar.bz2 trunk-36060-27b76ab0671089c47506615a796a261e993896a7.zip |
Diffstat (limited to 'package/system/wrt55agv2-spidevs')
13 files changed, 552 insertions, 0 deletions
diff --git a/package/system/wrt55agv2-spidevs/.svn/entries b/package/system/wrt55agv2-spidevs/.svn/entries new file mode 100644 index 0000000..2c55c39 --- /dev/null +++ b/package/system/wrt55agv2-spidevs/.svn/entries @@ -0,0 +1,65 @@ +10 + +dir +36060 +svn://svn.openwrt.org/openwrt/trunk/package/system/wrt55agv2-spidevs +svn://svn.openwrt.org/openwrt + + + +2012-10-17T22:45:58.668189Z +33830 +blogic + + + + + + + + + + + + + + +3c298f89-4303-0410-b956-a3cf2f4a3e73 + +src +dir + +Makefile +file + + + + +2013-03-17T12:13:14.000000Z +f93a095da9552d8f9533827406df813f +2012-10-17T22:45:58.668189Z +33830 +blogic +has-props + + + + + + + + + + + + + + + + + + + + +1354 + diff --git a/package/system/wrt55agv2-spidevs/.svn/prop-base/Makefile.svn-base b/package/system/wrt55agv2-spidevs/.svn/prop-base/Makefile.svn-base new file mode 100644 index 0000000..bdbd305 --- /dev/null +++ b/package/system/wrt55agv2-spidevs/.svn/prop-base/Makefile.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:eol-style +V 6 +native +END diff --git a/package/system/wrt55agv2-spidevs/.svn/text-base/Makefile.svn-base b/package/system/wrt55agv2-spidevs/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..236c9a3 --- /dev/null +++ b/package/system/wrt55agv2-spidevs/.svn/text-base/Makefile.svn-base @@ -0,0 +1,53 @@ +# +# Copyright (C) 2008 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=wrt55agv2-spidevs +PKG_RELEASE:=1 + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/wrt55agv2-spidevs + SUBMENU:=Other modules + TITLE:=WRT55AG v2 SPI devices support + DEPENDS:=@TARGET_atheros +kmod-spi-gpio-old +kmod-spi-ks8995 + FILES:=$(PKG_BUILD_DIR)/wrt55agv2_spidevs.ko +endef + +define KernelPackage/wrt55agv2-spidevs/description + Kernel module for the SPI devices on the WRT55AG v2 board. +endef + +EXTRA_KCONFIG:= \ + CONFIG_WRT55AGV2_SPIDEVS=m + +EXTRA_CFLAGS:= \ + $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \ + $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \ + +MAKE_OPTS:= \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + SUBDIRS="$(PKG_BUILD_DIR)" \ + EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ + LINUXINCLUDE="-I$(LINUX_DIR)/include -I$(LINUX_DIR)/arch/mips/include -include generated/autoconf.h" \ + $(EXTRA_KCONFIG) + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + $(CP) ./src/* $(PKG_BUILD_DIR)/ +endef + +define Build/Compile + $(MAKE) -C "$(LINUX_DIR)" \ + $(MAKE_OPTS) \ + modules +endef + +$(eval $(call KernelPackage,wrt55agv2-spidevs)) diff --git a/package/system/wrt55agv2-spidevs/Makefile b/package/system/wrt55agv2-spidevs/Makefile new file mode 100644 index 0000000..236c9a3 --- /dev/null +++ b/package/system/wrt55agv2-spidevs/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2008 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=wrt55agv2-spidevs +PKG_RELEASE:=1 + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/wrt55agv2-spidevs + SUBMENU:=Other modules + TITLE:=WRT55AG v2 SPI devices support + DEPENDS:=@TARGET_atheros +kmod-spi-gpio-old +kmod-spi-ks8995 + FILES:=$(PKG_BUILD_DIR)/wrt55agv2_spidevs.ko +endef + +define KernelPackage/wrt55agv2-spidevs/description + Kernel module for the SPI devices on the WRT55AG v2 board. +endef + +EXTRA_KCONFIG:= \ + CONFIG_WRT55AGV2_SPIDEVS=m + +EXTRA_CFLAGS:= \ + $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \ + $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \ + +MAKE_OPTS:= \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + SUBDIRS="$(PKG_BUILD_DIR)" \ + EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ + LINUXINCLUDE="-I$(LINUX_DIR)/include -I$(LINUX_DIR)/arch/mips/include -include generated/autoconf.h" \ + $(EXTRA_KCONFIG) + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + $(CP) ./src/* $(PKG_BUILD_DIR)/ +endef + +define Build/Compile + $(MAKE) -C "$(LINUX_DIR)" \ + $(MAKE_OPTS) \ + modules +endef + +$(eval $(call KernelPackage,wrt55agv2-spidevs)) diff --git a/package/system/wrt55agv2-spidevs/src/.svn/entries b/package/system/wrt55agv2-spidevs/src/.svn/entries new file mode 100644 index 0000000..84f65d8 --- /dev/null +++ b/package/system/wrt55agv2-spidevs/src/.svn/entries @@ -0,0 +1,130 @@ +10 + +dir +36060 +svn://svn.openwrt.org/openwrt/trunk/package/system/wrt55agv2-spidevs/src +svn://svn.openwrt.org/openwrt + + + +2012-10-17T22:45:58.668189Z +33830 +blogic + + + + + + + + + + + + + + +3c298f89-4303-0410-b956-a3cf2f4a3e73 + +Kconfig +file + + + + +2013-03-17T12:13:14.000000Z +cc2b38746a4558f5946fe2f35253f5c2 +2012-10-17T22:45:58.668189Z +33830 +blogic + + + + + + + + + + + + + + + + + + + + + +113 + +wrt55agv2_spidevs.c +file + + + + +2013-03-17T12:13:14.000000Z +698788550fb6262e591945acd04228f0 +2012-10-17T22:45:58.668189Z +33830 +blogic +has-props + + + + + + + + + + + + + + + + + + + + +2736 + +Makefile +file + + + + +2013-03-17T12:13:14.000000Z +8c38679fa1cd6e0f1436b410d782e68f +2012-10-17T22:45:58.668189Z +33830 +blogic +has-props + + + + + + + + + + + + + + + + + + + + +54 + diff --git a/package/system/wrt55agv2-spidevs/src/.svn/prop-base/Makefile.svn-base b/package/system/wrt55agv2-spidevs/src/.svn/prop-base/Makefile.svn-base new file mode 100644 index 0000000..bdbd305 --- /dev/null +++ b/package/system/wrt55agv2-spidevs/src/.svn/prop-base/Makefile.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:eol-style +V 6 +native +END diff --git a/package/system/wrt55agv2-spidevs/src/.svn/prop-base/wrt55agv2_spidevs.c.svn-base b/package/system/wrt55agv2-spidevs/src/.svn/prop-base/wrt55agv2_spidevs.c.svn-base new file mode 100644 index 0000000..bdbd305 --- /dev/null +++ b/package/system/wrt55agv2-spidevs/src/.svn/prop-base/wrt55agv2_spidevs.c.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:eol-style +V 6 +native +END diff --git a/package/system/wrt55agv2-spidevs/src/.svn/text-base/Kconfig.svn-base b/package/system/wrt55agv2-spidevs/src/.svn/text-base/Kconfig.svn-base new file mode 100644 index 0000000..75e8242 --- /dev/null +++ b/package/system/wrt55agv2-spidevs/src/.svn/text-base/Kconfig.svn-base @@ -0,0 +1,3 @@ +config WRT55AGV2_SPIDEVS + tristate "SPI device support for the WRT55AG v2 board" + depends on SPI && MIPS_ATHEROS diff --git a/package/system/wrt55agv2-spidevs/src/.svn/text-base/Makefile.svn-base b/package/system/wrt55agv2-spidevs/src/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..7f2ddb4 --- /dev/null +++ b/package/system/wrt55agv2-spidevs/src/.svn/text-base/Makefile.svn-base @@ -0,0 +1 @@ +obj-${CONFIG_WRT55AGV2_SPIDEVS} += wrt55agv2_spidevs.o
\ No newline at end of file diff --git a/package/system/wrt55agv2-spidevs/src/.svn/text-base/wrt55agv2_spidevs.c.svn-base b/package/system/wrt55agv2-spidevs/src/.svn/text-base/wrt55agv2_spidevs.c.svn-base new file mode 100644 index 0000000..dfb7f6a --- /dev/null +++ b/package/system/wrt55agv2-spidevs/src/.svn/text-base/wrt55agv2_spidevs.c.svn-base @@ -0,0 +1,114 @@ +/* + * SPI driver for the Linksys WRT55AG v2 board. + * + * Copyright (C) 2008 Gabor Juhos <juhosg at openwrt.org> + * + * This file was based on the mmc_over_gpio driver: + * Copyright 2008 Michael Buesch <mb@bu3sch.de> + * + * 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 <linux/spi/spi_gpio_old.h> +#include <linux/module.h> + +#define DRV_NAME "wrt55agv2-spidevs" +#define DRV_DESC "SPI driver for the WRT55AG v2 board" +#define DRV_VERSION "0.1.0" +#define PFX DRV_NAME ": " + +#define GPIO_PIN_MISO 1 +#define GPIO_PIN_CS 2 +#define GPIO_PIN_CLK 3 +#define GPIO_PIN_MOSI 4 + +static struct platform_device *spi_gpio_dev; + +static int __init boardinfo_setup(struct spi_board_info *bi, + struct spi_master *master, void *data) +{ + + strlcpy(bi->modalias, "spi-ks8995", sizeof(bi->modalias)); + + bi->max_speed_hz = 5000000 /* Hz */; + bi->bus_num = master->bus_num; + bi->mode = SPI_MODE_0; + + return 0; +} + +static int __init wrt55agv2_spidevs_init(void) +{ + struct spi_gpio_platform_data pdata; + int err; + + spi_gpio_dev = platform_device_alloc("spi-gpio", 0); + if (!spi_gpio_dev) { + printk(KERN_ERR PFX "no memory for spi-gpio device\n"); + return -ENOMEM; + } + + memset(&pdata, 0, sizeof(pdata)); + pdata.pin_miso = GPIO_PIN_MISO; + pdata.pin_cs = GPIO_PIN_CS; + pdata.pin_clk = GPIO_PIN_CLK; + pdata.pin_mosi = GPIO_PIN_MOSI; + pdata.cs_activelow = 1; + pdata.no_spi_delay = 1; + pdata.boardinfo_setup = boardinfo_setup; + pdata.boardinfo_setup_data = NULL; + + err = platform_device_add_data(spi_gpio_dev, &pdata, sizeof(pdata)); + if (err) + goto err_free_dev; + + err = platform_device_register(spi_gpio_dev); + if (err) { + printk(KERN_ERR PFX "unable to register device\n"); + goto err_free_pdata; + } + + return 0; + +err_free_pdata: + kfree(spi_gpio_dev->dev.platform_data); + spi_gpio_dev->dev.platform_data = NULL; + +err_free_dev: + platform_device_put(spi_gpio_dev); + return err; +} + +static void __exit wrt55agv2_spidevs_cleanup(void) +{ + if (!spi_gpio_dev) + return; + + platform_device_unregister(spi_gpio_dev); + + kfree(spi_gpio_dev->dev.platform_data); + spi_gpio_dev->dev.platform_data = NULL; + platform_device_put(spi_gpio_dev); +} + +static int __init wrt55agv2_spidevs_modinit(void) +{ + printk(KERN_INFO DRV_DESC " version " DRV_VERSION "\n"); + return wrt55agv2_spidevs_init(); +} +module_init(wrt55agv2_spidevs_modinit); + +static void __exit wrt55agv2_spidevs_modexit(void) +{ + wrt55agv2_spidevs_cleanup(); +} +module_exit(wrt55agv2_spidevs_modexit); + +MODULE_DESCRIPTION(DRV_DESC); +MODULE_VERSION(DRV_VERSION); +MODULE_AUTHOR("Gabor Juhos <juhosg at openwrt.org>"); +MODULE_LICENSE("GPL v2"); + diff --git a/package/system/wrt55agv2-spidevs/src/Kconfig b/package/system/wrt55agv2-spidevs/src/Kconfig new file mode 100644 index 0000000..75e8242 --- /dev/null +++ b/package/system/wrt55agv2-spidevs/src/Kconfig @@ -0,0 +1,3 @@ +config WRT55AGV2_SPIDEVS + tristate "SPI device support for the WRT55AG v2 board" + depends on SPI && MIPS_ATHEROS diff --git a/package/system/wrt55agv2-spidevs/src/Makefile b/package/system/wrt55agv2-spidevs/src/Makefile new file mode 100644 index 0000000..7f2ddb4 --- /dev/null +++ b/package/system/wrt55agv2-spidevs/src/Makefile @@ -0,0 +1 @@ +obj-${CONFIG_WRT55AGV2_SPIDEVS} += wrt55agv2_spidevs.o
\ No newline at end of file diff --git a/package/system/wrt55agv2-spidevs/src/wrt55agv2_spidevs.c b/package/system/wrt55agv2-spidevs/src/wrt55agv2_spidevs.c new file mode 100644 index 0000000..dfb7f6a --- /dev/null +++ b/package/system/wrt55agv2-spidevs/src/wrt55agv2_spidevs.c @@ -0,0 +1,114 @@ +/* + * SPI driver for the Linksys WRT55AG v2 board. + * + * Copyright (C) 2008 Gabor Juhos <juhosg at openwrt.org> + * + * This file was based on the mmc_over_gpio driver: + * Copyright 2008 Michael Buesch <mb@bu3sch.de> + * + * 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 <linux/spi/spi_gpio_old.h> +#include <linux/module.h> + +#define DRV_NAME "wrt55agv2-spidevs" +#define DRV_DESC "SPI driver for the WRT55AG v2 board" +#define DRV_VERSION "0.1.0" +#define PFX DRV_NAME ": " + +#define GPIO_PIN_MISO 1 +#define GPIO_PIN_CS 2 +#define GPIO_PIN_CLK 3 +#define GPIO_PIN_MOSI 4 + +static struct platform_device *spi_gpio_dev; + +static int __init boardinfo_setup(struct spi_board_info *bi, + struct spi_master *master, void *data) +{ + + strlcpy(bi->modalias, "spi-ks8995", sizeof(bi->modalias)); + + bi->max_speed_hz = 5000000 /* Hz */; + bi->bus_num = master->bus_num; + bi->mode = SPI_MODE_0; + + return 0; +} + +static int __init wrt55agv2_spidevs_init(void) +{ + struct spi_gpio_platform_data pdata; + int err; + + spi_gpio_dev = platform_device_alloc("spi-gpio", 0); + if (!spi_gpio_dev) { + printk(KERN_ERR PFX "no memory for spi-gpio device\n"); + return -ENOMEM; + } + + memset(&pdata, 0, sizeof(pdata)); + pdata.pin_miso = GPIO_PIN_MISO; + pdata.pin_cs = GPIO_PIN_CS; + pdata.pin_clk = GPIO_PIN_CLK; + pdata.pin_mosi = GPIO_PIN_MOSI; + pdata.cs_activelow = 1; + pdata.no_spi_delay = 1; + pdata.boardinfo_setup = boardinfo_setup; + pdata.boardinfo_setup_data = NULL; + + err = platform_device_add_data(spi_gpio_dev, &pdata, sizeof(pdata)); + if (err) + goto err_free_dev; + + err = platform_device_register(spi_gpio_dev); + if (err) { + printk(KERN_ERR PFX "unable to register device\n"); + goto err_free_pdata; + } + + return 0; + +err_free_pdata: + kfree(spi_gpio_dev->dev.platform_data); + spi_gpio_dev->dev.platform_data = NULL; + +err_free_dev: + platform_device_put(spi_gpio_dev); + return err; +} + +static void __exit wrt55agv2_spidevs_cleanup(void) +{ + if (!spi_gpio_dev) + return; + + platform_device_unregister(spi_gpio_dev); + + kfree(spi_gpio_dev->dev.platform_data); + spi_gpio_dev->dev.platform_data = NULL; + platform_device_put(spi_gpio_dev); +} + +static int __init wrt55agv2_spidevs_modinit(void) +{ + printk(KERN_INFO DRV_DESC " version " DRV_VERSION "\n"); + return wrt55agv2_spidevs_init(); +} +module_init(wrt55agv2_spidevs_modinit); + +static void __exit wrt55agv2_spidevs_modexit(void) +{ + wrt55agv2_spidevs_cleanup(); +} +module_exit(wrt55agv2_spidevs_modexit); + +MODULE_DESCRIPTION(DRV_DESC); +MODULE_VERSION(DRV_VERSION); +MODULE_AUTHOR("Gabor Juhos <juhosg at openwrt.org>"); +MODULE_LICENSE("GPL v2"); + |