Lines Matching refs:ptdata
25 struct tmon_platform_data ptdata; variable
138 ptdata.tzi[tzid].tp[tpid].type = trip_type; in get_trip_point_data()
211 if (tzi->nr_cdev > ptdata.nr_cooling_dev) { in find_tzone_cdev()
287 if (!ptdata.nr_tz_sensor) in scan_tzones()
290 for (i = 0; i <= ptdata.max_tz_instance; i++) { in scan_tzones()
304 sysfs_get_string(tz_name, "type", ptdata.tzi[k].type); in scan_tzones()
305 ptdata.tzi[k].instance = i; in scan_tzones()
308 ptdata.tzi[k].nr_cdev = 0; in scan_tzones()
309 ptdata.tzi[k].nr_trip_pts = 0; in scan_tzones()
314 &ptdata.tzi[k], k)) in scan_tzones()
322 &ptdata.tzi[k], i, j)) in scan_tzones()
331 ptdata.tzi[k].nr_cdev); in scan_tzones()
345 if (!ptdata.nr_cooling_dev) { in scan_cdevs()
349 for (i = 0; i <= ptdata.max_cdev_instance; i++) { in scan_cdevs()
366 sysfs_get_string(cdev_name, "type", ptdata.cdi[k].type); in scan_cdevs()
367 ptdata.cdi[k].instance = i; in scan_cdevs()
368 if (strstr(ptdata.cdi[k].type, ctrl_cdev)) { in scan_cdevs()
369 ptdata.cdi[k].flag |= CDEV_FLAG_IN_CONTROL; in scan_cdevs()
408 if (inst > ptdata.max_cdev_instance) in probe_thermal_sysfs()
409 ptdata.max_cdev_instance = inst; in probe_thermal_sysfs()
413 ptdata.nr_cooling_dev, in probe_thermal_sysfs()
414 ptdata.max_cdev_instance); in probe_thermal_sysfs()
415 ptdata.nr_cooling_dev++; in probe_thermal_sysfs()
419 if (inst > ptdata.max_tz_instance) in probe_thermal_sysfs()
420 ptdata.max_tz_instance = inst; in probe_thermal_sysfs()
424 ptdata.nr_tz_sensor, in probe_thermal_sysfs()
425 ptdata.max_tz_instance); in probe_thermal_sysfs()
426 ptdata.nr_tz_sensor++; in probe_thermal_sysfs()
433 ptdata.nr_tz_sensor, ptdata.nr_cooling_dev, in probe_thermal_sysfs()
437 if (!ptdata.nr_tz_sensor) { in probe_thermal_sysfs()
442 ptdata.tzi = calloc(ptdata.max_tz_instance+1, sizeof(struct tz_info)); in probe_thermal_sysfs()
443 if (!ptdata.tzi) { in probe_thermal_sysfs()
449 if (ptdata.nr_cooling_dev) { in probe_thermal_sysfs()
450 ptdata.cdi = calloc(ptdata.max_cdev_instance + 1, in probe_thermal_sysfs()
452 if (!ptdata.cdi) { in probe_thermal_sysfs()
453 free(ptdata.tzi); in probe_thermal_sysfs()
472 for (i = 0; i < ptdata.nr_tz_sensor; i++) in zone_instance_to_index()
473 if (ptdata.tzi[i].instance == zone_inst) in zone_instance_to_index()
486 if (!ptdata.nr_tz_sensor) { in update_thermal_data()
499 for (i = 0; i < ptdata.nr_tz_sensor; i++) { in update_thermal_data()
502 ptdata.tzi[i].instance); in update_thermal_data()
510 for (i = 0; i < ptdata.nr_cooling_dev; i++) { in update_thermal_data()
515 ptdata.cdi[i].instance); in update_thermal_data()
516 probe_cdev(&ptdata.cdi[i], cdev_name); in update_thermal_data()
517 val = ptdata.cdi[i].cur_state; in update_thermal_data()
541 for (i = 0; i < ptdata.nr_cooling_dev; i++) { in set_ctrl_state()
542 if (ptdata.cdi[i].flag & CDEV_FLAG_IN_CONTROL) { in set_ctrl_state()
543 if (ptdata.cdi[i].max_state < 10) { in set_ctrl_state()
548 cdev_state = state * ptdata.cdi[i].max_state/100; in set_ctrl_state()
551 ptdata.cdi[i].instance, state, cdev_state); in set_ctrl_state()
553 CDEV, ptdata.cdi[i].instance); in set_ctrl_state()
570 for (i = 0; i < ptdata.nr_cooling_dev; i++) { in get_ctrl_state()
571 if (ptdata.cdi[i].flag & CDEV_FLAG_IN_CONTROL) { in get_ctrl_state()
572 ctrl_cdev_id = ptdata.cdi[i].instance; in get_ctrl_state()
574 ptdata.cdi[i].instance); in get_ctrl_state()
589 free(ptdata.tzi); in free_thermal_data()
590 free(ptdata.cdi); in free_thermal_data()