rt5677 gpio+irq questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

We work with Realtek on implementing IRQ support for rt5677 codec [1].
This IRQ is used to monitor MicJack/Headphone detection events.

I have two questions wrt irq/gpio library that I would like to clarify:

1) rt5677 has 3 IRQ sources (called jd1 jd2 jd3), each of these
sources can be enabled and assigned to a codecGPIO separately. Each
irq source also has "status" register that shows whether the gpio line
is asserted.

I am looking at regmap_irq{} structure and see it has field "mask". Do
I understand correctly that "mask" is used both to enable IRQ *and*
check IRQ status? Currently we set "mask" to "enable register" thus
handle_nested_irq() is called for *all enabled* irq sources. Would it
be better to have an additional field in regmap_irq{} that can also
specify "status" register, so handle_nested_irq() will be called for
asserted gpio only?


2) rt5677 chip irq is quite interesting as its irq output line value
is ORed values of irq inputs. i.e. IRQ_OUT == (JD1 | JD2 | JD3). And
here is the problem. Imaging we plugged micjack and headphone. Let's
assume these lines are assigned to JD1 and JD2. Both gpio lines became
high with some delay between the events. IRQ_OUT becomes high and chip
irq handler is called... for the first irq sources (e.g. jd1). A
moment later jd2 also becomes high but it does not affect IRQ_OUT and
these is no way for SoC to know that irq event happened in codec.

Realtek engineers suggested following idea: every time handler is
called for codec's gpio it reverts value of JDXinput sources (there is
a special register that inverts it). Thus IRQ_OUT goes down. Next
event will raise IRQ_OUT again and it also be inverted after handling
it.

Is it possible to do with current regmap-irq implementation?



[1] http://thread.gmane.org/gmane.linux.alsa.devel/128764
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux