Hi, On Wed, Mar 12, 2008 at 07:06:25PM +0100, Matteo Croce wrote: > > Sorry but the linux-mips mailing list can't accept this patch for unknown reasons. > I'll send a gz file, that will work i have a plattform AR7VWi which has a High Active reset for the vlynq_low so the code is not sufficient to get the ACX up and running +static struct plat_vlynq_data vlynq_low_data = { + .ops.on = vlynq_on, + .ops.off = vlynq_off, + .reset_bit = 20, + .gpio_bit = 18, +}; + +static struct plat_vlynq_data vlynq_high_data = { + .ops.on = vlynq_on, + .ops.off = vlynq_off, + .reset_bit = 16, + .gpio_bit = 19, +}; The gpio_bit's are okay but they are high active so the generic code: +static int vlynq_on(struct vlynq_device *dev) +{ + int result; + struct plat_vlynq_data *pdata = dev->dev.platform_data; + + if ((result = gpio_request(pdata->gpio_bit, "vlynq"))) + goto out; + + ar7_device_reset(pdata->reset_bit); + + if ((result = ar7_gpio_disable(pdata->gpio_bit))) + goto out_enabled; + + if ((result = ar7_gpio_enable(pdata->gpio_bit))) + goto out_enabled; + + if ((result = gpio_direction_output(pdata->gpio_bit, 0))) + goto out_gpio_enabled; + + mdelay(50); + + gpio_set_value(pdata->gpio_bit, 1); Is not enough here - gpios might be reverse polarity ... The right thing to actually reset a device would need a toggle not a static state. + mdelay(50); + + return 0; +static void vlynq_off(struct vlynq_device *dev) +{ + struct plat_vlynq_data *pdata = dev->dev.platform_data; + ar7_gpio_disable(pdata->gpio_bit); + gpio_free(pdata->gpio_bit); + ar7_device_disable(pdata->reset_bit); +} gpio_disable to gpio_bit will put the gpio to tristate or special function which will lead to unpredicted results. So gpio_set_value would be needed and then the same as for vlynq_on applies concerning the reverse polarity. Flo -- Florian Lohoff flo@xxxxxxxxxx +49-171-2280134 Those who would give up a little freedom to get a little security shall soon have neither - Benjamin Franklin
Attachment:
signature.asc
Description: Digital signature