Re: [Patch v5 08/13] ARM: imx6q: add config-on-boot gpios

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

 




Fabio Estevam <festevam@xxxxxxxxx> wrote:

>On Wed, Jun 13, 2012 at 9:34 AM, Richard Zhao
><richard.zhao@xxxxxxxxxxxxx> wrote:
>
>> +static void __init imx6q_config_on_boot(void)
>> +{
>> +       struct device_node *np;
>> +       struct property *pp;
>> +       int cnt, len, i;
>> +       int gpio;
>> +
>> +       np = of_find_node_by_path("/config-on-boot");
>> +       if (!np)
>> +               return;
>> +       cnt = of_gpio_named_count(np, "output-gpios");
>> +       pp = of_find_property(np, "output-gpio-values", &len);
>> +       if (!pp || cnt != len / sizeof(u32)) {
>> +               pr_err("Invalid config-on-boot gpios!\n");
>> +               of_node_put(np);
>> +               return;
>> +       }
>> +       for (i = 0; i < cnt; i++) {
>> +               gpio = of_get_named_gpio(np, "output-gpios", i);
>> +               if (gpio_is_valid(gpio))
>> +                       gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH,
>> +                                       "config-on-boot");
>> +       }
>> +
>> +       of_node_put(np);
>> +}
>
>Couldn't this function be made generic and put outside of mach-imx6q.c
>so that other platforms could use it?
>
>I need the same for mxs.
Yes, it is common. But it must be called after populate devices.  Rob didn't agree the way yet.
-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux