Lines Matching defs:th_handle
2142 static struct snc_thermal_ctrl *th_handle;
2161 if ((mode && !(th_handle->profiles & mode)) || mode >= THM_PROFILE_MAX)
2167 th_handle->mode = mode;
2189 if (!cnt || (th_handle->profiles & cnt))
2239 th_handle = kzalloc(sizeof(struct snc_thermal_ctrl), GFP_KERNEL);
2240 if (!th_handle)
2243 ret = sony_call_snc_handle(0x0122, 0x0000, &th_handle->profiles);
2254 th_handle->mode = ret;
2256 sysfs_attr_init(&th_handle->profiles_attr.attr);
2257 th_handle->profiles_attr.attr.name = "thermal_profiles";
2258 th_handle->profiles_attr.attr.mode = S_IRUGO;
2259 th_handle->profiles_attr.show = sony_nc_thermal_profiles_show;
2261 sysfs_attr_init(&th_handle->mode_attr.attr);
2262 th_handle->mode_attr.attr.name = "thermal_control";
2263 th_handle->mode_attr.attr.mode = S_IRUGO | S_IWUSR;
2264 th_handle->mode_attr.show = sony_nc_thermal_mode_show;
2265 th_handle->mode_attr.store = sony_nc_thermal_mode_store;
2267 ret = device_create_file(&pd->dev, &th_handle->profiles_attr);
2271 ret = device_create_file(&pd->dev, &th_handle->mode_attr);
2278 device_remove_file(&pd->dev, &th_handle->profiles_attr);
2280 kfree(th_handle);
2281 th_handle = NULL;
2287 if (th_handle) {
2288 device_remove_file(&pd->dev, &th_handle->profiles_attr);
2289 device_remove_file(&pd->dev, &th_handle->mode_attr);
2290 kfree(th_handle);
2291 th_handle = NULL;
2300 if (!th_handle)
2305 if (status != th_handle->mode)
2306 sony_nc_thermal_mode_set(th_handle->mode);