| void tpd_get_dts_info(void) {
struct device_node *node1 = NULL; int key_dim_local[16], i, ret; node1 = of_find_matching_node(node1, touch_of_match); if (node1) {
ret = of_property_read_u32(node1, "tpd-max-touch-num", &tpd_dts_data.touch_max_num); if (ret != 0) TPD_DEBUG("tpd-max-touch-num not found\n"); ret = of_property_read_u32(node1, "use-tpd-button", &tpd_dts_data.use_tpd_button); if (ret != 0) TPD_DEBUG("use-tpd-button not found\n"); else TPD_DEBUG("[tpd]use-tpd-button = %d\n", tpd_dts_data.use_tpd_button); ret = of_property_read_u32_array(node1, "tpd-resolution", tpd_dts_data.tpd_resolution, ARRAY_SIZE(tpd_dts_data.tpd_resolution)); if (ret != 0) TPD_DEBUG("tpd-resolution not found\n"); if (tpd_dts_data.use_tpd_button) {
ret = of_property_read_u32(node1, "tpd-key-num", &tpd_dts_data.tpd_key_num); if (ret != 0) TPD_DEBUG("tpd-key-num not found\n"); ret = of_property_read_u32_array(node1, "tpd-key-local", tpd_dts_data.tpd_key_local, ARRAY_SIZE(tpd_dts_data.tpd_key_local)); if (ret != 0) TPD_DEBUG("tpd-key-local not found\n"); ret = of_property_read_u32_array(node1, "tpd-key-dim-local", key_dim_local, ARRAY_SIZE(key_dim_local)); if (ret != 0) TPD_DEBUG("tpd-key-dim-local not found\n"); memcpy(tpd_dts_data.tpd_key_dim_local, key_dim_local, sizeof(key_dim_local)); for (i = 0; i < 4; i++) {
pr_debug("[tpd]key[%d].key_x = %d\n", i, tpd_dts_data.tpd_key_dim_local[i].key_x); pr_debug("[tpd]key[%d].key_y = %d\n", i, tpd_dts_data.tpd_key_dim_local[i].key_y); pr_debug("[tpd]key[%d].key_W = %d\n", i, tpd_dts_data.tpd_key_dim_local[i].key_width); pr_debug("[tpd]key[%d].key_H = %d\n", i, tpd_dts_data.tpd_key_dim_local[i].key_height); } } ret = of_property_read_u32(node1, "tpd-filter-enable", &tpd_dts_data.touch_filter.enable); if (ret != 0) TPD_DEBUG("tpd-filter-enable not found\n"); if (tpd_dts_data.touch_filter.enable) {
ret = of_property_read_u32(node1, "tpd-filter-pixel-density", &tpd_dts_data.touch_filter.pixel_density); if (ret != 0) TPD_DEBUG("tpd-filter-pixel-density not found\n"); ret = of_property_read_u32_array(node1, "tpd-filter-custom-prameters", (u32 *)tpd_dts_data.touch_filter.W_W, ARRAY_SIZE(tpd_dts_data.touch_filter.W_W)); if (ret != 0) TPD_DEBUG("tpd-filter-custom-prameters not found\n"); ret = of_property_read_u32_array(node1, "tpd-filter-custom-speed", tpd_dts_data.touch_filter.VECLOCITY_THRESHOLD, ARRAY_SIZE(tpd_dts_data.touch_filter.VECLOCITY_THRESHOLD)); if (ret != 0) TPD_DEBUG("tpd-filter-custom-speed not found\n"); } memcpy(&tpd_filter, &tpd_dts_data.touch_filter, sizeof(tpd_filter)); TPD_DEBUG("[tpd]tpd-filter-enable = %d, pixel_density = %d\n", tpd_filter.enable, tpd_filter.pixel_density); tpd_dts_data.tpd_use_ext_gpio = of_property_read_bool(node1, "tpd-use-ext-gpio"); ret = of_property_read_u32(node1, "tpd-rst-ext-gpio-num", &tpd_dts_data.rst_ext_gpio_num); if (ret != 0) TPD_DEBUG("tpd-rst-ext-gpio-num not foun
|