Lines Matching +full:temperature +full:- +full:sensor

1 // SPDX-License-Identifier: GPL-2.0
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()
49 int temperature; in thermal_mmio_probe() local
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 return PTR_ERR(sensor->mmio_base); in thermal_mmio_probe()
60 sensor_init_func = device_get_match_data(&pdev->dev); in thermal_mmio_probe()
62 ret = sensor_init_func(pdev, sensor); in thermal_mmio_probe()
64 dev_err(&pdev->dev, in thermal_mmio_probe()
65 "failed to initialize sensor (%d)\n", in thermal_mmio_probe()
71 thermal_zone = devm_thermal_zone_of_sensor_register(&pdev->dev, in thermal_mmio_probe()
73 sensor, in thermal_mmio_probe()
76 dev_err(&pdev->dev, in thermal_mmio_probe()
77 "failed to register sensor (%ld)\n", in thermal_mmio_probe()
82 thermal_mmio_get_temperature(sensor, &temperature); in thermal_mmio_probe()
83 dev_info(&pdev->dev, in thermal_mmio_probe()
84 "thermal mmio sensor %s registered, current temperature: %d\n", in thermal_mmio_probe()
85 pdev->name, temperature); in thermal_mmio_probe()
91 struct thermal_mmio *sensor) in al_thermal_init() argument
93 sensor->read_mmio = thermal_mmio_readb; in al_thermal_init()
94 sensor->mask = 0xff; in al_thermal_init()
95 sensor->factor = 1000; in al_thermal_init()
101 { .compatible = "amazon,al-thermal", .data = al_thermal_init},
109 .name = "thermal-mmio",