コード例 #1
0
static int acpi_thermal_get_info(struct acpi_thermal *tz)
{
	int result = 0;


	if (!tz)
		return -EINVAL;

	/* Get trip points [_CRT, _PSV, etc.] (required) */
	result = acpi_thermal_get_trip_points(tz);
	if (result)
		return result;

	/* Get temperature [_TMP] (required) */
	result = acpi_thermal_get_temperature(tz);
	if (result)
		return result;

	/* Set the cooling mode [_SCP] to active cooling (default) */
	result = acpi_thermal_set_cooling_mode(tz, ACPI_THERMAL_MODE_ACTIVE);
	if (!result)
		tz->flags.cooling_mode = 1;

	/* Get default polling frequency [_TZP] (optional) */
	if (tzp)
		tz->polling_frequency = tzp;
	else
		acpi_thermal_get_polling_frequency(tz);

	return 0;
}
コード例 #2
0
ファイル: thermal.c プロジェクト: PyroOS/Pyro
static int
acpi_thermal_get_info (
	struct acpi_thermal	*tz)
{
	int			result = 0;

	ACPI_FUNCTION_TRACE("acpi_thermal_get_info");

	if (!tz)
		return_VALUE(-EINVAL);

	/* Get temperature [_TMP] (required) */
	result = acpi_thermal_get_temperature(tz);
	if (result)
		return_VALUE(result);

	/* Get trip points [_CRT, _PSV, etc.] (required) */
	result = acpi_thermal_get_trip_points(tz);
	if (result)
		return_VALUE(result);

	/* Set the cooling mode [_SCP] to active cooling (default) */
	result = acpi_thermal_set_cooling_mode(tz, ACPI_THERMAL_MODE_ACTIVE);
	if (!result) 
		tz->flags.cooling_mode = 1;
	else { 
		/* Oh,we have not _SCP method.
		   Generally show cooling_mode by _ACx, _PSV,spec 12.2*/
		tz->flags.cooling_mode = 0;
		if ( tz->trips.active[0].flags.valid && tz->trips.passive.flags.valid ) {
			if ( tz->trips.passive.temperature > tz->trips.active[0].temperature )
				tz->cooling_mode = ACPI_THERMAL_MODE_ACTIVE;
			else 
				tz->cooling_mode = ACPI_THERMAL_MODE_PASSIVE;
		} else if ( !tz->trips.active[0].flags.valid && tz->trips.passive.flags.valid ) {
			tz->cooling_mode = ACPI_THERMAL_MODE_PASSIVE;
		} else if ( tz->trips.active[0].flags.valid && !tz->trips.passive.flags.valid ) {
			tz->cooling_mode = ACPI_THERMAL_MODE_ACTIVE;
		} else {
			/* _ACx and _PSV are optional, but _CRT is required */
			tz->cooling_mode = ACPI_THERMAL_MODE_CRITICAL;
		}
	}

	/* Get default polling frequency [_TZP] (optional) */
	acpi_thermal_get_polling_frequency(tz);

	/* Get devices in this thermal zone [_TZD] (optional) */
	result = acpi_thermal_get_devices(tz);
	if (!result)
		tz->flags.devices = 1;

	return_VALUE(0);
}
コード例 #3
0
static int
acpi_thermal_get_info (
	struct acpi_thermal	*tz)
{
	int			result = 0;

	ACPI_FUNCTION_TRACE("acpi_thermal_get_info");

	if (!tz)
		return_VALUE(-EINVAL);

	/* Get temperature [_TMP] (required) */
	result = acpi_thermal_get_temperature(tz);
	if (result)
		return_VALUE(result);

	/* Set the cooling mode [_SCP] to active cooling (default) */
	result = acpi_thermal_set_cooling_mode(tz, ACPI_THERMAL_MODE_ACTIVE);
	if (!result)
		tz->flags.cooling_mode = 1;

	/* Get trip points [_CRT, _PSV, etc.] (required) */
	result = acpi_thermal_get_trip_points(tz);
	if (result)
		return_VALUE(result);

	/* Get default polling frequency [_TZP] (optional) */
	if (tzp)
		tz->polling_frequency = tzp;
	else
		acpi_thermal_get_polling_frequency(tz);

	/* Get devices in this thermal zone [_TZD] (optional) */
	result = acpi_thermal_get_devices(tz);
	if (!result)
		tz->flags.devices = 1;

	return_VALUE(0);
}