lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 13 Aug 2019 01:52:37 +0200
From:   Max Staudt <max@...as.org>
To:     linux-i2c@...r.kernel.org, linux-hwmon@...r.kernel.org,
        Wolfram Sang <wsa+renesas@...g-engineering.com>,
        Jean Delvare <jdelvare@...e.com>,
        Guenter Roeck <linux@...ck-us.net>
Cc:     linux-m68k@...r.kernel.org, linux-kernel@...r.kernel.org,
        glaubitz@...sik.fu-berlin.de, Max Staudt <max@...as.org>
Subject: [PATCH v2 4/4] i2c/busses/i2c-icy: Add platform_data for LTC2990

This enables the three additional inputs available on the 2019 a1k.org
reprint of the ICY board:

  in1 will be the voltage of the 5V rail, divided by 2.
  in2 will be the voltage of the 12V rail, divided by 4.
  temp3 will be measured using a PCB loop next the chip.

Signed-off-by: Max Staudt <max@...as.org>
---
 drivers/i2c/busses/i2c-icy.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-icy.c b/drivers/i2c/busses/i2c-icy.c
index 8125683c5..6ad9910a0 100644
--- a/drivers/i2c/busses/i2c-icy.c
+++ b/drivers/i2c/busses/i2c-icy.c
@@ -42,6 +42,7 @@
 
 #include <linux/i2c.h>
 #include <linux/i2c-algo-pcf.h>
+#include <linux/platform_data/ltc2990.h>
 
 #include <asm/amigaints.h>
 #include <linux/zorro.h>
@@ -106,8 +107,21 @@ static void icy_pcf_waitforpin(void *data)
 /*
  * Main i2c-icy part
  */
+static struct ltc2990_platform_data icy_ltc2990_platform_data = {
+	/*
+	 * Additional sensors exposed by this platform data:
+	 *
+	 * in1 will be the voltage of the 5V rail, divided by 2.
+	 * in2 will be the voltage of the 12V rail, divided by 4.
+	 * temp3 will be measured using a PCB loop next the chip.
+	 */
+	.meas_mode = {0, 3},
+};
+
 static struct i2c_board_info icy_ltc2990_info = {
-	I2C_BOARD_INFO("ltc2990", 0x4c),
+	.type		= "ltc2990",
+	.addr		= 0x4c,
+	.platform_data	= &icy_ltc2990_platform_data,
 };
 
 static unsigned short const icy_ltc2990_addresses[] = {0x4c, I2C_CLIENT_END};
@@ -167,6 +181,8 @@ static int icy_probe(struct zorro_dev *z,
 	 *
 	 * in0 is the voltage of the internal 5V power supply.
 	 * temp1 is the temperature inside the chip.
+	 *
+	 * See platform data above for in1, in2, temp3.
 	 */
 	i2c->client_ltc2990 = i2c_new_probed_device(&i2c->adapter,
 						    &icy_ltc2990_info,
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ