eeprom: ee1004: add support for temperature sensor
authorHeiner Kallweit <hkallweit1@gmail.com>
Tue, 19 Dec 2023 22:09:48 +0000 (23:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Jan 2024 16:01:14 +0000 (17:01 +0100)
commit393bd1000f8192fcf5fa4abc1e79c0919c123e9b
tree62ab5b3cee226d349bacf4ce5b49d14306fc3ef2
parenta6c7e0146b2db55531f9c48408daf7bcb07e4b0e
eeprom: ee1004: add support for temperature sensor

The EE1004 SPD data structure advertises the presence of a thermal
sensor on a DDR4 module in byte 14, bit 7. Let's use this information
to explicitly instantiate the thermal sensor I2C client instead of
having to rely on class-based I2C probing.

The temp sensor i2c address can be derived from the SPD i2c address,
so we can directly instantiate the device and don't have to probe
for it. If the temp sensor has been instantiated already by other
means (e.g. class-based auto-detection), then the busy-check in
i2c_new_client_device will detect this.

Patch was successfully tested with a Corsair Vengeance RGB PRO
DDR4 module which comes with a thermal sensor.

Link: https://www.spinics.net/lists/linux-i2c/msg65963.html
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/aa063dfb-2a92-40ba-bdab-e972781ae84b@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/eeprom/ee1004.c