[PATCH 2/2] USB: isp1760: Support board-specific hardware configurations

Olof Johansson olof at lixom.net
Fri May 23 00:28:34 EST 2008


On Wed, May 21, 2008 at 04:28:51PM -0500, Nate Case wrote:
> This adds support for hardware configurations that don't match the
> chip default register settings (e.g., 16-bit data bus, DACK and
> DREQ pulled down instead of up, analog overcurrent mode).
> 
> These settings are passed in via the OF device tree.  The PCI
> interface still assumes the same default values.

Nice! I'll give this a spin on Electra as well, it should make it work
there.

A couple of comments on the OF interface:

> @@ -55,8 +57,34 @@ static int of_isp1760_probe(struct of_device *dev,
>  	virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
>  			oirq.size);
>  
> +	prop = of_get_property(dp, "port1-disable", NULL);
> +	if (prop && *prop != 0)
> +		devflags |= ISP1760_FLAG_PORT1_DIS;

It should be sufficient to add the property without a value, and just
check for the presence of it. The cpu nodes have properties like this if
you want something to compare with.

> +
> +	/* Some systems wire up only 16 of the 32 data lines */
> +	prop = of_get_property(dp, "bus-width", NULL);
> +	if (prop && *prop == 16)
> +		devflags |= ISP1760_FLAG_BUS_WIDTH_16;

This is the obvious exception, here you'll have to check the value.

I'm not sure if the DT police will complain of the overloaded bus-width
property name and would prefer a custom one.


-Olof



More information about the Linuxppc-dev mailing list