mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 06:08:07 +00:00
staging: omap-thermal: rename bg_ptr to bgp
Use a shorter name to bandgap pointer. Cc: Benoit <b-cousson@ti.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
648b4c6c4c
commit
d7f080e625
4 changed files with 327 additions and 329 deletions
File diff suppressed because it is too large
Load diff
|
@ -269,8 +269,8 @@ struct omap_temp_sensor {
|
|||
const int slope_pcb;
|
||||
const int constant_pcb;
|
||||
void *data;
|
||||
int (*register_cooling)(struct omap_bandgap *bg_ptr, int id);
|
||||
int (*unregister_cooling)(struct omap_bandgap *bg_ptr, int id);
|
||||
int (*register_cooling)(struct omap_bandgap *bgp, int id);
|
||||
int (*unregister_cooling)(struct omap_bandgap *bgp, int id);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -345,27 +345,27 @@ struct omap_bandgap_data {
|
|||
char *fclock_name;
|
||||
char *div_ck_name;
|
||||
int sensor_count;
|
||||
int (*report_temperature)(struct omap_bandgap *bg_ptr, int id);
|
||||
int (*expose_sensor)(struct omap_bandgap *bg_ptr, int id, char *domain);
|
||||
int (*remove_sensor)(struct omap_bandgap *bg_ptr, int id);
|
||||
int (*report_temperature)(struct omap_bandgap *bgp, int id);
|
||||
int (*expose_sensor)(struct omap_bandgap *bgp, int id, char *domain);
|
||||
int (*remove_sensor)(struct omap_bandgap *bgp, int id);
|
||||
|
||||
/* this needs to be at the end */
|
||||
struct omap_temp_sensor sensors[];
|
||||
};
|
||||
|
||||
int omap_bandgap_read_thot(struct omap_bandgap *bg_ptr, int id, int *thot);
|
||||
int omap_bandgap_write_thot(struct omap_bandgap *bg_ptr, int id, int val);
|
||||
int omap_bandgap_read_tcold(struct omap_bandgap *bg_ptr, int id, int *tcold);
|
||||
int omap_bandgap_write_tcold(struct omap_bandgap *bg_ptr, int id, int val);
|
||||
int omap_bandgap_read_update_interval(struct omap_bandgap *bg_ptr, int id,
|
||||
int omap_bandgap_read_thot(struct omap_bandgap *bgp, int id, int *thot);
|
||||
int omap_bandgap_write_thot(struct omap_bandgap *bgp, int id, int val);
|
||||
int omap_bandgap_read_tcold(struct omap_bandgap *bgp, int id, int *tcold);
|
||||
int omap_bandgap_write_tcold(struct omap_bandgap *bgp, int id, int val);
|
||||
int omap_bandgap_read_update_interval(struct omap_bandgap *bgp, int id,
|
||||
int *interval);
|
||||
int omap_bandgap_write_update_interval(struct omap_bandgap *bg_ptr, int id,
|
||||
int omap_bandgap_write_update_interval(struct omap_bandgap *bgp, int id,
|
||||
u32 interval);
|
||||
int omap_bandgap_read_temperature(struct omap_bandgap *bg_ptr, int id,
|
||||
int omap_bandgap_read_temperature(struct omap_bandgap *bgp, int id,
|
||||
int *temperature);
|
||||
int omap_bandgap_set_sensor_data(struct omap_bandgap *bg_ptr, int id,
|
||||
int omap_bandgap_set_sensor_data(struct omap_bandgap *bgp, int id,
|
||||
void *data);
|
||||
void *omap_bandgap_get_sensor_data(struct omap_bandgap *bg_ptr, int id);
|
||||
void *omap_bandgap_get_sensor_data(struct omap_bandgap *bgp, int id);
|
||||
|
||||
#ifdef CONFIG_OMAP4_THERMAL
|
||||
extern const struct omap_bandgap_data omap4430_data;
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
struct omap_thermal_data {
|
||||
struct thermal_zone_device *omap_thermal;
|
||||
struct thermal_cooling_device *cool_dev;
|
||||
struct omap_bandgap *bg_ptr;
|
||||
struct omap_bandgap *bgp;
|
||||
enum thermal_device_mode mode;
|
||||
struct work_struct thermal_wq;
|
||||
int sensor_id;
|
||||
|
@ -78,17 +78,17 @@ static inline int omap_thermal_get_temp(struct thermal_zone_device *thermal,
|
|||
unsigned long *temp)
|
||||
{
|
||||
struct omap_thermal_data *data = thermal->devdata;
|
||||
struct omap_bandgap *bg_ptr;
|
||||
struct omap_bandgap *bgp;
|
||||
struct omap_temp_sensor *s;
|
||||
int ret, tmp, pcb_temp, slope, constant;
|
||||
|
||||
if (!data)
|
||||
return 0;
|
||||
|
||||
bg_ptr = data->bg_ptr;
|
||||
s = &bg_ptr->conf->sensors[data->sensor_id];
|
||||
bgp = data->bgp;
|
||||
s = &bgp->conf->sensors[data->sensor_id];
|
||||
|
||||
ret = omap_bandgap_read_temperature(bg_ptr, data->sensor_id, &tmp);
|
||||
ret = omap_bandgap_read_temperature(bgp, data->sensor_id, &tmp);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
@ -236,32 +236,32 @@ static struct thermal_zone_device_ops omap_thermal_ops = {
|
|||
};
|
||||
|
||||
static struct omap_thermal_data
|
||||
*omap_thermal_build_data(struct omap_bandgap *bg_ptr, int id)
|
||||
*omap_thermal_build_data(struct omap_bandgap *bgp, int id)
|
||||
{
|
||||
struct omap_thermal_data *data;
|
||||
|
||||
data = devm_kzalloc(bg_ptr->dev, sizeof(*data), GFP_KERNEL);
|
||||
data = devm_kzalloc(bgp->dev, sizeof(*data), GFP_KERNEL);
|
||||
if (!data) {
|
||||
dev_err(bg_ptr->dev, "kzalloc fail\n");
|
||||
dev_err(bgp->dev, "kzalloc fail\n");
|
||||
return NULL;
|
||||
}
|
||||
data->sensor_id = id;
|
||||
data->bg_ptr = bg_ptr;
|
||||
data->bgp = bgp;
|
||||
data->mode = THERMAL_DEVICE_ENABLED;
|
||||
INIT_WORK(&data->thermal_wq, omap_thermal_work);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
int omap_thermal_expose_sensor(struct omap_bandgap *bg_ptr, int id,
|
||||
int omap_thermal_expose_sensor(struct omap_bandgap *bgp, int id,
|
||||
char *domain)
|
||||
{
|
||||
struct omap_thermal_data *data;
|
||||
|
||||
data = omap_bandgap_get_sensor_data(bg_ptr, id);
|
||||
data = omap_bandgap_get_sensor_data(bgp, id);
|
||||
|
||||
if (IS_ERR_OR_NULL(data))
|
||||
data = omap_thermal_build_data(bg_ptr, id);
|
||||
data = omap_thermal_build_data(bgp, id);
|
||||
|
||||
if (!data)
|
||||
return -EINVAL;
|
||||
|
@ -273,44 +273,44 @@ int omap_thermal_expose_sensor(struct omap_bandgap *bg_ptr, int id,
|
|||
NULL, FAST_TEMP_MONITORING_RATE,
|
||||
FAST_TEMP_MONITORING_RATE);
|
||||
if (IS_ERR_OR_NULL(data->omap_thermal)) {
|
||||
dev_err(bg_ptr->dev, "thermal zone device is NULL\n");
|
||||
dev_err(bgp->dev, "thermal zone device is NULL\n");
|
||||
return PTR_ERR(data->omap_thermal);
|
||||
}
|
||||
data->omap_thermal->polling_delay = FAST_TEMP_MONITORING_RATE;
|
||||
omap_bandgap_set_sensor_data(bg_ptr, id, data);
|
||||
omap_bandgap_set_sensor_data(bgp, id, data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int omap_thermal_remove_sensor(struct omap_bandgap *bg_ptr, int id)
|
||||
int omap_thermal_remove_sensor(struct omap_bandgap *bgp, int id)
|
||||
{
|
||||
struct omap_thermal_data *data;
|
||||
|
||||
data = omap_bandgap_get_sensor_data(bg_ptr, id);
|
||||
data = omap_bandgap_get_sensor_data(bgp, id);
|
||||
|
||||
thermal_zone_device_unregister(data->omap_thermal);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int omap_thermal_report_sensor_temperature(struct omap_bandgap *bg_ptr, int id)
|
||||
int omap_thermal_report_sensor_temperature(struct omap_bandgap *bgp, int id)
|
||||
{
|
||||
struct omap_thermal_data *data;
|
||||
|
||||
data = omap_bandgap_get_sensor_data(bg_ptr, id);
|
||||
data = omap_bandgap_get_sensor_data(bgp, id);
|
||||
|
||||
schedule_work(&data->thermal_wq);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int omap_thermal_register_cpu_cooling(struct omap_bandgap *bg_ptr, int id)
|
||||
int omap_thermal_register_cpu_cooling(struct omap_bandgap *bgp, int id)
|
||||
{
|
||||
struct omap_thermal_data *data;
|
||||
|
||||
data = omap_bandgap_get_sensor_data(bg_ptr, id);
|
||||
data = omap_bandgap_get_sensor_data(bgp, id);
|
||||
if (IS_ERR_OR_NULL(data))
|
||||
data = omap_thermal_build_data(bg_ptr, id);
|
||||
data = omap_thermal_build_data(bgp, id);
|
||||
|
||||
if (!data)
|
||||
return -EINVAL;
|
||||
|
@ -318,20 +318,20 @@ int omap_thermal_register_cpu_cooling(struct omap_bandgap *bg_ptr, int id)
|
|||
/* Register cooling device */
|
||||
data->cool_dev = cpufreq_cooling_register(cpu_present_mask);
|
||||
if (IS_ERR_OR_NULL(data->cool_dev)) {
|
||||
dev_err(bg_ptr->dev,
|
||||
dev_err(bgp->dev,
|
||||
"Failed to register cpufreq cooling device\n");
|
||||
return PTR_ERR(data->cool_dev);
|
||||
}
|
||||
omap_bandgap_set_sensor_data(bg_ptr, id, data);
|
||||
omap_bandgap_set_sensor_data(bgp, id, data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int omap_thermal_unregister_cpu_cooling(struct omap_bandgap *bg_ptr, int id)
|
||||
int omap_thermal_unregister_cpu_cooling(struct omap_bandgap *bgp, int id)
|
||||
{
|
||||
struct omap_thermal_data *data;
|
||||
|
||||
data = omap_bandgap_get_sensor_data(bg_ptr, id);
|
||||
data = omap_bandgap_get_sensor_data(bgp, id);
|
||||
cpufreq_cooling_unregister(data->cool_dev);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -74,33 +74,33 @@
|
|||
((trip) >= 0 && (trip) < OMAP_TRIP_NUMBER)
|
||||
|
||||
#ifdef CONFIG_OMAP_THERMAL
|
||||
int omap_thermal_expose_sensor(struct omap_bandgap *bg_ptr, int id,
|
||||
int omap_thermal_expose_sensor(struct omap_bandgap *bgp, int id,
|
||||
char *domain);
|
||||
int omap_thermal_remove_sensor(struct omap_bandgap *bg_ptr, int id);
|
||||
int omap_thermal_register_cpu_cooling(struct omap_bandgap *bg_ptr, int id);
|
||||
int omap_thermal_unregister_cpu_cooling(struct omap_bandgap *bg_ptr, int id);
|
||||
int omap_thermal_remove_sensor(struct omap_bandgap *bgp, int id);
|
||||
int omap_thermal_register_cpu_cooling(struct omap_bandgap *bgp, int id);
|
||||
int omap_thermal_unregister_cpu_cooling(struct omap_bandgap *bgp, int id);
|
||||
#else
|
||||
static inline
|
||||
int omap_thermal_expose_sensor(struct omap_bandgap *bg_ptr, int id,
|
||||
int omap_thermal_expose_sensor(struct omap_bandgap *bgp, int id,
|
||||
char *domain)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline
|
||||
int omap_thermal_remove_sensor(struct omap_bandgap *bg_ptr, int id)
|
||||
int omap_thermal_remove_sensor(struct omap_bandgap *bgp, int id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline
|
||||
int omap_thermal_register_cpu_cooling(struct omap_bandgap *bg_ptr, int id)
|
||||
int omap_thermal_register_cpu_cooling(struct omap_bandgap *bgp, int id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline
|
||||
int omap_thermal_unregister_cpu_cooling(struct omap_bandgap *bg_ptr, int id)
|
||||
int omap_thermal_unregister_cpu_cooling(struct omap_bandgap *bgp, int id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue