/* Unbind callback functions for thermal zone */ static int exynos_unbind(struct thermal_zone_device *thermal, struct thermal_cooling_device *cdev) { int ret = 0, i; /* find the cooling device registered*/ for (i = 0; i < th_zone->cool_dev_size; i++) if (cdev == th_zone->cool_dev[i]) break; /*No matching cooling device*/ if (i == th_zone->cool_dev_size) return 0; switch (GET_ZONE(i)) { case MONITOR_ZONE: case WARN_ZONE: case PANIC_ZONE: if (thermal_zone_unbind_cooling_device(thermal, i, cdev)) { pr_err("error unbinding cooling dev\n"); ret = -EINVAL; } break; default: ret = -EINVAL; } return ret; }
void do_redit(struct char_data *ch, char *arg, int cmd) { #ifndef TEST_SERVER struct room_data *rp; rp = real_roomp(ch->in_room); #endif if(IS_NPC(ch)) return; if ((IS_NPC(ch)) || (GetMaxLevel(ch)<LOW_IMMORTAL)) return; if (!ch->desc) /* someone is forced to do something. can be bad! */ return; /* the ch->desc->str field will cause problems... */ #ifndef TEST_SERVER if((GetMaxLevel(ch) < 56) && (rp->zone != GET_ZONE(ch))) { send_to_char("Sorry, you are not authorized to edit this zone.\n\r", ch); return; } #endif ch->specials.edit = MAIN_MENU; ch->desc->connected = CON_EDITING; act("$n has begun editing.", FALSE, ch, 0, 0, TO_ROOM); UpdateRoomMenu(ch); }
/* Bind callback functions for thermal zone */ static int exynos_bind(struct thermal_zone_device *thermal, struct thermal_cooling_device *cdev) { int ret = 0, i; /* find the cooling device registered*/ for (i = 0; i < th_zone->cool_dev_size; i++) #ifdef CONFIG_ARM_EXYNOS_MP_CPUFREQ if (cdev == th_zone->cool_dev[i] || cdev == th_zone->cool_dev_kfc[i]) #else if (cdev == th_zone->cool_dev[i]) #endif break; /*No matching cooling device*/ if (i == th_zone->cool_dev_size) return 0; switch (GET_ZONE(i)) { case MONITOR_ZONE: case WARN_ZONE: case PANIC_ZONE: if (thermal_zone_bind_cooling_device(thermal, i, cdev)) { pr_err("error binding cooling dev inst 0\n"); ret = -EINVAL; } break; default: ret = -EINVAL; } return ret; }
void print_memory(t_block *b, size_t *total) { t_block *tmp; tmp = b; while (tmp) { if (IS_START_HEAP(tmp)) { if (GET_ZONE(tmp) == TINY) ft_putstr("TINY"); else if (GET_ZONE(tmp) == SMALL) ft_putstr("SMALL"); else ft_putstr("LARGE"); ft_putstr(" : "); print_addr(tmp, 1); } print_and_count(tmp, total); tmp = tmp->next; if (tmp && IS_START_HEAP(tmp)) break ; } }
/* Get trip type callback functions for thermal zone */ static int exynos_get_trip_type(struct thermal_zone_device *thermal, int trip, enum thermal_trip_type *type) { switch (GET_ZONE(trip)) { case MONITOR_ZONE: case WARN_ZONE: *type = THERMAL_TRIP_ACTIVE; break; case PANIC_ZONE: *type = THERMAL_TRIP_CRITICAL; break; default: return -EINVAL; } return 0; }
/* Bind callback functions for thermal zone */ static int exynos_bind(struct thermal_zone_device *thermal, struct thermal_cooling_device *cdev) { int ret = 0, i, tab_size, level; struct freq_clip_table *tab_ptr, *clip_data; struct exynos_thermal_zone *th_zone = thermal->devdata; struct thermal_sensor_conf *data = th_zone->sensor_conf; tab_ptr = (struct freq_clip_table *)data->cooling_data.freq_data; tab_size = data->cooling_data.freq_clip_count; if (tab_ptr == NULL || tab_size == 0) return 0; /* find the cooling device registered*/ for (i = 0; i < th_zone->cool_dev_size; i++) if (cdev == th_zone->cool_dev[i]) break; /* No matching cooling device */ if (i == th_zone->cool_dev_size) return 0; /* Bind the thermal zone to the cpufreq cooling device */ for (i = 0; i < tab_size; i++) { clip_data = (struct freq_clip_table *)&(tab_ptr[i]); level = cpufreq_cooling_get_level(0, clip_data->freq_clip_max); if (level == THERMAL_CSTATE_INVALID) return 0; switch (GET_ZONE(i)) { case MONITOR_ZONE: case WARN_ZONE: if (thermal_zone_bind_cooling_device(thermal, i, cdev, level, 0)) { dev_err(data->dev, "error unbinding cdev inst=%d\n", i); ret = -EINVAL; } th_zone->bind = true; break; default: ret = -EINVAL; } } return ret; }
/* Unbind callback functions for thermal zone */ static int exynos_unbind(struct thermal_zone_device *thermal, struct thermal_cooling_device *cdev) { int ret = 0, i, tab_size; struct exynos_thermal_zone *th_zone = thermal->devdata; struct thermal_sensor_conf *data = th_zone->sensor_conf; if (th_zone->bind == false) return 0; tab_size = data->cooling_data.freq_clip_count; if (tab_size == 0) return 0; /* find the cooling device registered*/ for (i = 0; i < th_zone->cool_dev_size; i++) if (cdev == th_zone->cool_dev[i]) break; /* No matching cooling device */ if (i == th_zone->cool_dev_size) return 0; /* Bind the thermal zone to the cpufreq cooling device */ for (i = 0; i < tab_size; i++) { switch (GET_ZONE(i)) { case MONITOR_ZONE: case WARN_ZONE: if (thermal_zone_unbind_cooling_device(thermal, i, cdev)) { dev_err(data->dev, "error unbinding cdev inst=%d\n", i); ret = -EINVAL; } th_zone->bind = false; break; default: ret = -EINVAL; } } return ret; }