From mboxrd@z Thu Jan 1 00:00:00 1970 From: Max Staudt Subject: [PATCH v2 4/4] i2c/busses/i2c-icy: Add platform_data for LTC2990 Date: Tue, 13 Aug 2019 01:52:37 +0200 Message-ID: <20190812235237.21797-4-max@enpas.org> References: <20190812235237.21797-1-max@enpas.org> Return-path: In-Reply-To: <20190812235237.21797-1-max@enpas.org> Sender: linux-kernel-owner@vger.kernel.org To: linux-i2c@vger.kernel.org, linux-hwmon@vger.kernel.org, Wolfram Sang , Jean Delvare , Guenter Roeck Cc: linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org, glaubitz@physik.fu-berlin.de, Max Staudt List-Id: linux-i2c@vger.kernel.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 --- 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 #include +#include #include #include @@ -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