Commit d7f080e6 authored by Eduardo Valentin's avatar Eduardo Valentin Committed by Greg Kroah-Hartman

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: default avatarEduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 648b4c6c
This diff is collapsed.
...@@ -269,8 +269,8 @@ struct omap_temp_sensor { ...@@ -269,8 +269,8 @@ struct omap_temp_sensor {
const int slope_pcb; const int slope_pcb;
const int constant_pcb; const int constant_pcb;
void *data; void *data;
int (*register_cooling)(struct omap_bandgap *bg_ptr, int id); int (*register_cooling)(struct omap_bandgap *bgp, int id);
int (*unregister_cooling)(struct omap_bandgap *bg_ptr, int id); int (*unregister_cooling)(struct omap_bandgap *bgp, int id);
}; };
/** /**
...@@ -345,27 +345,27 @@ struct omap_bandgap_data { ...@@ -345,27 +345,27 @@ struct omap_bandgap_data {
char *fclock_name; char *fclock_name;
char *div_ck_name; char *div_ck_name;
int sensor_count; int sensor_count;
int (*report_temperature)(struct omap_bandgap *bg_ptr, int id); int (*report_temperature)(struct omap_bandgap *bgp, int id);
int (*expose_sensor)(struct omap_bandgap *bg_ptr, int id, char *domain); int (*expose_sensor)(struct omap_bandgap *bgp, int id, char *domain);
int (*remove_sensor)(struct omap_bandgap *bg_ptr, int id); int (*remove_sensor)(struct omap_bandgap *bgp, int id);
/* this needs to be at the end */ /* this needs to be at the end */
struct omap_temp_sensor sensors[]; struct omap_temp_sensor sensors[];
}; };
int omap_bandgap_read_thot(struct omap_bandgap *bg_ptr, int id, int *thot); int omap_bandgap_read_thot(struct omap_bandgap *bgp, int id, int *thot);
int omap_bandgap_write_thot(struct omap_bandgap *bg_ptr, int id, int val); int omap_bandgap_write_thot(struct omap_bandgap *bgp, int id, int val);
int omap_bandgap_read_tcold(struct omap_bandgap *bg_ptr, int id, int *tcold); int omap_bandgap_read_tcold(struct omap_bandgap *bgp, int id, int *tcold);
int omap_bandgap_write_tcold(struct omap_bandgap *bg_ptr, int id, int val); int omap_bandgap_write_tcold(struct omap_bandgap *bgp, int id, int val);
int omap_bandgap_read_update_interval(struct omap_bandgap *bg_ptr, int id, int omap_bandgap_read_update_interval(struct omap_bandgap *bgp, int id,
int *interval); 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); 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 *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 *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 #ifdef CONFIG_OMAP4_THERMAL
extern const struct omap_bandgap_data omap4430_data; extern const struct omap_bandgap_data omap4430_data;
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
struct omap_thermal_data { struct omap_thermal_data {
struct thermal_zone_device *omap_thermal; struct thermal_zone_device *omap_thermal;
struct thermal_cooling_device *cool_dev; struct thermal_cooling_device *cool_dev;
struct omap_bandgap *bg_ptr; struct omap_bandgap *bgp;
enum thermal_device_mode mode; enum thermal_device_mode mode;
struct work_struct thermal_wq; struct work_struct thermal_wq;
int sensor_id; int sensor_id;
...@@ -78,17 +78,17 @@ static inline int omap_thermal_get_temp(struct thermal_zone_device *thermal, ...@@ -78,17 +78,17 @@ static inline int omap_thermal_get_temp(struct thermal_zone_device *thermal,
unsigned long *temp) unsigned long *temp)
{ {
struct omap_thermal_data *data = thermal->devdata; struct omap_thermal_data *data = thermal->devdata;
struct omap_bandgap *bg_ptr; struct omap_bandgap *bgp;
struct omap_temp_sensor *s; struct omap_temp_sensor *s;
int ret, tmp, pcb_temp, slope, constant; int ret, tmp, pcb_temp, slope, constant;
if (!data) if (!data)
return 0; return 0;
bg_ptr = data->bg_ptr; bgp = data->bgp;
s = &bg_ptr->conf->sensors[data->sensor_id]; 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) if (ret)
return ret; return ret;
...@@ -236,32 +236,32 @@ static struct thermal_zone_device_ops omap_thermal_ops = { ...@@ -236,32 +236,32 @@ static struct thermal_zone_device_ops omap_thermal_ops = {
}; };
static struct omap_thermal_data 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; 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) { if (!data) {
dev_err(bg_ptr->dev, "kzalloc fail\n"); dev_err(bgp->dev, "kzalloc fail\n");
return NULL; return NULL;
} }
data->sensor_id = id; data->sensor_id = id;
data->bg_ptr = bg_ptr; data->bgp = bgp;
data->mode = THERMAL_DEVICE_ENABLED; data->mode = THERMAL_DEVICE_ENABLED;
INIT_WORK(&data->thermal_wq, omap_thermal_work); INIT_WORK(&data->thermal_wq, omap_thermal_work);
return data; 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) char *domain)
{ {
struct omap_thermal_data *data; 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)) if (IS_ERR_OR_NULL(data))
data = omap_thermal_build_data(bg_ptr, id); data = omap_thermal_build_data(bgp, id);
if (!data) if (!data)
return -EINVAL; return -EINVAL;
...@@ -273,44 +273,44 @@ int omap_thermal_expose_sensor(struct omap_bandgap *bg_ptr, int id, ...@@ -273,44 +273,44 @@ int omap_thermal_expose_sensor(struct omap_bandgap *bg_ptr, int id,
NULL, FAST_TEMP_MONITORING_RATE, NULL, FAST_TEMP_MONITORING_RATE,
FAST_TEMP_MONITORING_RATE); FAST_TEMP_MONITORING_RATE);
if (IS_ERR_OR_NULL(data->omap_thermal)) { 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); return PTR_ERR(data->omap_thermal);
} }
data->omap_thermal->polling_delay = FAST_TEMP_MONITORING_RATE; 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; 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; 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); thermal_zone_device_unregister(data->omap_thermal);
return 0; 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; 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); schedule_work(&data->thermal_wq);
return 0; 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; 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)) if (IS_ERR_OR_NULL(data))
data = omap_thermal_build_data(bg_ptr, id); data = omap_thermal_build_data(bgp, id);
if (!data) if (!data)
return -EINVAL; return -EINVAL;
...@@ -318,20 +318,20 @@ int omap_thermal_register_cpu_cooling(struct omap_bandgap *bg_ptr, int id) ...@@ -318,20 +318,20 @@ int omap_thermal_register_cpu_cooling(struct omap_bandgap *bg_ptr, int id)
/* Register cooling device */ /* Register cooling device */
data->cool_dev = cpufreq_cooling_register(cpu_present_mask); data->cool_dev = cpufreq_cooling_register(cpu_present_mask);
if (IS_ERR_OR_NULL(data->cool_dev)) { if (IS_ERR_OR_NULL(data->cool_dev)) {
dev_err(bg_ptr->dev, dev_err(bgp->dev,
"Failed to register cpufreq cooling device\n"); "Failed to register cpufreq cooling device\n");
return PTR_ERR(data->cool_dev); 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; 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; 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); cpufreq_cooling_unregister(data->cool_dev);
return 0; return 0;
......
...@@ -74,33 +74,33 @@ ...@@ -74,33 +74,33 @@
((trip) >= 0 && (trip) < OMAP_TRIP_NUMBER) ((trip) >= 0 && (trip) < OMAP_TRIP_NUMBER)
#ifdef CONFIG_OMAP_THERMAL #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); char *domain);
int omap_thermal_remove_sensor(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 *bg_ptr, int id); int omap_thermal_register_cpu_cooling(struct omap_bandgap *bgp, int id);
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);
#else #else
static inline 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) char *domain)
{ {
return 0; return 0;
} }
static inline 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; return 0;
} }
static inline 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; return 0;
} }
static inline 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; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment