Date: Sun, 6 Nov 2016 15:25:46 +0000 (UTC) From: Michal Meloun <mmel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308374 - stable/11/sys/arm/nvidia/tegra124 Message-ID: <201611061525.uA6FPkm7014413@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mmel Date: Sun Nov 6 15:25:46 2016 New Revision: 308374 URL: https://svnweb.freebsd.org/changeset/base/308374 Log: MFC r306551,r307557: r306551: TEGRA: Fix bindings for cpufreq and coretemp drivers, it was broken in r306477. Correct a description for coretemp driver. r307557: TEGRA: Attach cpufreq and coretemp drivers only on tegra124 SoC. It's needed by GENERIC kernel. Modified: stable/11/sys/arm/nvidia/tegra124/tegra124_coretemp.c stable/11/sys/arm/nvidia/tegra124/tegra124_cpufreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/nvidia/tegra124/tegra124_coretemp.c ============================================================================== --- stable/11/sys/arm/nvidia/tegra124/tegra124_coretemp.c Sun Nov 6 15:12:05 2016 (r308373) +++ stable/11/sys/arm/nvidia/tegra124/tegra124_coretemp.c Sun Nov 6 15:25:46 2016 (r308374) @@ -178,7 +178,11 @@ tegra124_coretemp_ofw_parse(struct tegra static void tegra124_coretemp_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_find_child(parent, "tegra124_coretemp", -1) != NULL) return; if (BUS_ADD_CHILD(parent, 0, "tegra124_coretemp", -1) == NULL) @@ -189,7 +193,7 @@ static int tegra124_coretemp_probe(device_t dev) { - device_set_desc(dev, "CPU Frequency Control"); + device_set_desc(dev, "CPU Thermal Sensor"); return (0); } @@ -262,7 +266,7 @@ static device_method_t tegra124_coretemp }; 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); Modified: stable/11/sys/arm/nvidia/tegra124/tegra124_cpufreq.c ============================================================================== --- stable/11/sys/arm/nvidia/tegra124/tegra124_cpufreq.c Sun Nov 6 15:12:05 2016 (r308373) +++ stable/11/sys/arm/nvidia/tegra124/tegra124_cpufreq.c Sun Nov 6 15:25:46 2016 (r308374) @@ -474,7 +474,14 @@ get_fdt_resources(struct tegra124_cpufre 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; if (device_find_child(parent, "tegra124_cpufreq", -1) != NULL) return; if (BUS_ADD_CHILD(parent, 0, "tegra124_cpufreq", -1) == NULL) @@ -485,8 +492,6 @@ static int tegra124_cpufreq_probe(device_t dev) { - if (device_get_unit(dev) != 0) - return (ENXIO); device_set_desc(dev, "CPU Frequency Control"); return (0); @@ -587,7 +592,7 @@ static device_method_t tegra124_cpufreq_ }; static devclass_t tegra124_cpufreq_devclass; -static DEFINE_CLASS_0(cpufreq, tegra124_cpufreq_driver, +static DEFINE_CLASS_0(tegra124_cpufreq, tegra124_cpufreq_driver, tegra124_cpufreq_methods, sizeof(struct tegra124_cpufreq_softc)); DRIVER_MODULE(tegra124_cpufreq, cpu, tegra124_cpufreq_driver, tegra124_cpufreq_devclass, NULL, NULL);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611061525.uA6FPkm7014413>