linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Max Staudt <max@enpas.org>
To: linux-i2c@vger.kernel.org, linux-hwmon@vger.kernel.org,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>
Cc: linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org,
	glaubitz@physik.fu-berlin.de, Max Staudt <max@enpas.org>
Subject: [PATCH v2 4/4] i2c/busses/i2c-icy: Add platform_data for LTC2990
Date: Tue, 13 Aug 2019 01:52:37 +0200	[thread overview]
Message-ID: <20190812235237.21797-4-max@enpas.org> (raw)
In-Reply-To: <20190812235237.21797-1-max@enpas.org>

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@enpas.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

  parent reply	other threads:[~2019-08-12 23:52 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-12 23:52 [PATCH v2 1/4] i2c/busses: Add i2c-icy for I2C on m68k/Amiga Max Staudt
2019-08-12 23:52 ` [PATCH v2 2/4] i2c/busses/i2c-icy: Add LTC2990 present on 2019 board revision Max Staudt
2019-08-13  7:03   ` Geert Uytterhoeven
2019-08-13  9:49     ` Max Staudt
2019-08-14 19:52       ` Wolfram Sang
2019-08-12 23:52 ` [PATCH v2 3/4] hwmon/ltc2990: Add platform_data support Max Staudt
2019-08-13  6:59   ` Geert Uytterhoeven
2019-08-13  8:02   ` Guenter Roeck
2019-08-13  8:27     ` Geert Uytterhoeven
2019-08-13 13:27       ` Guenter Roeck
2019-08-13 13:32         ` Geert Uytterhoeven
2019-08-13 10:10     ` Max Staudt
2019-08-13 13:24       ` Guenter Roeck
2019-08-13 13:31         ` Max
2019-08-14 18:11         ` Max Staudt
2019-08-12 23:52 ` Max Staudt [this message]
2019-08-13  7:04   ` [PATCH v2 4/4] i2c/busses/i2c-icy: Add platform_data for LTC2990 Geert Uytterhoeven
2019-08-13  7:08 ` [PATCH v2 1/4] i2c/busses: Add i2c-icy for I2C on m68k/Amiga Geert Uytterhoeven
2019-08-13  9:50   ` Max Staudt
2019-08-14 19:47 ` Wolfram Sang
2019-08-14 22:33   ` Max Staudt
2019-08-15  7:12     ` Wolfram Sang
2019-08-15 10:00       ` Max Staudt
2019-08-15 11:48         ` Wolfram Sang
2019-08-15 11:52           ` Max
2019-08-15 12:04             ` Wolfram Sang
2019-08-15 12:10               ` Max Staudt
2019-08-15 12:52                 ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190812235237.21797-4-max@enpas.org \
    --to=max@enpas.org \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).