Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp306563ybl; Mon, 12 Aug 2019 16:54:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyH1sD6ikFsZp05kFG0MSqjecUEEBxjQAVwunSiL71myN9ievAsmIXG620K/z9N+x4dyZUo X-Received: by 2002:a62:e801:: with SMTP id c1mr4267180pfi.184.1565654069841; Mon, 12 Aug 2019 16:54:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565654069; cv=none; d=google.com; s=arc-20160816; b=rI1jrglVmL2UW5FgOFDGDPJ2r8jp45reacIdqR4aX7CYXRUPIyq21IQqqzZJ9LFInL qQv2AYaQ3V+ZzAv2iW/FGwHT8hDwMVx3CRB02vLvE06ko/zt8NeqTw2aoycx0JNPZODU 0fMkzImdyZkF20p6HXosszh+dTsd6j8zVLrjj4lcFzstwCJO7cgNF8ZsWGscOddMc3rg FLuauldMQHGa0/RImT5XnbHOW4FUYsB7ezwB/UuuCVM8l3DnXRIfo7rZhBRhhr/TKde8 AclIPtLTg2u3DflQSQ6LyPyOAVpRMNdrY4MTerJlAM3elMoY/WWuxR+SuwVlJfXwimVb 3VKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=sOMRnd/mmRbJt3E0CMkVA8ECoz0rACUHIGkVIzIxJ00=; b=wkpZQEsA25lAW0SpCBHC28gxP5i8EwjnsJPbfUp7wBCCe15htvWEZUxxchWEKl9QaA 91RWt3Yv4i3iE9g7/kn6oem5QOiKT1/oJKBmzlwdrqPFivi0e3U7bC4Ql4RfgunBooBh inPffqfeG/X+p1m38u1Owmivj57tK+sAzx8u2gTElruxkidVJf9hkgkRudlH2FaRMYSu 7g1ThRqZvX8EzIikwoz/NOJQDEKwBDdzxINIg1l8R1ULgkDW5NC8LCoSK4tMyD4rxevH bTJUx9bY7CpK49PyPLH6487iJLZG9NCriphGOK7mvR7Ya4z8Xp2XPakAmsNxD2qisTiE 68+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 20si23691552pfj.54.2019.08.12.16.54.14; Mon, 12 Aug 2019 16:54:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726975AbfHLXxK (ORCPT + 99 others); Mon, 12 Aug 2019 19:53:10 -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