Lines Matching refs:th_handle

2135 static struct snc_thermal_ctrl *th_handle;  variable
2154 if ((mode && !(th_handle->profiles & mode)) || mode >= THM_PROFILE_MAX) in sony_nc_thermal_mode_set()
2160 th_handle->mode = mode; in sony_nc_thermal_mode_set()
2182 if (!cnt || (th_handle->profiles & cnt)) in sony_nc_thermal_profiles_show()
2232 th_handle = kzalloc(sizeof(struct snc_thermal_ctrl), GFP_KERNEL); in sony_nc_thermal_setup()
2233 if (!th_handle) in sony_nc_thermal_setup()
2236 ret = sony_call_snc_handle(0x0122, 0x0000, &th_handle->profiles); in sony_nc_thermal_setup()
2247 th_handle->mode = ret; in sony_nc_thermal_setup()
2249 sysfs_attr_init(&th_handle->profiles_attr.attr); in sony_nc_thermal_setup()
2250 th_handle->profiles_attr.attr.name = "thermal_profiles"; in sony_nc_thermal_setup()
2251 th_handle->profiles_attr.attr.mode = S_IRUGO; in sony_nc_thermal_setup()
2252 th_handle->profiles_attr.show = sony_nc_thermal_profiles_show; in sony_nc_thermal_setup()
2254 sysfs_attr_init(&th_handle->mode_attr.attr); in sony_nc_thermal_setup()
2255 th_handle->mode_attr.attr.name = "thermal_control"; in sony_nc_thermal_setup()
2256 th_handle->mode_attr.attr.mode = S_IRUGO | S_IWUSR; in sony_nc_thermal_setup()
2257 th_handle->mode_attr.show = sony_nc_thermal_mode_show; in sony_nc_thermal_setup()
2258 th_handle->mode_attr.store = sony_nc_thermal_mode_store; in sony_nc_thermal_setup()
2260 ret = device_create_file(&pd->dev, &th_handle->profiles_attr); in sony_nc_thermal_setup()
2264 ret = device_create_file(&pd->dev, &th_handle->mode_attr); in sony_nc_thermal_setup()
2271 device_remove_file(&pd->dev, &th_handle->profiles_attr); in sony_nc_thermal_setup()
2273 kfree(th_handle); in sony_nc_thermal_setup()
2274 th_handle = NULL; in sony_nc_thermal_setup()
2280 if (th_handle) { in sony_nc_thermal_cleanup()
2281 device_remove_file(&pd->dev, &th_handle->profiles_attr); in sony_nc_thermal_cleanup()
2282 device_remove_file(&pd->dev, &th_handle->mode_attr); in sony_nc_thermal_cleanup()
2283 kfree(th_handle); in sony_nc_thermal_cleanup()
2284 th_handle = NULL; in sony_nc_thermal_cleanup()
2293 if (!th_handle) in sony_nc_thermal_resume()
2298 if (status != th_handle->mode) in sony_nc_thermal_resume()
2299 sony_nc_thermal_mode_set(th_handle->mode); in sony_nc_thermal_resume()