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 2/4] i2c/busses/i2c-icy: Add LTC2990 present on 2019 board revision
Date: Tue, 13 Aug 2019 01:52:35 +0200	[thread overview]
Message-ID: <20190812235237.21797-2-max@enpas.org> (raw)
In-Reply-To: <20190812235237.21797-1-max@enpas.org>

Since the 2019 a1k.org community re-print of these PCBs sports an
LTC2990 hwmon chip as an example use case, let this driver autoprobe
for that as well. If it is present, modprobing ltc2990 is sufficient.

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

diff --git a/drivers/i2c/busses/i2c-icy.c b/drivers/i2c/busses/i2c-icy.c
index 7910f035b..8125683c5 100644
--- a/drivers/i2c/busses/i2c-icy.c
+++ b/drivers/i2c/busses/i2c-icy.c
@@ -59,6 +59,7 @@ struct icy_i2c {
 
 	void __iomem *reg_s0;
 	void __iomem *reg_s1;
+	struct i2c_client *client_ltc2990;
 };
 
 
@@ -105,6 +106,13 @@ static void icy_pcf_waitforpin(void *data)
 /*
  * Main i2c-icy part
  */
+static struct i2c_board_info icy_ltc2990_info = {
+	I2C_BOARD_INFO("ltc2990", 0x4c),
+};
+
+static unsigned short const icy_ltc2990_addresses[] = {0x4c, I2C_CLIENT_END};
+
+
 static int icy_probe(struct zorro_dev *z,
 			 const struct zorro_device_id *ent)
 {
@@ -153,6 +161,18 @@ static int icy_probe(struct zorro_dev *z,
 	dev_info(&z->dev, "ICY I2C controller at %#x, IRQ not implemented\n",
 		 z->resource.start);
 
+	/*
+	 * The 2019 a1k.org PCBs have an LTC2990 at 0x4c, so start
+	 * it automatically once ltc2990 is modprobed.
+	 *
+	 * in0 is the voltage of the internal 5V power supply.
+	 * temp1 is the temperature inside the chip.
+	 */
+	i2c->client_ltc2990 = i2c_new_probed_device(&i2c->adapter,
+						    &icy_ltc2990_info,
+						    icy_ltc2990_addresses,
+						    NULL);
+
 	return 0;
 }
 
@@ -160,6 +180,8 @@ static void icy_remove(struct zorro_dev *z)
 {
 	struct icy_i2c *i2c = dev_get_drvdata(&z->dev);
 
+	i2c_unregister_device(i2c->client_ltc2990);
+
 	i2c_del_adapter(&i2c->adapter);
 }
 
-- 
2.11.0

  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 ` Max Staudt [this message]
2019-08-13  7:03   ` [PATCH v2 2/4] i2c/busses/i2c-icy: Add LTC2990 present on 2019 board revision 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 ` [PATCH v2 4/4] i2c/busses/i2c-icy: Add platform_data for LTC2990 Max Staudt
2019-08-13  7:04   ` 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-2-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).