{ "input-disable", PIN_CONFIG_INPUT_ENABLE, 0 },
};
+/* bitfield used to save param and value of each pin/selector */
+static unsigned int sandbox_pins_param[ARRAY_SIZE(sandbox_pins)];
+static unsigned int sandbox_pins_value[ARRAY_SIZE(sandbox_pins)];
+
static int sandbox_get_pins_count(struct udevice *dev)
{
return ARRAY_SIZE(sandbox_pins);
unsigned int selector,
char *buf, int size)
{
+ const struct pinconf_param *p;
+ int i;
+
snprintf(buf, size, "%s", sandbox_pins_muxing[selector]);
+ if (sandbox_pins_param[selector]) {
+ for (i = 0, p = sandbox_conf_params;
+ i < ARRAY_SIZE(sandbox_conf_params);
+ i++, p++) {
+ if ((sandbox_pins_param[selector] & BIT(p->param)) &&
+ (!!(sandbox_pins_value[selector] & BIT(p->param)) ==
+ p->default_value)) {
+ strncat(buf, " ", size);
+ strncat(buf, p->property, size);
+ }
+ }
+ }
+ strncat(buf, ".", size);
+
return 0;
}
pin_selector, sandbox_get_pin_name(dev, pin_selector),
func_selector, sandbox_get_function_name(dev, func_selector));
+ sandbox_pins_param[pin_selector] = 0;
+ sandbox_pins_value[pin_selector] = 0;
+
return 0;
}
pin_selector, sandbox_get_pin_name(dev, pin_selector),
param, argument);
+ sandbox_pins_param[pin_selector] |= BIT(param);
+ if (argument)
+ sandbox_pins_value[pin_selector] |= BIT(param);
+ else
+ sandbox_pins_value[pin_selector] &= ~BIT(param);
+
return 0;
}