Path: blob/master/arch/powerpc/sysdev/mpc5xxx_clocks.c
10817 views
/**1* mpc5xxx_get_bus_frequency - Find the bus frequency for a device2* @node: device node3*4* Returns bus frequency (IPS on MPC512x, IPB on MPC52xx),5* or 0 if the bus frequency cannot be found.6*/78#include <linux/kernel.h>9#include <linux/of_platform.h>1011unsigned int12mpc5xxx_get_bus_frequency(struct device_node *node)13{14struct device_node *np;15const unsigned int *p_bus_freq = NULL;1617of_node_get(node);18while (node) {19p_bus_freq = of_get_property(node, "bus-frequency", NULL);20if (p_bus_freq)21break;2223np = of_get_parent(node);24of_node_put(node);25node = np;26}27if (node)28of_node_put(node);2930return p_bus_freq ? *p_bus_freq : 0;31}32EXPORT_SYMBOL(mpc5xxx_get_bus_frequency);333435