Lines Matching full:trip
25 * struct __thermal_cooling_bind_param - a cooling device for a trip point
27 * @min: minimum cooling state used at this trip point
28 * @max: maximum cooling state used at this trip point
38 * struct __thermal_bind_param - a match between trip and cooling device
41 * @trip_id: the trip point index
58 * @ntrips: number of trip points
59 * @trips: an array of trip points (0..ntrips - 1)
72 /* trip data */
110 * of_thermal_get_ntrips - function to export number of available trip
114 * This function is a globally visible wrapper to get number of trip points
117 * Return: number of available trip points, -ENODEV when data not available
131 * of_thermal_is_trip_valid - function to check if trip point is valid
134 * @trip: trip point to evaluate
136 * This function is responsible for checking if passed trip point is valid
138 * Return: true if trip point is valid, false otherwise
140 bool of_thermal_is_trip_valid(struct thermal_zone_device *tz, int trip) in of_thermal_is_trip_valid() argument
144 if (!data || trip >= data->ntrips || trip < 0) in of_thermal_is_trip_valid()
153 * trip points
157 * This function provides a pointer to trip points table
159 * Return: pointer to trip points table, NULL otherwise
192 static int of_thermal_get_trend(struct thermal_zone_device *tz, int trip, in of_thermal_get_trend() argument
200 return data->ops->get_trend(data->sensor_data, trip, trend); in of_thermal_get_trend()
270 static int of_thermal_get_trip_type(struct thermal_zone_device *tz, int trip, in of_thermal_get_trip_type() argument
275 if (trip >= data->ntrips || trip < 0) in of_thermal_get_trip_type()
278 *type = data->trips[trip].type; in of_thermal_get_trip_type()
283 static int of_thermal_get_trip_temp(struct thermal_zone_device *tz, int trip, in of_thermal_get_trip_temp() argument
288 if (trip >= data->ntrips || trip < 0) in of_thermal_get_trip_temp()
291 *temp = data->trips[trip].temperature; in of_thermal_get_trip_temp()
296 static int of_thermal_set_trip_temp(struct thermal_zone_device *tz, int trip, in of_thermal_set_trip_temp() argument
301 if (trip >= data->ntrips || trip < 0) in of_thermal_set_trip_temp()
307 ret = data->ops->set_trip_temp(data->sensor_data, trip, temp); in of_thermal_set_trip_temp()
312 /* thermal framework should take care of data->mask & (1 << trip) */ in of_thermal_set_trip_temp()
313 data->trips[trip].temperature = temp; in of_thermal_set_trip_temp()
318 static int of_thermal_get_trip_hyst(struct thermal_zone_device *tz, int trip, in of_thermal_get_trip_hyst() argument
323 if (trip >= data->ntrips || trip < 0) in of_thermal_get_trip_hyst()
326 *hyst = data->trips[trip].hysteresis; in of_thermal_get_trip_hyst()
331 static int of_thermal_set_trip_hyst(struct thermal_zone_device *tz, int trip, in of_thermal_set_trip_hyst() argument
336 if (trip >= data->ntrips || trip < 0) in of_thermal_set_trip_hyst()
339 /* thermal framework should take care of data->mask & (1 << trip) */ in of_thermal_set_trip_hyst()
340 data->trips[trip].hysteresis = hyst; in of_thermal_set_trip_hyst()
660 * @trips: array of thermal zone trip points
661 * @ntrips: number of trip points inside trips.
665 * It needs the already parsed array of trip points of the thermal zone
677 struct device_node *trip; in thermal_of_populate_bind_params() local
687 trip = of_parse_phandle(np, "trip", 0); in thermal_of_populate_bind_params()
688 if (!trip) { in thermal_of_populate_bind_params()
689 pr_err("missing trip property\n"); in thermal_of_populate_bind_params()
695 if (trip == trips[i].np) { in thermal_of_populate_bind_params()
744 of_node_put(trip); in thermal_of_populate_bind_params()
751 * into the device tree binding of 'trip', property type.
763 * @type: Pointer to resulting trip type
765 * The function gets trip type string from property 'type',
790 * thermal_of_populate_trip - parse and fill one trip point data
791 * @np: DT node containing a trip point node
792 * @trip: trip point data structure to be filled up
794 * This function parses a trip point type of node represented by
795 * @np parameter and fills the read data into @trip data structure.
800 struct thermal_trip *trip) in thermal_of_populate_trip() argument
810 trip->temperature = prop; in thermal_of_populate_trip()
817 trip->hysteresis = prop; in thermal_of_populate_trip()
819 ret = thermal_of_get_trip_type(np, &trip->type); in thermal_of_populate_trip()
821 pr_err("wrong trip type property\n"); in thermal_of_populate_trip()
826 trip->np = np; in thermal_of_populate_trip()