[PATCH v2] pasemi: process i2c device tree entries at boot

Olof Johansson olof at lixom.net
Tue Oct 16 10:17:01 EST 2007


On Mon, Oct 15, 2007 at 05:54:51PM -0500, Scott Wood wrote:
> Olof Johansson wrote:
>> Setup i2c_board_info based on device tree contents. This has to be
>> a device_initcall since we need PCI to be probed by the time we
>> run it, but before the actual driver is initialized.
>
> Can we factor at least some of this stuff out into common code?

I didn't really feel strong motivations to do so, given that the amount
of shared code is quite small, and the official bindings are not yet
determined.

Chances are whenever the bindings are done they might be incompatible
with what we already have in our firmware, so the code would need to be
separated out again.

> We certainly shouldn't need more than one translation table, and this loop:
>
>> +static int __init pasemi_register_i2c_devices(void)
>> +{
>> +	struct pci_dev *pdev;
>> +	struct device_node *adap_node;
>> +	struct device_node *node;
>> +
>> +	pdev = NULL;
>> +	while ((pdev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa003, pdev))) {
>> +		adap_node = pci_device_to_OF_node(pdev);
>
> Should be in the pasemi code, and pass a bus number and device node to 
> generic code that does this:

Yeah, it'd be the natural way of doing it, if it was needed.


-Olof



More information about the Linuxppc-dev mailing list