cregit-Linux how code gets into the kernel

Release 4.11 drivers/thermal/user_space.c

Directory: drivers/thermal
/*
 *  user_space.c - A simple user space Thermal events notifier
 *
 *  Copyright (C) 2012 Intel Corp
 *  Copyright (C) 2012 Durgadoss R <durgadoss.r@intel.com>
 *
 *  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; version 2 of the License.
 *
 *  This program is distributed in the hope that it will be useful, but
 *  WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
 *
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

#include <linux/thermal.h>
#include <linux/slab.h>
#include "thermal_core.h"

/**
 * notify_user_space - Notifies user space about thermal events
 * @tz - thermal_zone_device
 * @trip - Trip point index
 *
 * This function notifies the user space through UEvents.
 */

static int notify_user_space(struct thermal_zone_device *tz, int trip) { char *thermal_prop[5]; int i; mutex_lock(&tz->lock); thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s", tz->type); thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d", tz->temperature); thermal_prop[2] = kasprintf(GFP_KERNEL, "TRIP=%d", trip); thermal_prop[3] = kasprintf(GFP_KERNEL, "EVENT=%d", tz->notify_event); thermal_prop[4] = NULL; kobject_uevent_env(&tz->device.kobj, KOBJ_CHANGE, thermal_prop); for (i = 0; i < 4; ++i) kfree(thermal_prop[i]); mutex_unlock(&tz->lock); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Srinivas Pandruvada10370.07%133.33%
Durgadoss R4329.25%133.33%
Sachin Kamat10.68%133.33%
Total147100.00%3100.00%

static struct thermal_governor thermal_gov_user_space = { .name = "user_space", .throttle = notify_user_space, };
int thermal_gov_user_space_register(void) { return thermal_register_governor(&thermal_gov_user_space); }

Contributors

PersonTokensPropCommitsCommitProp
Durgadoss R1392.86%150.00%
Rui Zhang17.14%150.00%
Total14100.00%2100.00%


void thermal_gov_user_space_unregister(void) { thermal_unregister_governor(&thermal_gov_user_space); }

Contributors

PersonTokensPropCommitsCommitProp
Durgadoss R1292.31%150.00%
Rui Zhang17.69%150.00%
Total13100.00%2100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Srinivas Pandruvada10752.97%125.00%
Durgadoss R9145.05%125.00%
Rui Zhang20.99%125.00%
Sachin Kamat20.99%125.00%
Total202100.00%4100.00%
Directory: drivers/thermal
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.