Example #1
0
static int print_status(void)
{
	int value;

	print_temps("Local", TMP432_LOCAL,
		    TMP432_LOCAL_THERM_LIMIT,
		    TMP432_LOCAL_HIGH_LIMIT_R,
		    TMP432_LOCAL_LOW_LIMIT_R);

	print_temps("Remote1", TMP432_REMOTE1,
		    TMP432_REMOTE1_THERM_LIMIT,
		    TMP432_REMOTE1_HIGH_LIMIT_R,
		    TMP432_REMOTE1_LOW_LIMIT_R);

	print_temps("Remote2", TMP432_REMOTE2,
		    TMP432_REMOTE2_THERM_LIMIT,
		    TMP432_REMOTE2_HIGH_LIMIT_R,
		    TMP432_REMOTE2_LOW_LIMIT_R);

	ccprintf("\n");

	if (raw_read8(TMP432_STATUS, &value) == EC_SUCCESS)
		ccprintf("STATUS:  %08b\n", value);

	if (raw_read8(TMP432_CONFIGURATION1_R, &value) == EC_SUCCESS)
		ccprintf("CONFIG1: %08b\n", value);

	if (raw_read8(TMP432_CONFIGURATION2_R, &value) == EC_SUCCESS)
		ccprintf("CONFIG2: %08b\n", value);

	return EC_SUCCESS;
}
Example #2
0
static void
disp_envc_status()
{
	int err;
	char *system = "SYSTEM";
	picl_nodehdl_t system_node, root;

	log_printf(dgettext(TEXT_DOMAIN,
	    "\n"
	    "=========================  Environmental Status "
	    "=========================\n\n"));

	err = picl_initialize();
	if (err != PICL_SUCCESS) {
		exit_code = PD_INTERNAL_FAILURE;
		goto err_out;
	}
	err = picl_get_root(&root);
	if (err != PICL_SUCCESS) {
		exit_code = PD_INTERNAL_FAILURE;
		goto err_out;
	}
	err = find_child_device(root, system, &system_node);
	if (err != PICL_SUCCESS) {
		exit_code = PD_INTERNAL_FAILURE;
		goto err_out;
	}

	err = print_temps(system_node);
	err |= print_keyswitch(system_node);
	err |= print_FSP_LEDS(system_node);
	err |= print_disk(system_node);
	err |= print_fans(system_node);
	err |= print_ps(system_node);

	if (err != PICL_SUCCESS)
		goto err_out;

	return;

err_out:
	log_printf(dgettext(TEXT_DOMAIN,
	    "\nEnvironmental reporting error: %s\n"),
	    picl_strerror(err));
}