设备树资源如下
fb@4d000000 { compatible = "jz2440,lcd"; reg = <0x4d000000 0x60>; interrupts = <0x0 0x0 0x10 0x3>; clocks = <0x2 0x20>; clock-names = "lcd"; pinctrl-names = "default"; pinctrl-0 = <0x8 0x9 0xa>; status = "okay"; lcdcon5 = <0xb09>; type = <0x60>; width = [01 e0]; height = [01 10]; pixclock = <0x186a0>; xres = [01 e0]; yres = [01 10]; bpp = [00 10]; left_margin = [00 02]; right_margin = [00 02]; hsync_len = [00 29]; upper_margin = [00 02]; lower_margin = [00 02]; vsync_len = [00 0a]; };
1.设置资源匹配属性
使用of_property_read_u32根据属性名字读取结点存入参数结构体