aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2014-08-07 09:46:30 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-08-21 16:25:05 -0400
commit2e0cc7ee75a218ad43b112164e87acb03f0fd9f0 (patch)
tree5a743e619da7dbda022bf9b988cfc488d8c9a2a7
parentd84fdc774b3beea1a7c601ff6e8d22e6ac13dd01 (diff)
[media] au0828-input: Be sure that IR is enabled at polling
When the DVB code sets the frontend, it disables the IR INT, probably due to some hardware bug, as there's no code there at au8522 frontend that writes on register 0xe0. Fixing it at au8522 code is hard, as it doesn't know if the IR is enabled or disabled, and just restoring the value of register 0xe0 could cause other nasty effects. So, better to add a hack at au0828-input polling interval to enable int, if disabled. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/media/usb/au0828/au0828-input.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/media/usb/au0828/au0828-input.c b/drivers/media/usb/au0828/au0828-input.c
index 590f99d02c93..f0c5672e5f56 100644
--- a/drivers/media/usb/au0828/au0828-input.c
+++ b/drivers/media/usb/au0828/au0828-input.c
@@ -94,14 +94,19 @@ static int au8522_rc_read(struct au0828_rc *ir, u16 reg, int val,
94static int au8522_rc_andor(struct au0828_rc *ir, u16 reg, u8 mask, u8 value) 94static int au8522_rc_andor(struct au0828_rc *ir, u16 reg, u8 mask, u8 value)
95{ 95{
96 int rc; 96 int rc;
97 char buf; 97 char buf, oldbuf;
98 98
99 rc = au8522_rc_read(ir, reg, -1, &buf, 1); 99 rc = au8522_rc_read(ir, reg, -1, &buf, 1);
100 if (rc < 0) 100 if (rc < 0)
101 return rc; 101 return rc;
102 102
103 oldbuf = buf;
103 buf = (buf & ~mask) | (value & mask); 104 buf = (buf & ~mask) | (value & mask);
104 105
106 /* Nothing to do, just return */
107 if (buf == oldbuf)
108 return 0;
109
105 return au8522_rc_write(ir, reg, buf); 110 return au8522_rc_write(ir, reg, buf);
106} 111}
107 112
@@ -126,8 +131,11 @@ static int au0828_get_key_au8522(struct au0828_rc *ir)
126 131
127 /* Check IR int */ 132 /* Check IR int */
128 rc = au8522_rc_read(ir, 0xe1, -1, buf, 1); 133 rc = au8522_rc_read(ir, 0xe1, -1, buf, 1);
129 if (rc < 0 || !(buf[0] & (1 << 4))) 134 if (rc < 0 || !(buf[0] & (1 << 4))) {
135 /* Be sure that IR is enabled */
136 au8522_rc_set(ir, 0xe0, 1 << 4);
130 return 0; 137 return 0;
138 }
131 139
132 /* Something arrived. Get the data */ 140 /* Something arrived. Get the data */
133 rc = au8522_rc_read(ir, 0xe3, 0x11, buf, sizeof(buf)); 141 rc = au8522_rc_read(ir, 0xe3, 0x11, buf, sizeof(buf));