Re: [PATCH] powerpc: Add i8042 keyboard and mouse irq parsing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 14, 2010 at 4:39 AM, Martyn Welch <martyn.welch@xxxxxx> 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@xxxxxx>
>> ---
>>
>> 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@0 {
>>                                         reg = <0x0>;
>> +                                       interrupts = <1 1>;
>>                                         compatible = "pnpPNP,303";
>>                                 };
>>
>>                                 mouse@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.
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux