Maxim Polyakov has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47861 )
Change subject: drivers/i2c/nct7802y: Move the sensor initialization procedure ......................................................................
drivers/i2c/nct7802y: Move the sensor initialization procedure
Current place for the sensor initialization procedure was chosen unsuccessfully. Move it to the main driver file - nct7802y.c .
Change-Id: I093ae75db5f0051bff65375b0720c86642b9148a Signed-off-by: Maxim Polyakov m.polyakov@yadro.com --- M src/drivers/i2c/nct7802y/nct7802y.c M src/drivers/i2c/nct7802y/nct7802y_fan.c 2 files changed, 16 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/47861/1
diff --git a/src/drivers/i2c/nct7802y/nct7802y.c b/src/drivers/i2c/nct7802y/nct7802y.c index 5057890..8b4bdab 100644 --- a/src/drivers/i2c/nct7802y/nct7802y.c +++ b/src/drivers/i2c/nct7802y/nct7802y.c @@ -2,10 +2,25 @@
#include <console/console.h> #include <device/device.h> +#include <types.h>
#include "nct7802y.h" #include "chip.h"
+void nct7802y_init_sensors(struct device *const dev) +{ + const struct drivers_i2c_nct7802y_config *const config = dev->chip_info; + unsigned int i; + u8 value; + + value = 0; + for (i = 0; i < NCT7802Y_RTD_CNT; ++i) + value |= MODE_SELECTION_RTDx(i, config->sensors.rtd[i]); + if (config->sensors.local_enable) + value |= MODE_SELECTION_LTD_EN; + nct7802y_write(dev, MODE_SELECTION, value); +} + static void nct7802y_init(struct device *const dev) { if (!dev->chip_info) { @@ -15,6 +30,7 @@ }
nct7802y_init_peci(dev); + nct7802y_init_sensors(dev); nct7802y_init_fan(dev); }
diff --git a/src/drivers/i2c/nct7802y/nct7802y_fan.c b/src/drivers/i2c/nct7802y/nct7802y_fan.c index a608802..bfe3a91 100644 --- a/src/drivers/i2c/nct7802y/nct7802y_fan.c +++ b/src/drivers/i2c/nct7802y/nct7802y_fan.c @@ -78,13 +78,6 @@ init_fan(dev, &config->fan[i], i); }
- value = 0; - for (i = 0; i < NCT7802Y_RTD_CNT; ++i) - value |= MODE_SELECTION_RTDx(i, config->sensors.rtd[i]); - if (config->sensors.local_enable) - value |= MODE_SELECTION_LTD_EN; - nct7802y_write(dev, MODE_SELECTION, value); - switch (config->on_pecierror) { case PECI_ERROR_KEEP: value = CLOSE_LOOP_FAN_PECI_ERR_CURR;
Maxim Polyakov has uploaded a new patch set (#2). ( https://review.coreboot.org/c/coreboot/+/47861 )
Change subject: drivers/i2c/nct7802y: Move the sensor initialization procedure ......................................................................
drivers/i2c/nct7802y: Move the sensor initialization procedure
The current location for the sensor initialization procedure was chosen by mistake. Move this into a separate function in nct7802y.c .
Change-Id: I093ae75db5f0051bff65375b0720c86642b9148a Signed-off-by: Maxim Polyakov m.polyakov@yadro.com --- M src/drivers/i2c/nct7802y/nct7802y.c M src/drivers/i2c/nct7802y/nct7802y_fan.c 2 files changed, 16 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/47861/2
Maxim Polyakov has uploaded a new patch set (#3). ( https://review.coreboot.org/c/coreboot/+/47861 )
Change subject: drivers/i2c/nct7802y: Move the sensor initialization procedure ......................................................................
drivers/i2c/nct7802y: Move the sensor initialization procedure
The current location for the sensor initialization procedure was chosen by mistake. Move this into a separate function in nct7802y.c .
Change-Id: I093ae75db5f0051bff65375b0720c86642b9148a Signed-off-by: Maxim Polyakov max.senia.poliak@gmail.com --- M src/drivers/i2c/nct7802y/nct7802y.c M src/drivers/i2c/nct7802y/nct7802y_fan.c 2 files changed, 16 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/47861/3
Maxim Polyakov has uploaded a new patch set (#4). ( https://review.coreboot.org/c/coreboot/+/47861 )
Change subject: drivers/i2c/nct7802y: Move the sensor initialization procedure ......................................................................
drivers/i2c/nct7802y: Move the sensor initialization procedure
The current location for the sensor initialization procedure was chosen by mistake. Move this into a separate function in nct7802y.c .
Change-Id: I093ae75db5f0051bff65375b0720c86642b9148a Signed-off-by: Maxim Polyakov max.senia.poliak@gmail.com --- M src/drivers/i2c/nct7802y/nct7802y.c M src/drivers/i2c/nct7802y/nct7802y_fan.c 2 files changed, 16 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/47861/4
Maxim Polyakov has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47861 )
Change subject: drivers/i2c/nct7802y: Move the sensor initialization procedure ......................................................................
Patch Set 4:
Sorry, I didn't notice your comment in CB:39766
Hello build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/47861
to look at the new patch set (#5).
Change subject: drivers/i2c/nct7802y: Move the sensor initialization procedure ......................................................................
drivers/i2c/nct7802y: Move the sensor initialization procedure
The current location for the sensor initialization procedure was chosen by mistake. Move this into a separate function in nct7802y.c .
Change-Id: I093ae75db5f0051bff65375b0720c86642b9148a Signed-off-by: Maxim Polyakov max.senia.poliak@gmail.com --- M src/drivers/i2c/nct7802y/nct7802y.c M src/drivers/i2c/nct7802y/nct7802y_fan.c 2 files changed, 15 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/47861/5
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47861 )
Change subject: drivers/i2c/nct7802y: Move the sensor initialization procedure ......................................................................
Patch Set 5: Code-Review+2
Thanks!
Nico Huber has submitted this change. ( https://review.coreboot.org/c/coreboot/+/47861 )
Change subject: drivers/i2c/nct7802y: Move the sensor initialization procedure ......................................................................
drivers/i2c/nct7802y: Move the sensor initialization procedure
The current location for the sensor initialization procedure was chosen by mistake. Move this into a separate function in nct7802y.c .
Change-Id: I093ae75db5f0051bff65375b0720c86642b9148a Signed-off-by: Maxim Polyakov max.senia.poliak@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/47861 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Nico Huber nico.h@gmx.de --- M src/drivers/i2c/nct7802y/nct7802y.c M src/drivers/i2c/nct7802y/nct7802y_fan.c 2 files changed, 15 insertions(+), 7 deletions(-)
Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved
diff --git a/src/drivers/i2c/nct7802y/nct7802y.c b/src/drivers/i2c/nct7802y/nct7802y.c index 5057890..bb52a3f 100644 --- a/src/drivers/i2c/nct7802y/nct7802y.c +++ b/src/drivers/i2c/nct7802y/nct7802y.c @@ -2,10 +2,24 @@
#include <console/console.h> #include <device/device.h> +#include <types.h>
#include "nct7802y.h" #include "chip.h"
+static void nct7802y_init_sensors(struct device *const dev) +{ + const struct drivers_i2c_nct7802y_config *const config = dev->chip_info; + unsigned int i; + u8 value = 0; + + for (i = 0; i < NCT7802Y_RTD_CNT; ++i) + value |= MODE_SELECTION_RTDx(i, config->sensors.rtd[i]); + if (config->sensors.local_enable) + value |= MODE_SELECTION_LTD_EN; + nct7802y_write(dev, MODE_SELECTION, value); +} + static void nct7802y_init(struct device *const dev) { if (!dev->chip_info) { @@ -15,6 +29,7 @@ }
nct7802y_init_peci(dev); + nct7802y_init_sensors(dev); nct7802y_init_fan(dev); }
diff --git a/src/drivers/i2c/nct7802y/nct7802y_fan.c b/src/drivers/i2c/nct7802y/nct7802y_fan.c index a608802..bfe3a91 100644 --- a/src/drivers/i2c/nct7802y/nct7802y_fan.c +++ b/src/drivers/i2c/nct7802y/nct7802y_fan.c @@ -78,13 +78,6 @@ init_fan(dev, &config->fan[i], i); }
- value = 0; - for (i = 0; i < NCT7802Y_RTD_CNT; ++i) - value |= MODE_SELECTION_RTDx(i, config->sensors.rtd[i]); - if (config->sensors.local_enable) - value |= MODE_SELECTION_LTD_EN; - nct7802y_write(dev, MODE_SELECTION, value); - switch (config->on_pecierror) { case PECI_ERROR_KEEP: value = CLOSE_LOOP_FAN_PECI_ERR_CURR;