/* get a number comprised of multiple GPIO values. gpio_num_array points to the array of gpio pin numbers to scan, terminated by -1.  */
int gpio_get_values_as_int(const int *gpio_list)
/* get a number comprised of multiple GPIO values. gpio_num_array points to the array of gpio pin numbers to scan, terminated by -1.  */
int gpio_get_values_as_int(const int *gpio_list)
{
	int gpio;
	unsigned bitmask = 1;
	unsigned vector = 0;
	int ret;
	while (bitmask &&
	       ((gpio = *gpio_list++) != -1)) {
		ret = gpio_get_value(gpio);
		if (ret < 0)
			return ret;
		else if (ret)
			vector |= bitmask;
		bitmask <<= 1;
	}
	return vector;
}