TEGRA: Attach cpufreq and coretemp drivers only on tegra124 SoC.
It's needed by GENERIC kernel. MFC after: 2 weeks
This commit is contained in:
parent
69c48a2805
commit
4d517b66a0
@ -178,10 +178,14 @@ tegra124_coretemp_ofw_parse(struct tegra124_coretemp_softc *sc)
|
||||
static void
|
||||
tegra124_coretemp_identify(driver_t *driver, device_t parent)
|
||||
{
|
||||
phandle_t root;
|
||||
|
||||
if (device_find_child(parent, "coretemp", -1) != NULL)
|
||||
root = OF_finddevice("/");
|
||||
if (!ofw_bus_node_is_compatible(root, "nvidia,tegra124"))
|
||||
return;
|
||||
if (BUS_ADD_CHILD(parent, 0, "coretemp", -1) == NULL)
|
||||
if (device_find_child(parent, "tegra124_coretemp", -1) != NULL)
|
||||
return;
|
||||
if (BUS_ADD_CHILD(parent, 0, "tegra124_coretemp", -1) == NULL)
|
||||
device_printf(parent, "add child failed\n");
|
||||
}
|
||||
|
||||
@ -262,7 +266,7 @@ static device_method_t tegra124_coretemp_methods[] = {
|
||||
};
|
||||
|
||||
static devclass_t tegra124_coretemp_devclass;
|
||||
static DEFINE_CLASS_0(coretemp, tegra124_coretemp_driver,
|
||||
static DEFINE_CLASS_0(tegra124_coretemp, tegra124_coretemp_driver,
|
||||
tegra124_coretemp_methods, sizeof(struct tegra124_coretemp_softc));
|
||||
DRIVER_MODULE(tegra124_coretemp, cpu, tegra124_coretemp_driver,
|
||||
tegra124_coretemp_devclass, NULL, NULL);
|
||||
|
@ -475,6 +475,11 @@ get_fdt_resources(struct tegra124_cpufreq_softc *sc, phandle_t node)
|
||||
static void
|
||||
tegra124_cpufreq_identify(driver_t *driver, device_t parent)
|
||||
{
|
||||
phandle_t root;
|
||||
|
||||
root = OF_finddevice("/");
|
||||
if (!ofw_bus_node_is_compatible(root, "nvidia,tegra124"))
|
||||
return;
|
||||
|
||||
if (device_get_unit(parent) != 0)
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user