summaryrefslogtreecommitdiffstats
path: root/master/motors
diff options
context:
space:
mode:
Diffstat (limited to 'master/motors')
-rw-r--r--master/motors102
1 files changed, 63 insertions, 39 deletions
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