summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames <>2015-10-02 12:43:16 +0100
committerJames <>2015-10-02 12:43:16 +0100
commit5c9b97d145d43e44897a5c628ca9b10ece398189 (patch)
treedcdba1a29eb03663b82731ad6fa403cb3381e657
parent2addacffd2bc410b96436b580ed3b78f5d24d617 (diff)
downloadtrunk-47048-pq-master.tar.gz
trunk-47048-pq-master.tar.bz2
trunk-47048-pq-master.zip
nearly working audioHEADmaster
-rw-r--r--master/audio478
-rw-r--r--master/config27
-rw-r--r--master/feeds-install128
-rw-r--r--master/kkmoon432
-rw-r--r--master/motors102
-rw-r--r--master/series2
6 files changed, 1064 insertions, 105 deletions
diff --git a/master/audio b/master/audio
new file mode 100644
index 0000000..650f224
--- /dev/null
+++ b/master/audio
@@ -0,0 +1,478 @@
+diff --git a/.config b/.config
+index f832165..10dcb5d 100644
+--- a/.config
++++ b/.config
+@@ -1410,8 +1410,15 @@ CONFIG_PACKAGE_gdbserver=m
+ #
+ # I2C support
+ #
+-# CONFIG_PACKAGE_kmod-i2c-core is not set
++CONFIG_PACKAGE_kmod-i2c-core=y
++# CONFIG_PACKAGE_kmod-i2c-algo-bit is not set
++# CONFIG_PACKAGE_kmod-i2c-algo-pca is not set
++# CONFIG_PACKAGE_kmod-i2c-algo-pcf is not set
++# CONFIG_PACKAGE_kmod-i2c-gpio is not set
+ # CONFIG_PACKAGE_kmod-i2c-gpio-custom is not set
++# CONFIG_PACKAGE_kmod-i2c-mux is not set
++CONFIG_PACKAGE_kmod-i2c-ralink=y
++# CONFIG_PACKAGE_kmod-i2c-tiny-usb is not set
+ CONFIG_PACKAGE_kmod-kkmoon-motors=y
+
+ #
+@@ -1456,7 +1463,7 @@ CONFIG_PACKAGE_kmod-lib-crc-itu-t=y
+ # CONFIG_PACKAGE_kmod-lib-crc7 is not set
+ # CONFIG_PACKAGE_kmod-lib-crc8 is not set
+ # CONFIG_PACKAGE_kmod-lib-lz4 is not set
+-# CONFIG_PACKAGE_kmod-lib-lzo is not set
++CONFIG_PACKAGE_kmod-lib-lzo=y
+ # CONFIG_PACKAGE_kmod-lib-textsearch is not set
+ # CONFIG_PACKAGE_kmod-lib-zlib is not set
+
+@@ -1651,7 +1658,7 @@ CONFIG_PACKAGE_kmod-gpio-button-hotplug=y
+ # CONFIG_PACKAGE_kmod-pps-gpio is not set
+ # CONFIG_PACKAGE_kmod-ptp is not set
+ # CONFIG_PACKAGE_kmod-random-core is not set
+-# CONFIG_PACKAGE_kmod-regmap is not set
++CONFIG_PACKAGE_kmod-regmap=y
+ # CONFIG_PACKAGE_kmod-rotary-gpio-custom is not set
+ # CONFIG_PACKAGE_kmod-sdhci is not set
+ # CONFIG_PACKAGE_kmod-serial-8250 is not set
+@@ -1675,12 +1682,13 @@ CONFIG_PACKAGE_kmod-gpio-button-hotplug=y
+ #
+ # Sound Support
+ #
+-CONFIG_PACKAGE_kmod-sound-core=m
+-# CONFIG_PACKAGE_kmod-ac97 is not set
++CONFIG_PACKAGE_kmod-sound-core=y
++CONFIG_PACKAGE_kmod-ac97=y
+ # CONFIG_PACKAGE_kmod-sound-i8x0 is not set
++CONFIG_PACKAGE_kmod-sound-rt5350=y
+ # CONFIG_PACKAGE_kmod-sound-seq is not set
+ # CONFIG_PACKAGE_kmod-sound-soc-ac97 is not set
+-# CONFIG_PACKAGE_kmod-sound-soc-core is not set
++CONFIG_PACKAGE_kmod-sound-soc-core=y
+ CONFIG_PACKAGE_kmod-usb-audio=m
+
+ #
+diff --git a/target/linux/ramips/dts/TP-C516W-common.dtsi b/target/linux/ramips/dts/TP-C516W-common.dtsi
+index 675f83a..368c387 100644
+--- a/target/linux/ramips/dts/TP-C516W-common.dtsi
++++ b/target/linux/ramips/dts/TP-C516W-common.dtsi
+@@ -5,6 +5,20 @@
+ status = "ok";
+ };
+
++ i2c@900 {
++ status = "ok";
++ };
++
++ i2s: i2s@a00 {
++ status = "ok";
++
++/*
++ pinctrl-names = "default";
++ pinctrl-0 = <&i2s_gpio_pins>;
++*/
++
++ };
++
+ spi@b00 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&spi_pins>;
+@@ -12,13 +26,50 @@
+
+ };
+
++
++ audio {
++ compatible = "ralink,rt5350-audio-cjc8988";
++ i2s-controller = <&i2s>;
++ audio-codec = <&codec>;
++ };
++
++ codec: codec {
++ compatible = "wlf,wm8988", "chinaic,cjc8988";
++ };
++
++
+ pinctrl {
++ i2s_gpio_pins: i2s {
++ i2s {
++ ralink,group = "uartf";
++ ralink,function = "gpio i2s";
++ };
++ };
++
++
+ state_default: pinctrl0 {
+ gpio {
+- ralink,group = "jtag", "rgmii", "mdio", "led", "spi_cs1", "uartf";
++ ralink,group = "jtag", "rgmii", "mdio", "led", "spi_cs1";
+ ralink,function = "gpio";
+ };
++
++ /* Do this here as it crosses two functions */
++ i2s {
++ ralink,group = "uartf";
++ ralink,function = "gpio i2s";
++ };
++ };
++
++/*
++ i2s_gpio_pins: i2s {
++ i2s {
++ ralink,group = "uartf";
++ ralink,function = "gpio i2s";
++ };
+ };
++*/
++
++
+ };
+
+ gpio-leds {
+diff --git a/target/linux/ramips/modules.mk b/target/linux/ramips/modules.mk
+index 673fa61..9088a2e 100644
+--- a/target/linux/ramips/modules.mk
++++ b/target/linux/ramips/modules.mk
+@@ -88,3 +88,24 @@ define KernelPackage/sound-mt7620/description
+ endef
+
+ $(eval $(call KernelPackage,sound-mt7620))
++
++
++define KernelPackage/sound-rt5350
++ TITLE:=RT5350 PCM/I2S Alsa Driver
++ DEPENDS:=@TARGET_ramips +kmod-sound-soc-core +kmod-regmap
++ KCONFIG:= \
++ CONFIG_SND_MT7620_SOC_I2S \
++ CONFIG_SND_RT5350_SOC_WM8988
++ FILES:= \
++ $(LINUX_DIR)/sound/soc/ralink/snd-soc-mt7620-i2s.ko \
++ $(LINUX_DIR)/sound/soc/ralink/snd-soc-rt5350-wm8988.ko \
++ $(LINUX_DIR)/sound/soc/codecs/snd-soc-wm8988.ko
++ AUTOLOAD:=$(call AutoLoad,90,snd-soc-wm8960 snd-soc-mt7620-i2s snd-soc-mt7620-wm8960)
++ $(call AddDepends/sound)
++endef
++
++define KernelPackage/sound-rt5350/description
++ Alsa modules for ralink i2s controller.
++endef
++
++$(eval $(call KernelPackage,sound-rt5350))
+diff --git a/target/linux/ramips/patches-3.18/9998-rt5350-i2s.patch b/target/linux/ramips/patches-3.18/9998-rt5350-i2s.patch
+new file mode 100644
+index 0000000..b7d7754
+--- /dev/null
++++ b/target/linux/ramips/patches-3.18/9998-rt5350-i2s.patch
+@@ -0,0 +1,310 @@
++Index: linux-3.18.21/sound/soc/ralink/mt7620-i2s.c
++===================================================================
++--- linux-3.18.21.orig/sound/soc/ralink/mt7620-i2s.c
+++++ linux-3.18.21/sound/soc/ralink/mt7620-i2s.c
++@@ -414,6 +414,7 @@ static int mt7620_i2s_dev_remove(struct
++
++ static const struct of_device_id mt7620_i2s_match[] = {
++ { .compatible = "ralink,mt7620a-i2s" },
+++ { .compatible = "ralink,rt5350-i2s" },
++ {},
++ };
++ MODULE_DEVICE_TABLE(of, mt7620_i2s_match);
++Index: linux-3.18.21/sound/soc/ralink/Kconfig
++===================================================================
++--- linux-3.18.21.orig/sound/soc/ralink/Kconfig
+++++ linux-3.18.21/sound/soc/ralink/Kconfig
++@@ -1,7 +1,7 @@
++ config SND_MT7620_SOC_I2S
++- depends on SOC_MT7620 && SND_SOC
+++ depends on (SOC_RT305X || SOC_MT7620) && SND_SOC
++ select SND_SOC_GENERIC_DMAENGINE_PCM
++- tristate "SoC Audio (I2S protocol) for Ralink MT7620 SoC"
+++ tristate "SoC Audio (I2S protocol) for Ralink RT5350 and MT7620 SoC"
++ help
++ Say Y if you want to use I2S protocol and I2S codec on Ingenic MT7620
++ based boards.
++@@ -13,3 +13,11 @@ config SND_MT7620_SOC_WM8960
++ help
++ Say Y if you want to add support for ASoC audio on the Qi LB60 board
++ a.k.a Qi Ben NanoNote.
+++
+++config SND_RT5350_SOC_WM8988
+++ tristate "SoC Audio support for Ralink WM8988"
+++ select SND_MT7620_SOC_I2S
+++ select SND_SOC_WM8988
+++ help
+++ Say Y if you want to add support for ASoC audio on the Qi LB60 board
+++ a.k.a Qi Ben NanoNote.
++Index: linux-3.18.21/sound/soc/codecs/wm8988.c
++===================================================================
++--- linux-3.18.21.orig/sound/soc/codecs/wm8988.c
+++++ linux-3.18.21/sound/soc/codecs/wm8988.c
++@@ -942,9 +942,17 @@ static const struct i2c_device_id wm8988
++ };
++ MODULE_DEVICE_TABLE(i2c, wm8988_i2c_id);
++
+++
+++static const struct of_device_id wm8988_of_match[] = {
+++ { .compatible = "wlf,wm8988", },
+++ { }
+++};
+++MODULE_DEVICE_TABLE(of, wm8962_of_match);
+++
++ static struct i2c_driver wm8988_i2c_driver = {
++ .driver = {
++ .name = "wm8988",
+++ .of_match_table = wm8988_of_match,
++ .owner = THIS_MODULE,
++ },
++ .probe = wm8988_i2c_probe,
++Index: linux-3.18.21/sound/soc/ralink/Makefile
++===================================================================
++--- linux-3.18.21.orig/sound/soc/ralink/Makefile
+++++ linux-3.18.21/sound/soc/ralink/Makefile
++@@ -9,3 +9,7 @@ obj-$(CONFIG_SND_MT7620_SOC_I2S) += snd-
++ snd-soc-mt7620-wm8960-objs := mt7620-wm8960.o
++
++ obj-$(CONFIG_SND_MT7620_SOC_WM8960) += snd-soc-mt7620-wm8960.o
+++
+++snd-soc-rt5350-wm8988-objs := rt5350-wm8988.o
+++
+++obj-$(CONFIG_SND_RT5350_SOC_WM8988) += snd-soc-rt5350-wm8988.o
++Index: linux-3.18.21/sound/soc/ralink/rt5350-wm8988.c
++===================================================================
++--- /dev/null
+++++ linux-3.18.21/sound/soc/ralink/rt5350-wm8988.c
++@@ -0,0 +1,233 @@
+++/*
+++ * Copyright 2013 Freescale Semiconductor, Inc.
+++ *
+++ * Based on rt5350-sgtl5000.c
+++ * Copyright 2012 Freescale Semiconductor, Inc.
+++ * Copyright 2012 Linaro Ltd.
+++ *
+++ * The code contained herein is licensed under the GNU General Public
+++ * License. You may obtain a copy of the GNU General Public License
+++ * Version 2 or later at the following locations:
+++ *
+++ * http://www.opensource.org/licenses/gpl-license.html
+++ * http://www.gnu.org/copyleft/gpl.html
+++ */
+++
+++#include <linux/module.h>
+++#include <linux/of_platform.h>
+++#include <linux/i2c.h>
+++#include <linux/slab.h>
+++#include <sound/soc.h>
+++#include <sound/pcm_params.h>
+++#include <sound/soc-dapm.h>
+++#include <linux/pinctrl/consumer.h>
+++
+++#include "../codecs/wm8960.h"
+++
+++#define DAI_NAME_SIZE 32
+++
+++struct rt5350_wm8960_data {
+++ struct snd_soc_dai_link dai;
+++ struct snd_soc_card card;
+++ char codec_dai_name[DAI_NAME_SIZE];
+++ char platform_name[DAI_NAME_SIZE];
+++ unsigned int clk_frequency;
+++};
+++
+++struct rt5350_priv {
+++ struct platform_device *pdev;
+++};
+++static struct rt5350_priv card_priv;
+++
+++static const struct snd_soc_dapm_widget rt5350_wm8960_dapm_widgets[] = {
+++ SND_SOC_DAPM_HP("Headphone Jack", NULL),
+++ SND_SOC_DAPM_SPK("Ext Spk", NULL),
+++ SND_SOC_DAPM_MIC("AMIC", NULL),
+++ SND_SOC_DAPM_MIC("DMIC", NULL),
+++};
+++
+++static int sample_rate = 44100;
+++static snd_pcm_format_t sample_format = SNDRV_PCM_FORMAT_S16_LE;
+++
+++static int rt5350_hifi_hw_params(struct snd_pcm_substream *substream,
+++ struct snd_pcm_hw_params *params)
+++{
+++ sample_rate = params_rate(params);
+++ sample_format = params_format(params);
+++
+++ return 0;
+++}
+++
+++static struct snd_soc_ops rt5350_hifi_ops = {
+++ .hw_params = rt5350_hifi_hw_params,
+++};
+++
+++static int rt5350_wm8960_set_bias_level(struct snd_soc_card *card,
+++ struct snd_soc_dapm_context *dapm,
+++ enum snd_soc_bias_level level)
+++{
+++ struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai;
+++ struct rt5350_priv *priv = &card_priv;
+++ struct rt5350_wm8960_data *data = snd_soc_card_get_drvdata(card);
+++ struct device *dev = &priv->pdev->dev;
+++ int ret;
+++
+++ if (dapm->dev != codec_dai->dev)
+++ return 0;
+++
+++ switch (level) {
+++ case SND_SOC_BIAS_PREPARE:
+++ if (dapm->bias_level == SND_SOC_BIAS_STANDBY) {
+++ }
+++ break;
+++
+++ case SND_SOC_BIAS_STANDBY:
+++ if (dapm->bias_level == SND_SOC_BIAS_PREPARE) {
+++ ret = snd_soc_dai_set_sysclk(codec_dai,
+++ WM8960_SYSCLK_MCLK, data->clk_frequency,
+++ SND_SOC_CLOCK_IN);
+++ if (ret < 0) {
+++ dev_err(dev,
+++ "failed to switch away from FLL: %d\n",
+++ ret);
+++ return ret;
+++ }
+++ }
+++ break;
+++
+++ default:
+++ break;
+++ }
+++
+++ return 0;
+++}
+++
+++static int rt5350_wm8960_late_probe(struct snd_soc_card *card)
+++{
+++ struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai;
+++ struct rt5350_priv *priv = &card_priv;
+++ struct rt5350_wm8960_data *data = snd_soc_card_get_drvdata(card);
+++ struct device *dev = &priv->pdev->dev;
+++ int ret;
+++
+++ ret = snd_soc_dai_set_sysclk(codec_dai, WM8960_SYSCLK_MCLK,
+++ data->clk_frequency, SND_SOC_CLOCK_IN);
+++ if (ret < 0)
+++ dev_err(dev, "failed to set sysclk in %s\n", __func__);
+++
+++ return ret;
+++}
+++
+++static int rt5350_wm8960_probe(struct platform_device *pdev)
+++{
+++ struct device_node *i2s_np, *codec_np;
+++ struct platform_device *i2s_pdev;
+++ struct rt5350_priv *priv = &card_priv;
+++ struct i2c_client *codec_dev;
+++ struct rt5350_wm8960_data *data;
+++ int ret;
+++
+++ priv->pdev = pdev;
+++
+++ i2s_np = of_parse_phandle(pdev->dev.of_node, "i2s-controller", 0);
+++ codec_np = of_parse_phandle(pdev->dev.of_node, "audio-codec", 0);
+++ if (!i2s_np || !codec_np) {
+++ dev_err(&pdev->dev, "phandle missing or invalid\n");
+++ ret = -EINVAL;
+++ goto fail;
+++ }
+++
+++ i2s_pdev = of_find_device_by_node(i2s_np);
+++ if (!i2s_pdev) {
+++ dev_err(&pdev->dev, "failed to find SSI platform device\n");
+++ ret = -EINVAL;
+++ goto fail;
+++ }
+++ codec_dev = of_find_i2c_device_by_node(codec_np);
+++ if (!codec_dev || !codec_dev->dev.driver) {
+++ dev_err(&pdev->dev, "failed to find codec platform device\n");
+++ ret = -EINVAL;
+++ goto fail;
+++ }
+++
+++ data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+++ if (!data) {
+++ ret = -ENOMEM;
+++ goto fail;
+++ }
+++
+++ data->clk_frequency = 12000000;
+++ data->dai.name = "HiFi";
+++ data->dai.stream_name = "HiFi";
+++ data->dai.codec_dai_name = "wm8960-hifi";
+++ data->dai.codec_of_node = codec_np;
+++ data->dai.cpu_dai_name = dev_name(&i2s_pdev->dev);
+++ data->dai.platform_of_node = i2s_np;
+++ data->dai.ops = &rt5350_hifi_ops;
+++ data->dai.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+++ SND_SOC_DAIFMT_CBM_CFM;
+++
+++ data->card.dev = &pdev->dev;
+++ ret = snd_soc_of_parse_card_name(&data->card, "model");
+++ if (ret)
+++ goto fail;
+++ ret = snd_soc_of_parse_audio_routing(&data->card, "audio-routing");
+++ if (ret)
+++ goto fail;
+++ data->card.num_links = 1;
+++ data->card.dai_link = &data->dai;
+++ data->card.dapm_widgets = rt5350_wm8960_dapm_widgets;
+++ data->card.num_dapm_widgets = ARRAY_SIZE(rt5350_wm8960_dapm_widgets);
+++
+++ data->card.late_probe = rt5350_wm8960_late_probe;
+++ data->card.set_bias_level = rt5350_wm8960_set_bias_level;
+++
+++ platform_set_drvdata(pdev, &data->card);
+++ snd_soc_card_set_drvdata(&data->card, data);
+++
+++ ret = devm_snd_soc_register_card(&pdev->dev, &data->card);
+++ if (ret) {
+++ dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
+++ goto fail;
+++ }
+++
+++ of_node_put(i2s_np);
+++ of_node_put(codec_np);
+++
+++ return 0;
+++fail:
+++ if (i2s_np)
+++ of_node_put(i2s_np);
+++ if (codec_np)
+++ of_node_put(codec_np);
+++
+++ return ret;
+++}
+++
+++static int rt5350_wm8960_remove(struct platform_device *pdev)
+++{
+++ return 0;
+++}
+++
+++static const struct of_device_id rt5350_wm8960_dt_ids[] = {
+++ { .compatible = "ralink,rt5350-audio-cjc8988", },
+++ { /* sentinel */ }
+++};
+++MODULE_DEVICE_TABLE(of, rt5350_wm8960_dt_ids);
+++
+++static struct platform_driver rt5350_wm8960_driver = {
+++ .driver = {
+++ .name = "rt5350-wm8960",
+++ .owner = THIS_MODULE,
+++ .pm = &snd_soc_pm_ops,
+++ .of_match_table = rt5350_wm8960_dt_ids,
+++ },
+++ .probe = rt5350_wm8960_probe,
+++ .remove = rt5350_wm8960_remove,
+++};
+++module_platform_driver(rt5350_wm8960_driver);
+++
+++MODULE_AUTHOR("Freescale Semiconductor, Inc.");
+++MODULE_DESCRIPTION("Freescale i.MX WM8962 ASoC machine driver");
+++MODULE_LICENSE("GPL v2");
+++MODULE_ALIAS("platform:rt5350-wm8962");
diff --git a/master/config b/master/config
index bf1cc1c..a65c06c 100644
--- a/master/config
+++ b/master/config
@@ -1,9 +1,9 @@
diff --git a/.config b/.config
new file mode 100644
-index 0000000..00fed37
+index 0000000..f832165
--- /dev/null
+++ b/.config
-@@ -0,0 +1,2285 @@
+@@ -0,0 +1,2296 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# OpenWrt Configuration
@@ -326,7 +326,7 @@ index 0000000..00fed37
+CONFIG_VERSION_DIST="OpenWrt"
+CONFIG_VERSION_NICK=""
+CONFIG_VERSION_NUMBER=""
-+CONFIG_VERSION_REPO="http://openwrt.panaceas.org/repos/tl-c516w/%v/%T/packages"
++CONFIG_VERSION_REPO="http://openwrt.panaceas.org/repos/tp-c516w/%v/%T/packages"
+CONFIG_VERSION_MANUFACTURER=""
+CONFIG_VERSION_PRODUCT=""
+CONFIG_VERSION_HWREV=""
@@ -1418,6 +1418,7 @@ index 0000000..00fed37
+#
+# CONFIG_PACKAGE_kmod-i2c-core is not set
+# CONFIG_PACKAGE_kmod-i2c-gpio-custom is not set
++CONFIG_PACKAGE_kmod-kkmoon-motors=y
+
+#
+# Input modules
@@ -1680,7 +1681,13 @@ index 0000000..00fed37
+#
+# Sound Support
+#
-+# CONFIG_PACKAGE_kmod-sound-core is not set
++CONFIG_PACKAGE_kmod-sound-core=m
++# CONFIG_PACKAGE_kmod-ac97 is not set
++# CONFIG_PACKAGE_kmod-sound-i8x0 is not set
++# CONFIG_PACKAGE_kmod-sound-seq is not set
++# CONFIG_PACKAGE_kmod-sound-soc-ac97 is not set
++# CONFIG_PACKAGE_kmod-sound-soc-core is not set
++CONFIG_PACKAGE_kmod-usb-audio=m
+
+#
+# USB Support
@@ -1822,6 +1829,7 @@ index 0000000..00fed37
+# CONFIG_OPENSSL_WITH_SSL3 is not set
+# CONFIG_OPENSSL_ENGINE_CRYPTO is not set
+# CONFIG_PACKAGE_libpolarssl is not set
++CONFIG_PACKAGE_alsa-lib=m
+# CONFIG_PACKAGE_argp-standalone is not set
+# CONFIG_PACKAGE_libavahi-client is not set
+# CONFIG_PACKAGE_libavahi-compat-libdnssd is not set
@@ -1857,7 +1865,7 @@ index 0000000..00fed37
+CONFIG_PACKAGE_liblzo=y
+# CONFIG_PACKAGE_libmnl is not set
+# CONFIG_PACKAGE_libmount is not set
-+# CONFIG_PACKAGE_libncurses is not set
++CONFIG_PACKAGE_libncurses=m
+# CONFIG_PACKAGE_libncursesw is not set
+# CONFIG_PACKAGE_libnetfilter-conntrack is not set
+# CONFIG_PACKAGE_libnetfilter-cthelper is not set
@@ -1889,7 +1897,7 @@ index 0000000..00fed37
+CONFIG_PACKAGE_libuci=y
+# CONFIG_PACKAGE_libuci-lua is not set
+# CONFIG_PACKAGE_libuclient is not set
-+# CONFIG_PACKAGE_libusb-1.0 is not set
++CONFIG_PACKAGE_libusb-1.0=m
+# CONFIG_PACKAGE_libusb-compat is not set
+# CONFIG_PACKAGE_libustream-cyassl is not set
+# CONFIG_PACKAGE_libustream-openssl is not set
@@ -1897,7 +1905,7 @@ index 0000000..00fed37
+# CONFIG_PACKAGE_libuuid is not set
+CONFIG_PACKAGE_libv4l=y
+# CONFIG_PACKAGE_linux-atm is not set
-+# CONFIG_PACKAGE_terminfo is not set
++CONFIG_PACKAGE_terminfo=m
+CONFIG_PACKAGE_uclibcxx=y
+CONFIG_PACKAGE_zlib=y
+
@@ -2245,6 +2253,9 @@ index 0000000..00fed37
+# CONFIG_PACKAGE_sfdisk is not set
+# CONFIG_PACKAGE_swap-utils is not set
+# CONFIG_PACKAGE_wipefs is not set
++CONFIG_PACKAGE_alsa-utils=m
++# CONFIG_PACKAGE_alsa-utils-seq is not set
++# CONFIG_PACKAGE_alsa-utils-tests is not set
+# CONFIG_PACKAGE_cal is not set
+# CONFIG_PACKAGE_comgt is not set
+# CONFIG_PACKAGE_comgt-directip is not set
@@ -2284,7 +2295,7 @@ index 0000000..00fed37
+# CONFIG_PACKAGE_ugps is not set
+# CONFIG_PACKAGE_usb-modeswitch is not set
+# CONFIG_PACKAGE_usbreset is not set
-+# CONFIG_PACKAGE_usbutils is not set
++CONFIG_PACKAGE_usbutils=m
+# CONFIG_PACKAGE_uuidd is not set
+# CONFIG_PACKAGE_uuidgen is not set
+CONFIG_PACKAGE_v4l-utils=y
diff --git a/master/feeds-install b/master/feeds-install
new file mode 100644
index 0000000..2e8fee2
--- /dev/null
+++ b/master/feeds-install
@@ -0,0 +1,128 @@
+diff --git a/package/feeds/packages/acl b/package/feeds/packages/acl
+new file mode 120000
+index 0000000..97f7175
+--- /dev/null
++++ b/package/feeds/packages/acl
+@@ -0,0 +1 @@
++../../../feeds/packages/utils/acl
+\ No newline at end of file
+diff --git a/package/feeds/packages/alsa-lib b/package/feeds/packages/alsa-lib
+new file mode 120000
+index 0000000..3131d28
+--- /dev/null
++++ b/package/feeds/packages/alsa-lib
+@@ -0,0 +1 @@
++../../../feeds/packages/libs/alsa-lib
+\ No newline at end of file
+diff --git a/package/feeds/packages/alsa-utils b/package/feeds/packages/alsa-utils
+new file mode 120000
+index 0000000..705018a
+--- /dev/null
++++ b/package/feeds/packages/alsa-utils
+@@ -0,0 +1 @@
++../../../feeds/packages/utils/alsa-utils
+\ No newline at end of file
+diff --git a/package/feeds/packages/attr b/package/feeds/packages/attr
+new file mode 120000
+index 0000000..4e5515f
+--- /dev/null
++++ b/package/feeds/packages/attr
+@@ -0,0 +1 @@
++../../../feeds/packages/utils/attr
+\ No newline at end of file
+diff --git a/package/feeds/packages/avahi b/package/feeds/packages/avahi
+new file mode 120000
+index 0000000..d93c301
+--- /dev/null
++++ b/package/feeds/packages/avahi
+@@ -0,0 +1 @@
++../../../feeds/packages/libs/avahi
+\ No newline at end of file
+diff --git a/package/feeds/packages/dbus b/package/feeds/packages/dbus
+new file mode 120000
+index 0000000..1a260eb
+--- /dev/null
++++ b/package/feeds/packages/dbus
+@@ -0,0 +1 @@
++../../../feeds/packages/utils/dbus
+\ No newline at end of file
+diff --git a/package/feeds/packages/expat b/package/feeds/packages/expat
+new file mode 120000
+index 0000000..9adec05
+--- /dev/null
++++ b/package/feeds/packages/expat
+@@ -0,0 +1 @@
++../../../feeds/packages/libs/expat
+\ No newline at end of file
+diff --git a/package/feeds/packages/gdbm b/package/feeds/packages/gdbm
+new file mode 120000
+index 0000000..2a7a5d4
+--- /dev/null
++++ b/package/feeds/packages/gdbm
+@@ -0,0 +1 @@
++../../../feeds/packages/libs/gdbm
+\ No newline at end of file
+diff --git a/package/feeds/packages/intltool b/package/feeds/packages/intltool
+new file mode 120000
+index 0000000..cb74bd9
+--- /dev/null
++++ b/package/feeds/packages/intltool
+@@ -0,0 +1 @@
++../../../feeds/packages/libs/intltool
+\ No newline at end of file
+diff --git a/package/feeds/packages/libdaemon b/package/feeds/packages/libdaemon
+new file mode 120000
+index 0000000..ab7c4ae
+--- /dev/null
++++ b/package/feeds/packages/libdaemon
+@@ -0,0 +1 @@
++../../../feeds/packages/libs/libdaemon
+\ No newline at end of file
+diff --git a/package/feeds/packages/libjpeg b/package/feeds/packages/libjpeg
+new file mode 120000
+index 0000000..78a7001
+--- /dev/null
++++ b/package/feeds/packages/libjpeg
+@@ -0,0 +1 @@
++../../../feeds/packages/libs/libjpeg
+\ No newline at end of file
+diff --git a/package/feeds/packages/libpam b/package/feeds/packages/libpam
+new file mode 120000
+index 0000000..4da727f
+--- /dev/null
++++ b/package/feeds/packages/libpam
+@@ -0,0 +1 @@
++../../../feeds/packages/libs/libpam
+\ No newline at end of file
+diff --git a/package/feeds/packages/libv4l b/package/feeds/packages/libv4l
+new file mode 120000
+index 0000000..6df6cfd
+--- /dev/null
++++ b/package/feeds/packages/libv4l
+@@ -0,0 +1 @@
++../../../feeds/packages/libs/libv4l
+\ No newline at end of file
+diff --git a/package/feeds/packages/mjpg-streamer b/package/feeds/packages/mjpg-streamer
+new file mode 120000
+index 0000000..d86b707
+--- /dev/null
++++ b/package/feeds/packages/mjpg-streamer
+@@ -0,0 +1 @@
++../../../feeds/packages/multimedia/mjpg-streamer
+\ No newline at end of file
+diff --git a/package/feeds/packages/openssh b/package/feeds/packages/openssh
+new file mode 120000
+index 0000000..36e2e92
+--- /dev/null
++++ b/package/feeds/packages/openssh
+@@ -0,0 +1 @@
++../../../feeds/packages/net/openssh
+\ No newline at end of file
+diff --git a/package/feeds/packages/rsync b/package/feeds/packages/rsync
+new file mode 120000
+index 0000000..02f1d7d
+--- /dev/null
++++ b/package/feeds/packages/rsync
+@@ -0,0 +1 @@
++../../../feeds/packages/net/rsync
+\ No newline at end of file
diff --git a/master/kkmoon b/master/kkmoon
index 92b5937..e0ee885 100644
--- a/master/kkmoon
+++ b/master/kkmoon
@@ -10,6 +10,45 @@ index 75cccae..e87014f 100755
w150m|\
wnce2001|\
zte-q7)
+diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
+index 7fc6f29..3b2d04c 100644
+--- a/target/linux/ramips/base-files/etc/diag.sh
++++ b/target/linux/ramips/base-files/etc/diag.sh
+@@ -173,6 +173,9 @@ get_status_led() {
+ wsr-600)
+ status_led="$board:orange:diag"
+ ;;
++ tp-c516w)
++ status_led="$board:green:camera"
++ ;;
+ esac
+ }
+
+diff --git a/target/linux/ramips/base-files/etc/uci-defaults/01_leds b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
+new file mode 100644
+index 0000000..9a43eba
+--- /dev/null
++++ b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
+@@ -0,0 +1,19 @@
++#!/bin/sh
++#
++# Copyright (C) 2011 OpenWrt.org
++#
++
++. /lib/functions/uci-defaults.sh
++. /lib/ramips.sh
++
++board=$(ramips_board_name)
++
++case "$board" in
++tp-c516w)
++ ucidef_set_led_netdev "lan" "LAN" "$board:orange:ethernet" "eth0"
++ ;;
++esac
++
++ucidef_commit_leds
++
++exit 0
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index d242235..3261cef 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
@@ -24,27 +63,6 @@ index d242235..3261cef 100755
*"NW718")
name="nw718"
;;
-diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
-index c24d220..ffff29f 100644
---- a/target/linux/ramips/image/Makefile
-+++ b/target/linux/ramips/image/Makefile
-@@ -193,6 +193,7 @@ BuildFirmware/Default4M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(
- # $(4) = uImage header name field
- ralink_default_fw_size_8M=8060928
- BuildFirmware/Default8M/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_8M),$(4))
-+BuildFirmware/Default8M/jffs2=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_8M),$(4))
- BuildFirmware/Default8M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3),$(4))
- BuildFirmware/Tplink/squashfs=$(call BuildFirmware/OF/tplink,$(1),$(2),$(3),$(4))
- BuildFirmware/Tplink/initramfs=$(call BuildFirmware/OF/tplink/initramfs,$(1),$(2),$(3),$(4))
-@@ -569,6 +570,8 @@ Image/Build/Profile/MZKW300NH2=$(call BuildFirmware/Edimax/$(1),$(1),mzk-w300nh2
-
- Image/Build/Profile/NCS601W=$(call BuildFirmware/Default8M/$(1),$(1),ncs601W,NCS601W)
-
-+Image/Build/Profile/TP-C516W=$(call BuildFirmware/Default8M/$(1),$(1),tp-c516w,TP-C516W)
-+
- nw718_mtd_size=3801088
- Image/Build/Profile/NW718=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),nw718m,NW718,$(nw718_mtd_size),ARA1B4NCRNW718;1,factory)
-
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 2f6c624..059aae2 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -58,8 +76,205 @@ index 2f6c624..059aae2 100755
3g300m|\
3g-6200n|\
3g-6200nl|\
+diff --git a/target/linux/ramips/dts/TP-C516W-16M.dts b/target/linux/ramips/dts/TP-C516W-16M.dts
+new file mode 100644
+index 0000000..61c1b23
+--- /dev/null
++++ b/target/linux/ramips/dts/TP-C516W-16M.dts
+@@ -0,0 +1,49 @@
++/dts-v1/;
++
++/include/ "rt5350.dtsi"
++
++/ {
++ compatible = "TP-C516W", "ralink,rt5350-soc";
++ model = "KKMoon TP-C516W";
++
++ palmbus@10000000 {
++ spi@b00 {
++ status = "okay";
++
++ m25p80@0 {
++ #address-cells = <1>;
++ #size-cells = <1>;
++ compatible = "s25sl12801";
++ reg = <0 0>;
++ linux,modalias = "m25p80", "s25sl12801";
++ spi-max-frequency = <10000000>;
++
++ partition@0 {
++ label = "u-boot";
++ reg = <0x0 0x30000>;
++ read-only;
++ };
++
++ partition@30000 {
++ label = "u-boot-env";
++ reg = <0x30000 0x10000>;
++ read-only;
++ };
++
++ factory: partition@40000 {
++ label = "factory";
++ reg = <0x40000 0x10000>;
++ read-only;
++ };
++
++ partition@50000 {
++ label = "firmware";
++ reg = <0x50000 0xfb0000>;
++ };
++ };
++ };
++ };
++
++/include/ "TP-C516W-common.dtsi"
++
++};
+diff --git a/target/linux/ramips/dts/TP-C516W-8M.dts b/target/linux/ramips/dts/TP-C516W-8M.dts
+new file mode 100644
+index 0000000..d80b4d4
+--- /dev/null
++++ b/target/linux/ramips/dts/TP-C516W-8M.dts
+@@ -0,0 +1,49 @@
++/dts-v1/;
++
++/include/ "rt5350.dtsi"
++
++/ {
++ compatible = "TP-C516W", "ralink,rt5350-soc";
++ model = "KKMoon TP-C516W";
++
++ palmbus@10000000 {
++ spi@b00 {
++ status = "okay";
++
++ m25p80@0 {
++ #address-cells = <1>;
++ #size-cells = <1>;
++ compatible = "s25fl064k";
++ reg = <0 0>;
++ linux,modalias = "m25p80", "s25fl064k";
++ spi-max-frequency = <10000000>;
++
++ partition@0 {
++ label = "u-boot";
++ reg = <0x0 0x30000>;
++ read-only;
++ };
++
++ partition@30000 {
++ label = "u-boot-env";
++ reg = <0x30000 0x10000>;
++ read-only;
++ };
++
++ factory: partition@40000 {
++ label = "factory";
++ reg = <0x40000 0x10000>;
++ read-only;
++ };
++
++ partition@50000 {
++ label = "firmware";
++ reg = <0x50000 0x7b0000>;
++ };
++ };
++ };
++ };
++
++
++/include/ "TP-C516W-common.dtsi"
++};
+diff --git a/target/linux/ramips/dts/TP-C516W-common.dtsi b/target/linux/ramips/dts/TP-C516W-common.dtsi
+new file mode 100644
+index 0000000..675f83a
+--- /dev/null
++++ b/target/linux/ramips/dts/TP-C516W-common.dtsi
+@@ -0,0 +1,81 @@
++/*Common definitions for TP-C516W */
++
++ palmbus@10000000 {
++ gpio1: gpio@660 {
++ status = "ok";
++ };
++
++ spi@b00 {
++ pinctrl-names = "default";
++ pinctrl-0 = <&spi_pins>;
++ };
++
++ };
++
++ pinctrl {
++ state_default: pinctrl0 {
++ gpio {
++ ralink,group = "jtag", "rgmii", "mdio", "led", "spi_cs1", "uartf";
++ ralink,function = "gpio";
++ };
++ };
++ };
++
++ gpio-leds {
++ compatible = "gpio-leds";
++
++ camera {
++ label = "tp-c516w:green:camera";
++ gpios = <&gpio0 12 0>;
++ };
++
++ wifi {
++ label = "tp-c516w:orange:ethernet";
++ gpios = <&gpio0 13 1>;
++ };
++
++ alarm_out {
++ label = "tp-c516w::alarm_out";
++ gpios = <&gpio1 5 0>;
++ };
++ };
++
++ gpio-keys-polled {
++ compatible = "gpio-keys-polled";
++ #address-cells = <1>;
++ #size-cells = <0>;
++ poll-interval = <20>;
++
++
++ reset {
++ label = "reset";
++ gpios = <&gpio0 0 1>;
++ linux,code = <0x198>;
++ };
++
++ alarm_in {
++ label = "alarm_in";
++ gpios = <&gpio0 21 0>;
++ };
++ };
++
++
++ ethernet@10100000 {
++ mtd-mac-address = <&factory 0x4>;
++ };
++
++ esw@10110000 {
++ ralink,portmap = <0x2f>;
++ };
++
++ wmac@10180000 {
++ ralink,mtd-eeprom = <&factory 0>;
++ };
++
++ ehci@101c0000 {
++ status = "okay";
++ };
++
++ ohci@101c1000 {
++ status = "okay";
++ };
diff --git a/target/linux/ramips/dts/rt5350.dtsi b/target/linux/ramips/dts/rt5350.dtsi
-index 5282e5b..208a962 100644
+index 5282e5b..22d0e36 100644
--- a/target/linux/ramips/dts/rt5350.dtsi
+++ b/target/linux/ramips/dts/rt5350.dtsi
@@ -119,6 +119,9 @@
@@ -72,73 +287,104 @@ index 5282e5b..208a962 100644
interrupt-parent = <&intc>;
interrupts = <6>;
-@@ -131,7 +134,7 @@
- 10 14 18 1c
- 20 24 ];
-
-- status = "disabled";
-+ /*status = "disabled";*/
+@@ -135,7 +138,7 @@
};
i2c@900 {
-@@ -165,6 +168,7 @@
+- compatible = "link,rt5350-i2c", "ralink,rt2880-i2c";
++ compatible = "ralink,rt5350-i2c", "ralink,rt2880-i2c";
+ reg = <0x900 0x100>;
+ resets = <&rstctrl 16>;
+@@ -150,6 +153,16 @@
status = "disabled";
};
-+
- uartlite@c00 {
- compatible = "ralink,rt5350-uart", "ralink,rt2880-uart", "ns16550a";
-@@ -189,6 +193,16 @@
++ i2s@a00 {
++ compatible = "ralink,rt5350-i2s";
++ reg = <0xa00 0x28>;
++
++ resets = <&rstctrl 17>;
++ reset-names = "i2s";
++
++ status = "disabled";
++ };
++
+ spi@b00 {
+ compatible = "ralink,rt5350-spi";
+ reg = <0xb00 0x100>;
+@@ -189,6 +202,9 @@
interrupt-parent = <&cpuintc>;
interrupts = <7>;
};
+
+
-+ /* phydummy {
-+ compatible = "ralink,phydummy";
-+
-+ pinctrl-names = "default";
-+ pinctrl-0 = <&led_pins>;
-+
-+ }; */
+
};
pinctrl {
-@@ -214,13 +228,6 @@
+@@ -214,8 +230,8 @@
};
};
- phy_led_pins: phy_led {
- phy_led {
-- ralink,group = "led";
-- ralink,function = "led";
-- };
-- };
--
- uartlite_pins: uartlite {
- uart {
- ralink,group = "uartlite";
-@@ -241,6 +248,13 @@
++ led_pins: led {
++ led {
+ ralink,group = "led";
+ ralink,function = "led";
+ };
+@@ -241,6 +257,7 @@
ralink,function = "spi_cs1";
};
};
+
-+ led_pins: phy_led {
-+ phy_led {
-+ ralink,group = "led";
-+ ralink,function = "led";
-+ };
-+ };
};
rstctrl: rstctrl {
+@@ -309,4 +326,11 @@
+ interrupt-parent = <&intc>;
+ interrupts = <18>;
+ };
++
++ ephy {
++ compatible = "ralink,ephy";
++
++ pinctrl-names = "default";
++ pinctrl-0 = <&led_pins>;
++ };
+ };
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
-index ffff29f..2400261 100644
+index c24d220..c8c2cc1 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
-@@ -745,6 +745,7 @@ define Image/Build/Profile/Default
+@@ -193,6 +193,7 @@ BuildFirmware/Default4M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(
+ # $(4) = uImage header name field
+ ralink_default_fw_size_8M=8060928
+ BuildFirmware/Default8M/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_8M),$(4))
++BuildFirmware/Default8M/jffs2=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_8M),$(4))
+ BuildFirmware/Default8M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3),$(4))
+ BuildFirmware/Tplink/squashfs=$(call BuildFirmware/OF/tplink,$(1),$(2),$(3),$(4))
+ BuildFirmware/Tplink/initramfs=$(call BuildFirmware/OF/tplink/initramfs,$(1),$(2),$(3),$(4))
+@@ -569,6 +570,17 @@ Image/Build/Profile/MZKW300NH2=$(call BuildFirmware/Edimax/$(1),$(1),mzk-w300nh2
+
+ Image/Build/Profile/NCS601W=$(call BuildFirmware/Default8M/$(1),$(1),ncs601W,NCS601W)
+
++define BuildFirmware/TP-C516W/squashfs
++ $(call BuildFirmware/Default8M/$(1),$(1),$(2)-8M,$(3)-8M)
++ $(call BuildFirmware/Default16M/$(1),$(1),$(2)-16M,$(3)-16M)
++endef
++define BuildFirmware/TP-C516W/initramfs
++ $(call BuildFirmware/OF/initramfs,$(1),$(2)-8M,$(3)-8M)
++ $(call BuildFirmware/OF/initramfs,$(1),$(2)-16M,$(3)-16M)
++endef
++
++Image/Build/Profile/TP-C516W=$(call BuildFirmware/TP-C516W/$(1),$(1),tp-c516w,TP-C516W)
++
+ nw718_mtd_size=3801088
+ Image/Build/Profile/NW718=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),nw718m,NW718,$(nw718_mtd_size),ARA1B4NCRNW718;1,factory)
+
+@@ -742,6 +754,7 @@ define Image/Build/Profile/Default
$(call Image/Build/Profile/MZKW300NH2,$(1))
$(call Image/Build/Profile/NBG-419N,$(1))
$(call Image/Build/Profile/NCS601W,$(1))
@@ -146,3 +392,73 @@ index ffff29f..2400261 100644
$(call Image/Build/Profile/NW718,$(1))
$(call Image/Build/Profile/MINIEMBWIFI,$(1))
$(call Image/Build/Profile/MINIEMBPLUG,$(1))
+diff --git a/target/linux/ramips/patches-3.18/9997-alarm-out.patch b/target/linux/ramips/patches-3.18/9997-alarm-out.patch
+new file mode 100644
+index 0000000..64fb4fc
+--- /dev/null
++++ b/target/linux/ramips/patches-3.18/9997-alarm-out.patch
+@@ -0,0 +1,16 @@
++Index: linux-3.18.21/drivers/pinctrl/pinctrl-rt2880.c
++===================================================================
++--- linux-3.18.21.orig/drivers/pinctrl/pinctrl-rt2880.c
+++++ linux-3.18.21/drivers/pinctrl/pinctrl-rt2880.c
++@@ -372,6 +372,11 @@ static int rt2880_pinmux_pins(struct rt2
++ /* pin 0 is always a gpio */
++ p->gpio[0] = 1;
++
+++ /* ditto pin 27 as we don't have a driver to represent spi_cs1
+++ * so we can't get pinmux to export them otherwise */
+++
+++ p->gpio[27] = 1;
+++
++ /* set the pads */
++ for (i = 0; i < p->max_pins; i++) {
++ /* strlen("ioXY") + 1 = 5 */
+diff --git a/target/linux/ramips/patches-3.18/9997-rt5350-pinmux.patch b/target/linux/ramips/patches-3.18/9997-rt5350-pinmux.patch
+new file mode 100644
+index 0000000..d02829c
+--- /dev/null
++++ b/target/linux/ramips/patches-3.18/9997-rt5350-pinmux.patch
+@@ -0,0 +1,18 @@
++Index: linux-3.18.21/arch/mips/ralink/rt305x.c
++===================================================================
++--- linux-3.18.21.orig/arch/mips/ralink/rt305x.c
+++++ linux-3.18.21/arch/mips/ralink/rt305x.c
++@@ -35,7 +35,12 @@ static struct rt2880_pmx_func uartf_func
++ static struct rt2880_pmx_func uartlite_func[] = { FUNC("uartlite", 0, 15, 2) };
++ static struct rt2880_pmx_func jtag_func[] = { FUNC("jtag", 0, 17, 5) };
++ static struct rt2880_pmx_func mdio_func[] = { FUNC("mdio", 0, 22, 2) };
++-static struct rt2880_pmx_func rt5350_led_func[] = { FUNC("led", 0, 22, 5) };
+++static struct rt2880_pmx_func rt5350_led_func[] = {
+++ FUNC("led", 0, 22, 5) ,
+++ FUNC("gpio", 1, 22, 5) ,
+++ FUNC("btmode", 2, 22, 5),
+++};
+++
++ static struct rt2880_pmx_func rt5350_cs1_func[] = {
++ FUNC("spi_cs1", 0, 27, 1),
++ FUNC("wdg_cs1", 1, 27, 1),
+diff --git a/target/linux/ramips/rt305x/profiles/kkmoon.mk b/target/linux/ramips/rt305x/profiles/kkmoon.mk
+new file mode 100644
+index 0000000..65ed584
+--- /dev/null
++++ b/target/linux/ramips/rt305x/profiles/kkmoon.mk
+@@ -0,0 +1,18 @@
++#
++# Copyright (C) 2014 OpenWrt.org
++#
++# This is free software, licensed under the GNU General Public License v2.
++# See /LICENSE for more information.
++#
++
++define Profile/TP-C516W
++ NAME:=KKMoon TP-C516W
++ PACKAGES:=kmod-video-core kmod-video-uvc \
++ kmod-usb-core kmod-usb-ohci \
++ mjg-streamer
++endef
++
++define Profile/TP-C516W/Description
++ Package set for KKMoon TP-C516W board
++endef
++$(eval $(call Profile,TP-C516W))
diff --git a/master/motors b/master/motors
index 12cfa5a..9a9851d 100644
--- a/master/motors
+++ b/master/motors
@@ -25,7 +25,7 @@ index 06630d4..ea83303 100644
diff --git a/feeds/packages/multimedia/mjpg-streamer/patches/999-motors.patch b/feeds/packages/multimedia/mjpg-streamer/patches/999-motors.patch
new file mode 100644
-index 0000000..5ffdc58
+index 0000000..0ae4b63
--- /dev/null
+++ b/feeds/packages/multimedia/mjpg-streamer/patches/999-motors.patch
@@ -0,0 +1,906 @@
@@ -935,12 +935,38 @@ index 0000000..5ffdc58
++ -webkit-transform: rotate(180deg);
++}
++
+diff --git a/target/linux/ramips/modules.mk b/target/linux/ramips/modules.mk
+index 503a1e5..673fa61 100644
+--- a/target/linux/ramips/modules.mk
++++ b/target/linux/ramips/modules.mk
+@@ -21,6 +21,21 @@ endef
+
+ $(eval $(call KernelPackage,sdhci-mt7620))
+
++KKMOON_MOTORS_MODULES:= \
++ CONFIG_KKMOON_MOTORS:drivers/misc/kkmoon-motors
++
++define KernelPackage/kkmoon-motors
++ $(call i2c_defaults,$(KKMOON_MOTORS_MODULES),59)
++ TITLE:=KKMoon motors
++ DEPENDS:=@TARGET_ramips
++endef
++
++define KernelPackage/kkmoon-motors/description
++ Kernel module for stepper motors on kkmoon camrea
++endef
++
++$(eval $(call KernelPackage,kkmoon-motors))
++
+ I2C_RALINK_MODULES:= \
+ CONFIG_I2C_RALINK:drivers/i2c/busses/i2c-ralink
+
diff --git a/target/linux/ramips/patches-3.18/9999-kkmoon-motors.patch b/target/linux/ramips/patches-3.18/9999-kkmoon-motors.patch
new file mode 100644
-index 0000000..2266282
+index 0000000..54e9dc3
--- /dev/null
+++ b/target/linux/ramips/patches-3.18/9999-kkmoon-motors.patch
-@@ -0,0 +1,284 @@
+@@ -0,0 +1,277 @@
+Index: linux-3.18.21/drivers/misc/Kconfig
+===================================================================
+--- linux-3.18.21.orig/drivers/misc/Kconfig
@@ -972,7 +998,7 @@ index 0000000..2266282
+===================================================================
+--- /dev/null
++++ linux-3.18.21/drivers/misc/kkmoon-motors.c
-+@@ -0,0 +1,235 @@
++@@ -0,0 +1,245 @@
++#include <linux/init.h>
++#include <linux/module.h>
++#include <linux/kernel.h>
@@ -983,6 +1009,20 @@ index 0000000..2266282
++#include <linux/jiffies.h>
++#include <linux/sched.h>
++
+++ /* A fairly budget driver for some fairly budget hardware
+++ * 4 gpios are connected to a 74259 8 bit addressable latch
+++ * with the LE* pin tied low. The outputs of the latch feed
+++ * to a ULN2008 and thence to the motors.
+++ *
+++ * As we don't control LE, the best we can do is assert
+++ * exactly zero one, all-1 or all outputs of the latch.
+++ * So we're restricted to wave-driving the stepper motors
+++ *
+++ * The device surfaces as a misc char device to which
+++ * sending U D L R moves the turret by one step in those
+++ * directions.
+++ */
+++
++MODULE_LICENSE ("GPL");
++MODULE_AUTHOR ("James McKenzie");
++MODULE_DESCRIPTION ("KKMoon motor control");
@@ -1095,12 +1135,8 @@ index 0000000..2266282
++ while (count--)
++ {
++
-++#if 1
++ if (copy_from_user (&c, data++, 1))
++ return EFAULT;
-++#else
-++ printk("cfu=%d\n",(int) copy_from_user (&c, data++, 1));
-++#endif
++
++ switch (c)
++ {
@@ -1171,10 +1207,10 @@ index 0000000..2266282
++ gpio_request (GPIO_A2, "sysfs");
++ gpio_request (GPIO_D, "sysfs");
++
-++ gpio_export (GPIO_A0, false);
-++ gpio_export (GPIO_A1, false);
-++ gpio_export (GPIO_A2, false);
-++ gpio_export (GPIO_D, false);
+++ //gpio_export (GPIO_A0, false);
+++ //gpio_export (GPIO_A1, false);
+++ //gpio_export (GPIO_A2, false);
+++ //gpio_export (GPIO_D, false);
++
++ gpio_direction_output (GPIO_A0, 0);
++ gpio_direction_output (GPIO_A1, 0);
@@ -1193,10 +1229,10 @@ index 0000000..2266282
++
++ latch_off ();
++
-++ gpio_unexport (GPIO_D);
-++ gpio_unexport (GPIO_A2);
-++ gpio_unexport (GPIO_A1);
-++ gpio_unexport (GPIO_A0);
+++ //gpio_unexport (GPIO_D);
+++ //gpio_unexport (GPIO_A2);
+++ //gpio_unexport (GPIO_A1);
+++ //gpio_unexport (GPIO_A0);
++
++ gpio_free (GPIO_D);
++ gpio_free (GPIO_A2);
@@ -1208,29 +1244,17 @@ index 0000000..2266282
++
++module_init (motors_init);
++module_exit (motors_exit);
-+Index: linux-3.18.21/drivers/pinctrl/pinctrl-rt2880.c
-+===================================================================
-+--- linux-3.18.21.orig/drivers/pinctrl/pinctrl-rt2880.c
-++++ linux-3.18.21/drivers/pinctrl/pinctrl-rt2880.c
-+@@ -372,6 +372,12 @@ static int rt2880_pinmux_pins(struct rt2
-+ /* pin 0 is always a gpio */
-+ p->gpio[0] = 1;
-+
-++ /*ditto pins 22,23,24,and 26 as we don't have a driver to represent the phy*/
-++ p->gpio[22] = 1;
-++ p->gpio[23] = 1;
-++ p->gpio[24] = 1;
-++ p->gpio[26] = 1;
-++
-+ /* set the pads */
-+ for (i = 0; i < p->max_pins; i++) {
-+ /* strlen("ioXY") + 1 = 5 */
diff --git a/target/linux/ramips/rt305x/config-3.18 b/target/linux/ramips/rt305x/config-3.18
-index 9c03767..20b69ed 100644
+index 9c03767..7f48c28 100644
--- a/target/linux/ramips/rt305x/config-3.18
+++ b/target/linux/ramips/rt305x/config-3.18
-@@ -169,3 +169,4 @@ CONFIG_USB_SUPPORT=y
- CONFIG_USE_OF=y
- CONFIG_WATCHDOG_CORE=y
- CONFIG_ZONE_DMA_FLAG=0
-+CONFIG_KKMOON_MOTORS=y
+@@ -108,8 +108,8 @@ CONFIG_MODULES_USE_ELF_REL=y
+ CONFIG_MTD_CMDLINE_PARTS=y
+ CONFIG_MTD_M25P80=y
+ CONFIG_MTD_PHYSMAP=y
+-CONFIG_MTD_SPLIT_FIRMWARE=y
+ CONFIG_MTD_SPI_NOR=y
++CONFIG_MTD_SPLIT_FIRMWARE=y
+ CONFIG_MTD_SPLIT_UIMAGE_FW=y
+ CONFIG_NEED_DMA_MAP_STATE=y
+ CONFIG_NEED_PER_CPU_KM=y
diff --git a/master/series b/master/series
index e8ddeda..5109ded 100644
--- a/master/series
+++ b/master/series
@@ -1,6 +1,8 @@
feeds
+feeds-install
fix-mjpg-streamer-stack-smashing
kkmoon
motors
config
+audio
endstop