diff options
author | Nico Huber <nico.huber@secunet.com> | 2017-08-23 16:53:31 +0200 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2019-03-14 18:28:11 +0000 |
commit | a3f643a3c0b350703d2531bb54530b102fe68caf (patch) | |
tree | a85e69d4d21f939602d1e2aa1192ed4dbd2aae7c /src/drivers/i2c/nct7802y/nct7802y.c | |
parent | 9421727c708e6b30831a24c190938ea2951a771b (diff) | |
download | coreboot-a3f643a3c0b350703d2531bb54530b102fe68caf.tar.xz |
drivers/i2c/nct7802y: Add new hardware-monitoring IC
Just another hardware-monitoring chip. Only limited fan control and PECI
configuration is implemented.
Change-Id: I35ea79e12941804e398c6304a08170a776f4ca76
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/29475
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'src/drivers/i2c/nct7802y/nct7802y.c')
-rw-r--r-- | src/drivers/i2c/nct7802y/nct7802y.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/drivers/i2c/nct7802y/nct7802y.c b/src/drivers/i2c/nct7802y/nct7802y.c new file mode 100644 index 0000000000..3681383610 --- /dev/null +++ b/src/drivers/i2c/nct7802y/nct7802y.c @@ -0,0 +1,49 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2017 secunet Security Networks AG + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <console/console.h> +#include <device/device.h> + +#include "nct7802y.h" +#include "chip.h" + +static void nct7802y_init(struct device *const dev) +{ + if (!dev->chip_info) { + printk(BIOS_WARNING, + "NCT7802Y driver selected but not configured."); + return; + } + + nct7802y_init_peci(dev); + nct7802y_init_fan(dev); +} + +static struct device_operations nct7802y_ops = { + .read_resources = DEVICE_NOOP, + .set_resources = DEVICE_NOOP, + .enable_resources = DEVICE_NOOP, + .init = nct7802y_init, +}; + +static void nct7802y_enable(struct device *const dev) +{ + dev->ops = &nct7802y_ops; +} + +struct chip_operations drivers_i2c_nct7802y_ops = { + CHIP_NAME("NCT7802Y") + .enable_dev = nct7802y_enable +}; |