From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E222BC31E40 for ; Mon, 12 Aug 2019 23:53:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BEDAF2063F for ; Mon, 12 Aug 2019 23:53:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727039AbfHLXxL (ORCPT ); Mon, 12 Aug 2019 19:53:11 -0400 Received: from enpas.org ([46.38.239.100]:55746 "EHLO mail.enpas.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726659AbfHLXxJ (ORCPT ); Mon, 12 Aug 2019 19:53:09 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail.enpas.org (Postfix) with ESMTPSA id B7B7D100704; Mon, 12 Aug 2019 23:53:06 +0000 (UTC) From: Max Staudt 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 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> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190812235237.21797-1-max@enpas.org> References: <20190812235237.21797-1-max@enpas.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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