[RFC PATCH 18/19] powerpc: wii: platform support

Segher Boessenkool segher at kernel.crashing.org
Fri Nov 27 09:05:29 EST 2009


>>> +#ifdef CONFIG_STARLET_MINI
>>> +
>>> +#define HW_RESETS_OF_COMPATIBLE    "nintendo,hollywood-resets"
>>> +#define HW_GPIO_ALIAS        "hw_gpio
>>
>> This should be unconditional now I think?  You access the hardware
>> directly.
>
> Yes, at this stage direct hardware should be possible, but only if  
> 'mini' support is compiled-in (which will be the default option at  
> this stage).
> We can either leave the conditionals as is now, or remove them and  
> add them later if we support more than one firmware flavour.
>
> I'm fine with both options.

Removing all superfluous code is best in my opinion.

>>> +    np = of_find_node_by_name(NULL, "aliases");
>>> +    if (!np) {
>>> +        pr_err("unable to find node %s\n", "aliases");
>>> +        goto out;
>>> +    }
>>> +
>>> +    path = of_get_property(np, HW_GPIO_ALIAS, NULL);
>>> +    of_node_put(np);
>>> +    if (!path) {
>>> +        pr_err("alias %s unknown\n", HW_GPIO_ALIAS);
>>> +        goto out;
>>> +    }
>>
>> Don't use an alias here, search for e.g. a matching "compatible"  
>> instead.
>
> I used an alias because I wanted explicitly the second GPIO word.
>
> Is there another way to select a specific instance of repeated  
> identical hardware?

Yes, probe for it with its address.  There is no guarantee in which  
order
you will get them.

> We have two instances of gpios here, matching the same "compatible".

It's a pain in the behind that the GPIO binding will not allow you to
show the two GPIO regs as one controller, which it is.  Or can it
actually do that?


Segher



More information about the Linuxppc-dev mailing list