I tried to designed my own driver in freescale BSP Android 4.4.3 source code.
Below is my designed for properties get.
Code:
static const struct of_device_id dido_dt_ids[] = {
{ .compatible = "winmate,dido", },
};
unsigned int di0_num;
static int dido_get_of_properties(void)
{
struct device_node *np = of_find_compatible_node(NULL, NULL, dido_dt_ids[0].compatible);
int i;
if (!np){
printk(KERN_WARNING "%s %s() line %d, cannot get device_node \n", __FILE__, __func__, __LINE__);
return -ENODATA;
}
di0_num = of_get_named_gpio(np, "winmate,di0", 0);
//di_gpio[0] = di0_num;
if(di0_num<0)
{
printk(KERN_WARNING "%s %s() line %d, can not get di0_value gpios!\n", __FILE__, __func__, __LINE__);
return -ENODATA;
}
return 0;
}
When I compile my code it showed below error to me.
drivers/misc/dido.c:96:2: error: implicit declaration of function 'of_get_named_gpio' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
I could not understand why the declaration is implicit.
Additional note:
Below is my dtsi settings
Code:
dido: winmate-dido {
compatible = "winmate,dido";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_dido>;
status = "okay";
winmate,di0 = <&gpio1 11 0>;/*MX6QDL_PAD_SD2_CMD__GPIO1_IO11*/
winmate,di1 = <&gpio1 10 0>;/*MX6QDL_PAD_SD2_CMD__GPIO1_IO10*/
di-amount = <5>;
do-amount = <5>;
di-gpi = <15 14 193>;
do-gpo = <102 103 104 105 178>;
};
Can anyone help me on this?