aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches-3.10/313-MIPS-BCM63XX-remove-RUNTIME_DETECT-code-from-gpio.patch
diff options
context:
space:
mode:
authorJonas Gorski <jogo@openwrt.org>2014-01-13 12:13:05 +0000
committerJonas Gorski <jogo@openwrt.org>2014-01-13 12:13:05 +0000
commitd8ac24b325a8db1f88c2eeb359ea55e6e53259bb (patch)
tree81a585224a19a680d861a282d2bdec9355f28c4d /target/linux/brcm63xx/patches-3.10/313-MIPS-BCM63XX-remove-RUNTIME_DETECT-code-from-gpio.patch
parentd9a20b6f461c3be0278ab8e05c2338f7b232482f (diff)
downloadupstream-d8ac24b325a8db1f88c2eeb359ea55e6e53259bb.tar.gz
upstream-d8ac24b325a8db1f88c2eeb359ea55e6e53259bb.tar.bz2
upstream-d8ac24b325a8db1f88c2eeb359ea55e6e53259bb.zip
brcm63xx: update bmips patches with upstream submission
Update bmips cleanup patches with upstream submission and backport a few bmips fixes. Signed-off-by: Jonas Gorski <jogo@openwrt.org> SVN-Revision: 39267
Diffstat (limited to 'target/linux/brcm63xx/patches-3.10/313-MIPS-BCM63XX-remove-RUNTIME_DETECT-code-from-gpio.patch')
0 files changed, 0 insertions, 0 deletions
hlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
---
 arch/arm/mach-omap2/board-n8x0.c |   73 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

--- linux-2.6.36-rc5.orig/arch/arm/mach-omap2/board-n8x0.c
+++ linux-2.6.36-rc5/arch/arm/mach-omap2/board-n8x0.c
@@ -796,6 +796,77 @@ extern void n8x0_blizzard_init(void);
 
 extern void n8x0_usb_init(void);
 
+struct gpio_switch_input_dev {
+	struct input_dev *idev;
+	unsigned int swcode;
+};
+
+static struct gpio_switch_input_dev *slide_input;
+static struct gpio_switch_input_dev *kblock_input;
+
+static void n8x0_gpio_switch_input_notify(struct gpio_switch_input_dev *gdev,
+					  int state)
+{
+	if (gdev) {
+		input_report_switch(gdev->idev, gdev->swcode, state);
+		input_sync(gdev->idev);
+	}
+}
+
+static void n8x0_slide_notify(void *data, int state)
+{
+	n8x0_gpio_switch_input_notify(slide_input, state);
+}
+
+static void n8x0_kb_lock_notify(void *data, int state)
+{
+	n8x0_gpio_switch_input_notify(kblock_input, state);
+}
+
+static struct gpio_switch_input_dev * __init gpioswitch_input_init(
+			const char *name,
+			unsigned int swcode)
+{
+	struct gpio_switch_input_dev *gdev;
+	int err;
+
+	gdev = kzalloc(sizeof(*gdev), GFP_KERNEL);
+	if (!gdev)
+		goto error;
+	gdev->swcode = swcode;
+
+	gdev->idev = input_allocate_device();
+	if (!gdev->idev)
+		goto err_free;
+
+	gdev->idev->evbit[0] = BIT_MASK(EV_SW);
+	gdev->idev->swbit[BIT_WORD(swcode)] = BIT_MASK(swcode);
+	gdev->idev->name = name;
+
+	err = input_register_device(gdev->idev);
+	if (err)
+		goto err_free_idev;
+
+	return gdev;
+
+err_free_idev:
+	input_free_device(gdev->idev);
+err_free:
+	kfree(gdev);
+error:
+	return NULL;
+}
+
+static int __init n8x0_gpio_switches_input_init(void)
+{
+	slide_input = gpioswitch_input_init("slide", SW_KEYPAD_SLIDE);
+	kblock_input = gpioswitch_input_init("kb_lock", SW_LID);
+	if (WARN_ON(!slide_input || !kblock_input))
+		return -ENODEV;
+	return 0;
+}
+late_initcall(n8x0_gpio_switches_input_init);
+
 static struct omap_gpio_switch n8x0_gpio_switches[] __initdata = {
 	{
 		.name			= "headphone",
@@ -817,11 +888,13 @@ static struct omap_gpio_switch n8x0_gpio
 		.gpio			= -1,
 		.debounce_rising	= 200,
 		.debounce_falling	= 200,
+		.notify			= n8x0_slide_notify,
 	}, {
 		.name			= "kb_lock",
 		.gpio			= -1,
 		.debounce_rising	= 200,
 		.debounce_falling	= 200,
+		.notify			= n8x0_kb_lock_notify,
 	},
 };