diff options
author | Martin Bugge <marbugge@cisco.com> | 2013-12-10 09:14:26 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-01-07 03:22:12 -0500 |
commit | c9f1f271d4b6455d5ecf43e393668a7c8f4cb833 (patch) | |
tree | c570f31c2d5bee1db8d8525752f3c4dad2e1cb49 | |
parent | 6251e65f1ba6c1f4e461a1d97735812165c4499d (diff) |
[media] adv7842: properly enable/disable the irqs
The method of disabling the irq-output pin caused many "empty"
interrupts. Instead, actually disable/enable the interrupts by
changing the interrupt masks.
Also enable STORE_MASKED_IRQ in INT1 configuration, otherwise when HDMI
events happen while the interrupt is masked those events will be ignored
when the interrupt is unmasked.
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r-- | drivers/media/i2c/adv7842.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c index 6434a93e1416..cbbfa774079d 100644 --- a/drivers/media/i2c/adv7842.c +++ b/drivers/media/i2c/adv7842.c | |||
@@ -1786,10 +1786,8 @@ static int adv7842_isr(struct v4l2_subdev *sd, u32 status, bool *handled) | |||
1786 | struct adv7842_state *state = to_state(sd); | 1786 | struct adv7842_state *state = to_state(sd); |
1787 | u8 fmt_change_cp, fmt_change_digital, fmt_change_sdp; | 1787 | u8 fmt_change_cp, fmt_change_digital, fmt_change_sdp; |
1788 | u8 irq_status[5]; | 1788 | u8 irq_status[5]; |
1789 | u8 irq_cfg = io_read(sd, 0x40); | ||
1790 | 1789 | ||
1791 | /* disable irq-pin output */ | 1790 | adv7842_irq_enable(sd, false); |
1792 | io_write(sd, 0x40, irq_cfg | 0x3); | ||
1793 | 1791 | ||
1794 | /* read status */ | 1792 | /* read status */ |
1795 | irq_status[0] = io_read(sd, 0x43); | 1793 | irq_status[0] = io_read(sd, 0x43); |
@@ -1810,6 +1808,8 @@ static int adv7842_isr(struct v4l2_subdev *sd, u32 status, bool *handled) | |||
1810 | if (irq_status[4]) | 1808 | if (irq_status[4]) |
1811 | io_write(sd, 0x9e, irq_status[4]); | 1809 | io_write(sd, 0x9e, irq_status[4]); |
1812 | 1810 | ||
1811 | adv7842_irq_enable(sd, true); | ||
1812 | |||
1813 | v4l2_dbg(1, debug, sd, "%s: irq %x, %x, %x, %x, %x\n", __func__, | 1813 | v4l2_dbg(1, debug, sd, "%s: irq %x, %x, %x, %x, %x\n", __func__, |
1814 | irq_status[0], irq_status[1], irq_status[2], | 1814 | irq_status[0], irq_status[1], irq_status[2], |
1815 | irq_status[3], irq_status[4]); | 1815 | irq_status[3], irq_status[4]); |
@@ -1845,9 +1845,6 @@ static int adv7842_isr(struct v4l2_subdev *sd, u32 status, bool *handled) | |||
1845 | if (handled) | 1845 | if (handled) |
1846 | *handled = true; | 1846 | *handled = true; |
1847 | 1847 | ||
1848 | /* re-enable irq-pin output */ | ||
1849 | io_write(sd, 0x40, irq_cfg); | ||
1850 | |||
1851 | return 0; | 1848 | return 0; |
1852 | } | 1849 | } |
1853 | 1850 | ||
@@ -2446,7 +2443,7 @@ static int adv7842_core_init(struct v4l2_subdev *sd, | |||
2446 | io_write(sd, 0x33, 0x40); | 2443 | io_write(sd, 0x33, 0x40); |
2447 | 2444 | ||
2448 | /* interrupts */ | 2445 | /* interrupts */ |
2449 | io_write(sd, 0x40, 0xe2); /* Configure INT1 */ | 2446 | io_write(sd, 0x40, 0xf2); /* Configure INT1 */ |
2450 | 2447 | ||
2451 | adv7842_irq_enable(sd, true); | 2448 | adv7842_irq_enable(sd, true); |
2452 | 2449 | ||