[PATCH] powerpc: Add i8042 keyboard and mouse irq parsing
Grant Likely
grant.likely at secretlab.ca
Thu May 20 02:00:01 EST 2010
On Fri, May 14, 2010 at 4:39 AM, Martyn Welch <martyn.welch at ge.com> wrote:
> Martyn Welch wrote:
>> Currently the irqs for the i8042, which historically provides keyboard and
>> mouse (aux) support, is hardwired in the driver rather than parsing the
>> dts.
>>
>> In addition the interrupts are provided in the dts, but in a way that is
>> not easily parsable using irq_of_parse_and_map().
>>
>> This patch modifies the powerpc legacy IO code to attempt to parse the
>> device tree for this information, failing back to the hardcoded values if
>> it fails. For this to succeed the interrupts for the keyboard and mouse
>> ports need to be moved from the parent i8042 node to the individual port
>> nodes.
>>
>> Signed-off-by: Martyn Welch <martyn.welch at ge.com>
>> ---
>>
>> To get irq_of_parse_and_map() to successfully parse the interrupts, I had
>> to do this to my device tree:
>>
>> @@ -120,16 +120,17 @@
>> #address-cells = <1>;
>> reg = <1 0x60 0x1
>> 1 0x64 0x1>;
>> - interrupts = <1 1 12 1>;
>> interrupt-parent = <&lpc_pic>;
>>
>> keyboard at 0 {
>> reg = <0x0>;
>> + interrupts = <1 1>;
>> compatible = "pnpPNP,303";
>> };
>>
>> mouse at 1 {
>> reg = <0x1>;
>> + interrupts = <12 1>;
>> compatible = "pnpPNP,f03";
>> };
>> };
>>
>> I'm not sure how to parse for the correct interrupt if I don't do this. I
>> this is incorrect and someone could advise me on how the existing device
>> tree layout can be properly parsed, I'll happily modify this patch.
Call of_irq_parse_and_map() on the parent node, using the second
parameter to specify if you want the first or second irq. You get the
parent node with of_get_parent().
Although looking at this fragment, I don't understand why the i8042
node doesn't have its own compatible property. Maybe there is
something historical that I'm missing here.
g.
More information about the Linuxppc-dev
mailing list