* [PATCH] IP22: Add platform device for Indy volume buttons
@ 2008-07-11 18:34 Thomas Bogendoerfer
2008-07-11 19:09 ` Geert Uytterhoeven
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Bogendoerfer @ 2008-07-11 18:34 UTC (permalink / raw)
To: linux-mips; +Cc: ralf
Create platform device for Indy volume buttons and remove button
handling from ip22-reset.c
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---
arch/mips/sgi-ip22/ip22-platform.c | 11 ++++++++
arch/mips/sgi-ip22/ip22-reset.c | 51 +----------------------------------
2 files changed, 13 insertions(+), 49 deletions(-)
diff --git a/arch/mips/sgi-ip22/ip22-platform.c b/arch/mips/sgi-ip22/ip22-platform.c
index d93d07a..c0eb360 100644
--- a/arch/mips/sgi-ip22/ip22-platform.c
+++ b/arch/mips/sgi-ip22/ip22-platform.c
@@ -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);
diff --git a/arch/mips/sgi-ip22/ip22-reset.c b/arch/mips/sgi-ip22/ip22-reset.c
index a435b31..4ad5c33 100644
--- a/arch/mips/sgi-ip22/ip22-reset.c
+++ b/arch/mips/sgi-ip22/ip22-reset.c
@@ -39,7 +39,7 @@
#define POWERDOWN_FREQ (HZ / 4)
#define PANIC_FREQ (HZ / 8)
-static struct timer_list power_timer, blink_timer, debounce_timer, volume_timer;
+static struct timer_list power_timer, blink_timer, debounce_timer;
#define MACHINE_PANICED 1
#define MACHINE_SHUTTING_DOWN 2
@@ -139,36 +139,6 @@ static inline void power_button(void)
add_timer(&power_timer);
}
-void (*indy_volume_button)(int) = NULL;
-
-EXPORT_SYMBOL(indy_volume_button);
-
-static inline void volume_up_button(unsigned long data)
-{
- del_timer(&volume_timer);
-
- if (indy_volume_button)
- indy_volume_button(1);
-
- if (sgint->istat1 & SGINT_ISTAT1_PWR) {
- volume_timer.expires = jiffies + (HZ / 100);
- add_timer(&volume_timer);
- }
-}
-
-static inline void volume_down_button(unsigned long data)
-{
- del_timer(&volume_timer);
-
- if (indy_volume_button)
- indy_volume_button(-1);
-
- if (sgint->istat1 & SGINT_ISTAT1_PWR) {
- volume_timer.expires = jiffies + (HZ / 100);
- add_timer(&volume_timer);
- }
-}
-
static irqreturn_t panel_int(int irq, void *dev_id)
{
unsigned int buttons;
@@ -190,25 +160,8 @@ static irqreturn_t panel_int(int irq, void *dev_id)
* House. Only lowest 2 bits are used. Guiness uses upper four bits
* for volume control". This is not true, all bits are pulled high
* on fullhouse */
- if (ip22_is_fullhouse() || !(buttons & SGIOC_PANEL_POWERINTR)) {
+ if (!(buttons & SGIOC_PANEL_POWERINTR))
power_button();
- return IRQ_HANDLED;
- }
- /* TODO: mute/unmute */
- /* Volume up button was pressed */
- if (!(buttons & SGIOC_PANEL_VOLUPINTR)) {
- init_timer(&volume_timer);
- volume_timer.function = volume_up_button;
- volume_timer.expires = jiffies + (HZ / 100);
- add_timer(&volume_timer);
- }
- /* Volume down button was pressed */
- if (!(buttons & SGIOC_PANEL_VOLDNINTR)) {
- init_timer(&volume_timer);
- volume_timer.function = volume_down_button;
- volume_timer.expires = jiffies + (HZ / 100);
- add_timer(&volume_timer);
- }
return IRQ_HANDLED;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] IP22: Add platform device for Indy volume buttons
2008-07-11 18:34 [PATCH] IP22: Add platform device for Indy volume buttons Thomas Bogendoerfer
@ 2008-07-11 19:09 ` Geert Uytterhoeven
2008-07-11 20:56 ` Thomas Bogendoerfer
0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2008-07-11 19:09 UTC (permalink / raw)
To: Thomas Bogendoerfer; +Cc: linux-mips, ralf
On Fri, 11 Jul 2008, Thomas Bogendoerfer wrote:
> --- a/arch/mips/sgi-ip22/ip22-platform.c
> +++ b/arch/mips/sgi-ip22/ip22-platform.c
> @@ -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));
^
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 -- geert@linux-m68k.org
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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] IP22: Add platform device for Indy volume buttons
2008-07-11 19:09 ` Geert Uytterhoeven
@ 2008-07-11 20:56 ` Thomas Bogendoerfer
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Bogendoerfer @ 2008-07-11 20:56 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linux-mips, ralf
On Fri, Jul 11, 2008 at 09:09:31PM +0200, Geert Uytterhoeven wrote:
> On Fri, 11 Jul 2008, Thomas Bogendoerfer wrote:
> > --- a/arch/mips/sgi-ip22/ip22-platform.c
> > +++ b/arch/mips/sgi-ip22/ip22-platform.c
> > @@ -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));
> ^
> 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.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-07-11 21:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-11 18:34 [PATCH] IP22: Add platform device for Indy volume buttons Thomas Bogendoerfer
2008-07-11 19:09 ` Geert Uytterhoeven
2008-07-11 20:56 ` Thomas Bogendoerfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox