public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
* IRQ3 seems to work now for SH7709
@ 2008-02-21 20:29 Kristoffer Ericson
  2008-02-22  8:30 ` Magnus Damm
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kristoffer Ericson @ 2008-02-21 20:29 UTC (permalink / raw)
  To: linux-sh

Greetings,

IRQ0->IRQ5 needs to be silenced by first setting priority 0 and then mask out the affected bit in IRR0. This was done previously in 2.6.17 in the ipr handler. This is also according to SH7709 manual.

This can be found inside 2.6.17 with linuxsh patches applied :

static void mask_and_ack_ipr(unsigned int irq)

  89 {
  90         disable_ipr_irq(irq);
  91 
  92 #if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \
  93     defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7705)
  94         /* This is needed when we use edge triggered setting */
  95         /* XXX: Is it really needed? */
  96         if (IRQ0_IRQ <= irq && irq <= IRQ5_IRQ) {
  97                 /* Clear external interrupt request */
  98                 int a = ctrl_inb(INTC_IRR0);
  99                 a &= ~(1 << (irq - IRQ0_IRQ));
 100                 ctrl_outb(a, INTC_IRR0);
 101         }
 102 #endif
 103 }

(you can access entire file at http://www.jlime.org/gitweb?p=jlime-stable.git;a=blob;f=arch/sh/kernel/cpu/irq/ipr.c;hå5150ed085619d5962e039e1ebb2a4fdc2e9b15;hb?3554525f5c300a6e41d0aae01673c45e9098c3)

I added minor code to intc_disable() just to test it

#ifdef CONFIG_CPU_SUBTYPE_SH7709
	if (irq = 35) {                <--- my touchscreen IRQ
		int a = inb(IRR0);
		a &= ~(1 << 3);
		outb(a, IRR0);
	}
#endif

And the result was that the interrupt no longer keeps feeding data instead only when touchscreen is actually touched, so seems valid.

Best wishes
Kristoffer

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-02-22 11:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-21 20:29 IRQ3 seems to work now for SH7709 Kristoffer Ericson
2008-02-22  8:30 ` Magnus Damm
2008-02-22  8:40 ` Magnus Damm
2008-02-22 11:47 ` Kristoffer Ericson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox