On Fri, Mar 6, 2009 at 2:29 PM, Jon Smirl <jonsm...@gmail.com> wrote: > I'm using a GPT pin in input capture mode to implement IR. I attached > my GPT driver code. I can convert to your API. That's a really cheap > way to do IR, just IR sensor, resistor and a cap.
The driver I posted can't do input capture mode yet, but it shouldn't be too difficult to add. Just another api function for setting the mode I think. I don't have a use for that yet, so I haven't thought much about it. Feel free to suggest what you think the API should look like. > This is my old device tree, what should the new one look like? > > ...@670 { /* General Purpose Timer 6 in Input mode */ > compatible = "gpt-ir"; > cell-index = <7>; > reg = <0x670 0x10>; > interrupts = <0x1 0x10 0x0>; > interrupt-parent = <&mpc5200_pic>; > }; You'd want a node for the IR device which uses the GPT node as its interrupt controller. so: gpt7: g...@670 { compatible = "fsl,mpc5200b-gpt" reg = <0x670 0x10>; interrupt = <1 16 0>; interrupt-controller; #interrupt-cells = <1>; }; Then elsewhere: ir { compatible = "digispeaker,ir"; // or whatever best matches your board interrupt-parent = <&gpt>; interrupts = <0>; // IIRC, '0' means irq on both edges for the GPT irq controller }; g. -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev