Jump to content

Help on gpio_request_ex function


leomecma

Recommended Posts

I'm developing a watchdog driver and I need get 3 gpios, from FEX file.

 

I'm trying this:

 

[wdt_para]
wdt_used     = 1
wdt_wdi_gpio = port:PH26<1><default><default><0>
wdt_ign_gpio = port:PC20<0><default><default><0>
wdt_off_gpio = port:PC19<1><default><default><0>

 

if(SCRIPT_PARSER_OK != script_parser_fetch("wdt_para", "wdt_used", &wdt_used, 1))
    {
        pr_err("%s: script_parser_fetch err. \n", __func__);
        return -1;
    }
    if(1 != wdt_used){
        pr_err("%s: wdt_unused. \n",  __func__);
        return -1;
    }

    gpio_wdi = gpio_request_ex("wdt_para", "wdt_wdi_gpio");
    if(!gpio_wdi) {
        pr_err("%s: gpio_wdi request fail value = %d!\n", __func__,gpio_wdi);
        return -1;
    }

    gpio_ign = gpio_request_ex("wdt_para", "wdt_ign_gpio");
    if(!gpio_ign) {
        pr_err("%s: gpio_ign request fail value = %d!\n", __func__,gpio_ign);
        return -1;
    }

    gpio_off = gpio_request_ex("wdt_para", "wdt_off_gpio");
    if(!gpio_off) {
        pr_err("%s: gpio_off request fail value = %d!\n", __func__,gpio_off);
        return -1;
    }

 

 

 

But gpio_request_ex returns 0 in all three gpios. If I change the first one to wdt_gpio in this way above, the gpio_request_ex works. I think that function wait the name wdt and gpio, but doesn't accept anything in the middle, but I need start three GPIOs. How can I do that?

 

[wdt_para]
wdt_used     = 1
wdt_gpio = port:PH26<1><default><default><0>

 

 gpio_wdi = gpio_request_ex("wdt_para", "wdt_gpio");
    if(!gpio_wdi) {
        pr_err("%s: gpio_wdi request fail value = %d!\n", __func__,gpio_wdi);
        return -1;
    }

 

 

 

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines