Lines Matching +full:thermal +full:- +full:sensor

1 // SPDX-License-Identifier: GPL-2.0
9 #include <linux/thermal.h>
26 struct thermal_mmio *sensor = in thermal_mmio_get_temperature() local
29 t = sensor->read_mmio(sensor->mmio_base) & sensor->mask; in thermal_mmio_get_temperature()
30 t *= sensor->factor; in thermal_mmio_get_temperature()
44 struct thermal_mmio *sensor; in thermal_mmio_probe() local
46 struct thermal_mmio *sensor); in thermal_mmio_probe()
51 sensor = devm_kzalloc(&pdev->dev, sizeof(*sensor), GFP_KERNEL); in thermal_mmio_probe()
52 if (!sensor) in thermal_mmio_probe()
53 return -ENOMEM; in thermal_mmio_probe()
56 sensor->mmio_base = devm_ioremap_resource(&pdev->dev, resource); in thermal_mmio_probe()
57 if (IS_ERR(sensor->mmio_base)) { in thermal_mmio_probe()
58 dev_err(&pdev->dev, "failed to ioremap memory (%ld)\n", in thermal_mmio_probe()
59 PTR_ERR(sensor->mmio_base)); in thermal_mmio_probe()
60 return PTR_ERR(sensor->mmio_base); in thermal_mmio_probe()
63 sensor_init_func = device_get_match_data(&pdev->dev); in thermal_mmio_probe()
65 ret = sensor_init_func(pdev, sensor); in thermal_mmio_probe()
67 dev_err(&pdev->dev, in thermal_mmio_probe()
68 "failed to initialize sensor (%d)\n", in thermal_mmio_probe()
74 thermal_zone = devm_thermal_zone_of_sensor_register(&pdev->dev, in thermal_mmio_probe()
76 sensor, in thermal_mmio_probe()
79 dev_err(&pdev->dev, in thermal_mmio_probe()
80 "failed to register sensor (%ld)\n", in thermal_mmio_probe()
85 thermal_mmio_get_temperature(sensor, &temperature); in thermal_mmio_probe()
86 dev_info(&pdev->dev, in thermal_mmio_probe()
87 "thermal mmio sensor %s registered, current temperature: %d\n", in thermal_mmio_probe()
88 pdev->name, temperature); in thermal_mmio_probe()
94 struct thermal_mmio *sensor) in al_thermal_init() argument
96 sensor->read_mmio = thermal_mmio_readb; in al_thermal_init()
97 sensor->mask = 0xff; in al_thermal_init()
98 sensor->factor = 1000; in al_thermal_init()
104 { .compatible = "amazon,al-thermal", .data = al_thermal_init},
112 .name = "thermal-mmio",
120 MODULE_DESCRIPTION("Thermal MMIO Driver");