Lines Matching defs:th_handle
2134 static struct snc_thermal_ctrl *th_handle;
2153 if ((mode && !(th_handle->profiles & mode)) || mode >= THM_PROFILE_MAX)
2159 th_handle->mode = mode;
2181 if (!cnt || (th_handle->profiles & cnt))
2227 th_handle = kzalloc(sizeof(struct snc_thermal_ctrl), GFP_KERNEL);
2228 if (!th_handle)
2231 ret = sony_call_snc_handle(0x0122, 0x0000, &th_handle->profiles);
2242 th_handle->mode = ret;
2244 sysfs_attr_init(&th_handle->profiles_attr.attr);
2245 th_handle->profiles_attr.attr.name = "thermal_profiles";
2246 th_handle->profiles_attr.attr.mode = S_IRUGO;
2247 th_handle->profiles_attr.show = sony_nc_thermal_profiles_show;
2249 sysfs_attr_init(&th_handle->mode_attr.attr);
2250 th_handle->mode_attr.attr.name = "thermal_control";
2251 th_handle->mode_attr.attr.mode = S_IRUGO | S_IWUSR;
2252 th_handle->mode_attr.show = sony_nc_thermal_mode_show;
2253 th_handle->mode_attr.store = sony_nc_thermal_mode_store;
2255 ret = device_create_file(&pd->dev, &th_handle->profiles_attr);
2259 ret = device_create_file(&pd->dev, &th_handle->mode_attr);
2266 device_remove_file(&pd->dev, &th_handle->profiles_attr);
2268 kfree(th_handle);
2269 th_handle = NULL;
2275 if (th_handle) {
2276 device_remove_file(&pd->dev, &th_handle->profiles_attr);
2277 device_remove_file(&pd->dev, &th_handle->mode_attr);
2278 kfree(th_handle);
2279 th_handle = NULL;
2288 if (!th_handle)
2293 if (status != th_handle->mode)
2294 sony_nc_thermal_mode_set(th_handle->mode);