Hello Team,
I am writing one simple GPIO (character) driver for our Custom designed carrier board Xavier NX.
- Can i test my gpio driver on GPIO04 . If yes then what value should we use for locating gpio like gpio 4 or gpio 04 …
e.g. in my code
#define LED0_GPIO 4 /*As i am testing on GPIO04 */
#define DEVICE_MAJOR 200
#define DEVICE_MINOR 0
#define DEVICE_COUNT 1
#define GPIO_DEVICE_MODEL_NUMBER “gpio-leds”
…
…
err_check = gpio_is_valid(LED0_GPIO);
if(err_check == 0)
printk(“gpio is valid: %d\n”, err_check);
else{
pr_err(“failed to initialize a structure with an valid gpio number\n%d”, err_check);
return -1;
}
but in dmesg , I AM GETTING ERROR AS :-
[ 496.824834] Successfully allocating the range of led char device number[ 496.824844] Succesfully adding the led-gpio diver to system
[ 496.824848] Welcome to gpio-leds Driver.
[ 496.824852] failed to initialize a structure with an valid gpio number
please help me in identifying the mistake.
- Can i use any other GPIO pin and how to check whether i can use any other gpio pins or not .I have already read pinmux configuration for nx but could not conclude from it.