aboutsummaryrefslogtreecommitdiff
path: root/hw/sensor/tmp105.c
AgeCommit message (Collapse)AuthorFilesLines
2024-09-13hw/sensor/tmp105: Lower 4 bit of limit registers are always 0Guenter Roeck1-1/+1
Per datasheet, "HIGH AND LOW LIMIT REGISTERS", the lower 4 bit of the limit registers are unused and always report 0. The lower 4 bit should not be used for temperature comparisons, so mask the unused bits before storing the limits. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20240906154911.86803-6-philmd@linaro.org> [PMD: Update tests/qtest/ files] Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2024-09-13hw/sensor/tmp105: OS (one-shot) bit in config register always returns 0Philippe Mathieu-Daudé1-7/+3
Per datasheet, "ONE-SHOT (OS)", the OS bit always returns 0 when reading the configuration register. Clear the ONE_SHOT bit in the WRITE path. Now than the READ path is simpler, we can also simplify tmp105_alarm_update(). Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20240906154911.86803-5-philmd@linaro.org>
2024-09-13hw/sensor/tmp105: Pass 'oneshot' argument to tmp105_alarm_update()Philippe Mathieu-Daudé1-5/+5
The next commit will clear the ONE_SHOT bit in the WRITE path (to keep the READ path trivial). As a preliminary step, pass the 'oneshot' value as argument to tmp105_alarm_update(). No logical change intended. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Message-Id: <20240906154911.86803-4-philmd@linaro.org>
2024-09-13hw/sensor/tmp105: Use registerfields APIPhilippe Mathieu-Daudé1-11/+19
To improve readability, use the registerfields API. Define the register bits with FIELD(), and use the FIELD_EX8() and FIELD_DP8() macros. Remove the abbreviations in comments. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Message-Id: <20240906154911.86803-3-philmd@linaro.org>
2024-09-13hw/sensor/tmp105: Coding style fixesGuenter Roeck1-20/+24
Coding style asks for no space between variable and "++". The next patch in this series will change one of those assignments. Instead of changing just one with that patch, change all of them for consistency. While at it, also fix other coding style problems reported by checkpatch. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20240906154911.86803-2-philmd@linaro.org>
2023-12-30hw/sensor: Constify VMStateRichard Henderson1-3/+3
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20231221031652.119827-54-richard.henderson@linaro.org>
2021-06-17sensor: Move hardware sensors from misc to a sensor directoryCorey Minyard1-0/+328
Lots of this are expected to be coming in, create a directory for them. Also move the tmp105.h file into the include directory where it should be. Cc: Cédric Le Goater <clg@kaod.org> Cc: Peter Maydell <peter.maydell@linaro.org> Cc: Andrew Jeffery <andrew@aj.id.au> Cc: Joel Stanley <joel@jms.id.au> Cc: Andrzej Zaborowski <balrogg@gmail.com> Cc: qemu-arm@nongnu.org Signed-off-by: Corey Minyard <cminyard@mvista.com> Acked-by: Cédric Le Goater <clg@kaod.org>