Commit dd3a5a1e authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab

[media] iguanair: explain tx carrier setup

Just comments. No functional changes.
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 123a17d1
...@@ -286,10 +286,10 @@ static int iguanair_receiver(struct iguanair *ir, bool enable) ...@@ -286,10 +286,10 @@ static int iguanair_receiver(struct iguanair *ir, bool enable)
} }
/* /*
* The iguana ir creates the carrier by busy spinning after each pulse or * The iguanair creates the carrier by busy spinning after each half period.
* space. This is counted in CPU cycles, with the CPU running at 24MHz. It is * This is counted in CPU cycles, with the CPU running at 24MHz. It is
* broken down into 7-cycles and 4-cyles delays, with a preference for * broken down into 7-cycles and 4-cyles delays, with a preference for
* 4-cycle delays. * 4-cycle delays, minus the overhead of the loop itself (cycle_overhead).
*/ */
static int iguanair_set_tx_carrier(struct rc_dev *dev, uint32_t carrier) static int iguanair_set_tx_carrier(struct rc_dev *dev, uint32_t carrier)
{ {
...@@ -316,7 +316,14 @@ static int iguanair_set_tx_carrier(struct rc_dev *dev, uint32_t carrier) ...@@ -316,7 +316,14 @@ static int iguanair_set_tx_carrier(struct rc_dev *dev, uint32_t carrier)
sevens = (4 - cycles) & 3; sevens = (4 - cycles) & 3;
fours = (cycles - sevens * 7) / 4; fours = (cycles - sevens * 7) / 4;
/* magic happens here */ /*
* The firmware interprets these values as a relative offset
* for a branch. Immediately following the branches, there
* 4 instructions of 7 cycles (2 bytes each) and 110
* instructions of 4 cycles (1 byte each). A relative branch
* of 0 will execute all of them, branch further for less
* cycle burning.
*/
ir->packet->busy7 = (4 - sevens) * 2; ir->packet->busy7 = (4 - sevens) * 2;
ir->packet->busy4 = 110 - fours; ir->packet->busy4 = 110 - fours;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment