fdt_pinctrl: Add some TSLOG annotations

While we see the time spent in the pin controller attach via the hooks in
DEVICE_ATTACH, it is useful to see the time spent configuring the pins.
This commit is contained in:
Emmanuel Vadot 2018-07-19 11:41:53 +00:00
parent 41a76289e6
commit 413d07ea3e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=336479
2 changed files with 21 additions and 1 deletions

View File

@ -106,10 +106,15 @@ int
fdt_pinctrl_register(device_t pinctrl, const char *pinprop)
{
phandle_t node;
int ret;
TSENTER();
node = ofw_bus_get_node(pinctrl);
OF_device_register_xref(OF_xref_from_node(node), pinctrl);
return (pinctrl_register_children(pinctrl, node, pinprop));
ret = pinctrl_register_children(pinctrl, node, pinprop);
TSEXIT();
return (ret);
}
static int
@ -118,6 +123,8 @@ pinctrl_configure_children(device_t pinctrl, phandle_t parent)
phandle_t node, *configs;
int i, nconfigs;
TSENTER();
for (node = OF_child(parent); node != 0; node = OF_peer(node)) {
if (!ofw_bus_node_status_okay(node))
continue;
@ -138,6 +145,7 @@ pinctrl_configure_children(device_t pinctrl, phandle_t parent)
}
OF_prop_free(configs);
}
TSEXIT();
return (0);
}

View File

@ -27,6 +27,7 @@
#
#include <sys/types.h>
#include <sys/bus.h>
#include <dev/ofw/openfirm.h>
#
@ -35,11 +36,22 @@
INTERFACE fdt_pinctrl;
# Needed for timestamping device probe/attach calls
HEADER {
#include <sys/tslog.h>
}
#
# Set pins to the specified configuration. The cfgxref arg is an xref phandle
# to a descendent node (child, grandchild, ...) of the pinctrl device node.
# Returns 0 on success or a standard errno value.
#
PROLOG {
TSENTER2(device_get_name(pinctrl));
}
EPILOG {
TSEXIT2(device_get_name(pinctrl));
}
METHOD int configure {
device_t pinctrl;
phandle_t cfgxref;