Skip to contentSkip to conversation

IP22: Add platform device for Indy volume buttons

PATCH Superseded Thomas Bogendoerfer 2 participants 3 messages Jul 11, 2008 MIPS

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Thomas Bogendoerfer

author maintainer
#0 lore raw

PATCH 1/1 IP22: Add platform device for Indy volume buttons

Create platform device for Indy volume buttons and remove button handling from ip22-reset.c

---

 arch/mips/sgi-ip22/ip22-platform.c |   11 ++++++++
 arch/mips/sgi-ip22/ip22-reset.c    |   51 +----------------------------------
 2 files changed, 13 insertions(+), 49 deletions(-)
arch/mips/sgi-ip22/ip22-platform.c +11 -0
index d93d07a..c0eb360 100644
@@ -182,3 +182,14 @@ static int __init sgi_hal2_devinit(void)
 }
 
 device_initcall(sgi_hal2_devinit);
+
+static int __init sgi_button_devinit(void)
+{
+	if (ip22_is_fullhouse())
+		return 0; /* full house has no volume buttons */
+
+	return IS_ERR(platform_device_register_simple("sgiindybtns",
+						      0, NULL, 0));
+}
+
+device_initcall(sgi_button_devinit);
arch/mips/sgi-ip22/ip22-reset.c +2 -49

70 lines not on this page · raw message

#1 lore raw
Quoted 4 lines · Thomas Bogendoerfer
arch/mips/sgi-ip22/ip22-platform.c +0 -0
@@ -182,3 +182,14 @@ static int __init sgi_hal2_devinit(void)
 }

arch/mips/sgi-ip22/ip22-platform.c static int __init sgi_hal2_devinit(void) · line 192

Quoted 10 lines
arch/mips/sgi-ip22/ip22-platform.c +8 -0
 
 device_initcall(sgi_hal2_devinit);
+
+static int __init sgi_button_devinit(void)
+{
+	if (ip22_is_fullhouse())
+		return 0; /* full house has no volume buttons */
+
+	return IS_ERR(platform_device_register_simple("sgiindybtns",
+						      0, NULL, 0));
                                                      ^

Shouldn't the instance id be -1, as there can be only one? (cfr. Documentation/driver-model/platform.txt)

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

author maintainer
#2 lore raw
Quoted 16 lines · Geert Uytterhoeven
Quoted 4 lines · Thomas Bogendoerfer
arch/mips/sgi-ip22/ip22-platform.c +0 -0
@@ -182,3 +182,14 @@ static int __init sgi_hal2_devinit(void)
 }

arch/mips/sgi-ip22/ip22-platform.c static int __init sgi_hal2_devinit(void) · line 192

Quoted 10 lines
arch/mips/sgi-ip22/ip22-platform.c +8 -0
 
 device_initcall(sgi_hal2_devinit);
+
+static int __init sgi_button_devinit(void)
+{
+	if (ip22_is_fullhouse())
+		return 0; /* full house has no volume buttons */
+
+	return IS_ERR(platform_device_register_simple("sgiindybtns",
+						      0, NULL, 0));
                                                      ^
Quoted 2 lines

Shouldn't the instance id be -1, as there can be only one? (cfr. Documentation/driver-model/platform.txt)

thanks. I'll send an updated patch asap.

Thomas.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]