aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2014-01-20 17:10:38 -0500
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-02-04 14:22:19 -0500
commitdd3a5a1e7a8723b137f2af7905db53f011fd7287 (patch)
tree8a8694c7c932d702225b168351ca7d9a56cd8a0e /drivers/media/rc
parent123a17d1427a2d7ad9142df1f6543c578864a0dd (diff)
[media] iguanair: explain tx carrier setup
Just comments. No functional changes. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r--drivers/media/rc/iguanair.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/media/rc/iguanair.c b/drivers/media/rc/iguanair.c
index fdae05c4f377..99a3a5a509e6 100644
--- a/drivers/media/rc/iguanair.c
+++ b/drivers/media/rc/iguanair.c
@@ -286,10 +286,10 @@ static int iguanair_receiver(struct iguanair *ir, bool enable)
286} 286}
287 287
288/* 288/*
289 * The iguana ir creates the carrier by busy spinning after each pulse or 289 * The iguanair creates the carrier by busy spinning after each half period.
290 * space. This is counted in CPU cycles, with the CPU running at 24MHz. It is 290 * This is counted in CPU cycles, with the CPU running at 24MHz. It is
291 * broken down into 7-cycles and 4-cyles delays, with a preference for 291 * broken down into 7-cycles and 4-cyles delays, with a preference for
292 * 4-cycle delays. 292 * 4-cycle delays, minus the overhead of the loop itself (cycle_overhead).
293 */ 293 */
294static int iguanair_set_tx_carrier(struct rc_dev *dev, uint32_t carrier) 294static int iguanair_set_tx_carrier(struct rc_dev *dev, uint32_t carrier)
295{ 295{
@@ -316,7 +316,14 @@ static int iguanair_set_tx_carrier(struct rc_dev *dev, uint32_t carrier)
316 sevens = (4 - cycles) & 3; 316 sevens = (4 - cycles) & 3;
317 fours = (cycles - sevens * 7) / 4; 317 fours = (cycles - sevens * 7) / 4;
318 318
319 /* magic happens here */ 319 /*
320 * The firmware interprets these values as a relative offset
321 * for a branch. Immediately following the branches, there
322 * 4 instructions of 7 cycles (2 bytes each) and 110
323 * instructions of 4 cycles (1 byte each). A relative branch
324 * of 0 will execute all of them, branch further for less
325 * cycle burning.
326 */
320 ir->packet->busy7 = (4 - sevens) * 2; 327 ir->packet->busy7 = (4 - sevens) * 2;
321 ir->packet->busy4 = 110 - fours; 328 ir->packet->busy4 = 110 - fours;
322 } 329 }