Message ID | 20240216102820.1395815-2-m.felsch@pengutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-68443-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp424067dyb; Fri, 16 Feb 2024 02:39:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWa1Z4rsISjDd18kzctPre/YkSFh/eCmt+HjIarGObcrDpbL66V3MIF24DcsPLr8wwv08zhIKaJJ/4gCmZRMC2dRNd0tg== X-Google-Smtp-Source: AGHT+IFZNilAOcCSzA9I97LshjSHEb0j2NBK1Lfs03X9zJWVrRdcoL8bA5bh2H2IhQMRmUyOfuW7 X-Received: by 2002:a05:6a20:6d07:b0:1a0:73e2:f31a with SMTP id fv7-20020a056a206d0700b001a073e2f31amr4696762pzb.19.1708079963164; Fri, 16 Feb 2024 02:39:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708079963; cv=pass; d=google.com; s=arc-20160816; b=wDO4k3z5OMusNpudKi4YVsac6GfCSqQazy7BmV9FW+TndOMjeVbSLjzdUgWOC0sv2k iUrfyWKY5qe13FhSSpuqUSpyqT4lS33J6G0HkH8NcCvVUSl+kG6Og4SAuXQhgFX7x+Lv 5yAZvLK9FG9IHCLFmEBhPrbJ9T5rGi9kpGSNtksy9OJvdVaPKYSFmcIxEuY4HzMLHecg AkUQmu+iAY+UhKJx6Ikl1aPkElsaTju9wFBLhoKDDXrO8E+3KcbavoojfaKXPVB+ZEu5 vlRPDmRRPc0MlDEX/ulXUpckT//FJ2Z7saGCNDQPOQaFMPD4jxvVYEVWH+pI5DSWbZv8 CEaA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=TEp/vyPWnvACAqc7nGbhJ6grdWG6FPZoSSQEHxSneQA=; fh=GZ7Y1w8dudA+k6tu6VtZjuvgb4vRk6eGUlxN140LGjA=; b=Vp7r8/6u22A1xhSzd/oKAQL2OKciP7pfLZZBf2WDJZMKzjBYmixm+EdjwHhZYzJc1V 265890+E/zyZmwK0wxoLeBDgeGPb6v2IaHGZcp80KMa7CoJKS+ULzbugvhbaB/huO3eE CmdSieFdk7qd1n2nR/5xukl6OrkaGOPlkm+USxqerxgouzG2MS2bQarUV2z2WT1tgrps 4cnovXg9l4i+3w/fWzxJBWPcpQIIvrWxv9/HHy3XeEZeNdHCYD1xkGJmjI73g6gtn6Hq p+86NdJ8SuMa7+7U5aaoL727wabl7RgRlPkWqn8zR90wYzN2plkqYFjDzFa7bgNRov+x t/Vg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-68443-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68443-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id x4-20020a656aa4000000b005dc85a7bfe6si2762647pgu.109.2024.02.16.02.39.22 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 02:39:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68443-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-68443-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68443-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A39A6B22E7B for <ouuuleilei@gmail.com>; Fri, 16 Feb 2024 10:29:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 598682C6BB; Fri, 16 Feb 2024 10:28:37 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83A512C197 for <linux-kernel@vger.kernel.org>; Fri, 16 Feb 2024 10:28:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708079315; cv=none; b=rSsXInrX50k92mdbbPHtcg+eGhX3isAA68+xhxNV4gJqupLMqAjX+ToGMtnHuARi7QbwByc4pq24cuC4ML+W/5dNHCvUH25pSeNBhGxADInrqL7wrypVWIidZv7ll/ngO+WQ9i2jYPVrt3PvD9lRVLGqhuO/mBIYPzr1zkihBRk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708079315; c=relaxed/simple; bh=ZeXvEB7viOHK4bgTozoMlOU4OC6pZg8V0UUCaiKpFeI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DRo6qi3/g5/e1q3IMLeIHJV4lJbGwwwdFrplAldkE+Vo4HKy15zlokOSf9wwusa6F/TONkqwWeIrfxqxyTQqevuv7FvQGBWUSLzRHYRhsziXHNSUnuwnJXXJ+WZoOz8bdUPw12yBBBYPaqspP1LDy8ZKIdZNlzYJbv4XxUwJhLw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from <m.felsch@pengutronix.de>) id 1ravS9-0006gI-Ih; Fri, 16 Feb 2024 11:28:21 +0100 From: Marco Felsch <m.felsch@pengutronix.de> To: puranjay12@gmail.com, jic23@kernel.org, lars@metafoo.de, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, thomas.haemmerle@leica-geosystems.com Subject: [RESEND PATCH 2/2] iio: temperature: tmp117: add support for vcc-supply Date: Fri, 16 Feb 2024 11:28:20 +0100 Message-Id: <20240216102820.1395815-2-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240216102820.1395815-1-m.felsch@pengutronix.de> References: <20240216102820.1395815-1-m.felsch@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::28 X-SA-Exim-Mail-From: m.felsch@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791051655819924844 X-GMAIL-MSGID: 1791051655819924844 |
Series |
[RESEND,1/2] dt-bindings: iio: ti,tmp117: add vcc supply binding
|
|
Commit Message
Marco Felsch
Feb. 16, 2024, 10:28 a.m. UTC
From: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com> Add support to specify the VCC supply which is required to power the device. Signed-off-by: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> --- Resend since I forgot to add the DT maintainers drivers/iio/temperature/tmp117.c | 5 +++++ 1 file changed, 5 insertions(+)
Comments
On Fri, 16 Feb 2024 11:28:20 +0100 Marco Felsch <m.felsch@pengutronix.de> wrote: > From: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com> > > Add support to specify the VCC supply which is required to power the > device. > > Signed-off-by: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com> > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Hi. With power supply enables, the question that normally comes up is whether the device takes significant time to become available after the power is turned on. I had a look at the datasheet but couldn't find clear language on how long we need to wait before the device is usable following power up. There is a number for reset of 1.5 msecs so I guess we could use that safely? Maybe no delay is fine for reading the device ID. I've no idea. Sometimes we start with no delay and only end up adding one later when people report issues. We could do that here. Jonathan > --- > Resend since I forgot to add the DT maintainers > > drivers/iio/temperature/tmp117.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/iio/temperature/tmp117.c b/drivers/iio/temperature/tmp117.c > index 059953015ae7..69328066811a 100644 > --- a/drivers/iio/temperature/tmp117.c > +++ b/drivers/iio/temperature/tmp117.c > @@ -17,6 +17,7 @@ > #include <linux/kernel.h> > #include <linux/limits.h> > #include <linux/property.h> > +#include <linux/regulator/consumer.h> > > #include <linux/iio/iio.h> > > @@ -152,6 +153,10 @@ static int tmp117_probe(struct i2c_client *client) > if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA)) > return -EOPNOTSUPP; > > + ret = devm_regulator_get_enable(&client->dev, "vcc"); > + if (ret) > + return ret; > + > dev_id = i2c_smbus_read_word_swapped(client, TMP117_REG_DEVICE_ID); > if (dev_id < 0) > return dev_id;
On 24-02-16, Jonathan Cameron wrote: > On Fri, 16 Feb 2024 11:28:20 +0100 > Marco Felsch <m.felsch@pengutronix.de> wrote: > > > From: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com> > > > > Add support to specify the VCC supply which is required to power the > > device. > > > > Signed-off-by: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com> > > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> > > Hi. > > With power supply enables, the question that normally comes up is whether > the device takes significant time to become available after the power is > turned on. > > I had a look at the datasheet but couldn't find clear language on > how long we need to wait before the device is usable following power up. > There is a number for reset of 1.5 msecs so I guess we could use that > safely? You're right, section 7.3.1 Power Up mention the 1.5ms as well. I will add this albeit we didn't had issues with this patch in place for like months. > Maybe no delay is fine for reading the device ID. I've no idea. > Sometimes we start with no delay and only end up adding one later when > people report issues. We could do that here. Yes, I will add it and send a v2. Thanks, Marco > > Jonathan > > > --- > > Resend since I forgot to add the DT maintainers > > > > drivers/iio/temperature/tmp117.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/drivers/iio/temperature/tmp117.c b/drivers/iio/temperature/tmp117.c > > index 059953015ae7..69328066811a 100644 > > --- a/drivers/iio/temperature/tmp117.c > > +++ b/drivers/iio/temperature/tmp117.c > > @@ -17,6 +17,7 @@ > > #include <linux/kernel.h> > > #include <linux/limits.h> > > #include <linux/property.h> > > +#include <linux/regulator/consumer.h> > > > > #include <linux/iio/iio.h> > > > > @@ -152,6 +153,10 @@ static int tmp117_probe(struct i2c_client *client) > > if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA)) > > return -EOPNOTSUPP; > > > > + ret = devm_regulator_get_enable(&client->dev, "vcc"); > > + if (ret) > > + return ret; > > + > > dev_id = i2c_smbus_read_word_swapped(client, TMP117_REG_DEVICE_ID); > > if (dev_id < 0) > > return dev_id; > >
diff --git a/drivers/iio/temperature/tmp117.c b/drivers/iio/temperature/tmp117.c index 059953015ae7..69328066811a 100644 --- a/drivers/iio/temperature/tmp117.c +++ b/drivers/iio/temperature/tmp117.c @@ -17,6 +17,7 @@ #include <linux/kernel.h> #include <linux/limits.h> #include <linux/property.h> +#include <linux/regulator/consumer.h> #include <linux/iio/iio.h> @@ -152,6 +153,10 @@ static int tmp117_probe(struct i2c_client *client) if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA)) return -EOPNOTSUPP; + ret = devm_regulator_get_enable(&client->dev, "vcc"); + if (ret) + return ret; + dev_id = i2c_smbus_read_word_swapped(client, TMP117_REG_DEVICE_ID); if (dev_id < 0) return dev_id;