From patchwork Thu Feb 15 20:47:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Felsch X-Patchwork-Id: 201746 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp112015dyb; Thu, 15 Feb 2024 12:48:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW9TMhOL68QI/3GaLcoSKg7nXXD5/HZSEWh2pWxvmVtUl2clNkVmmktMjgBY9OHMVcIPvM4QFw6zaYogymOsAbv9kHpHw== X-Google-Smtp-Source: AGHT+IGUcen7/vzS1VfHdEq/EdndmFunAOjw5Qc5RSlvFw7vb7EdkEJuvWJ4jLF2CfAiVKGAGuLY X-Received: by 2002:a0c:ca0b:0:b0:68e:fdf9:1674 with SMTP id c11-20020a0cca0b000000b0068efdf91674mr3062392qvk.14.1708030120127; Thu, 15 Feb 2024 12:48:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708030120; cv=pass; d=google.com; s=arc-20160816; b=xk9imrWPbQOwDjnmbCDk4OdK/Bb/I2DKiJx+GzyNYVu5NIw7UBpMPd0zFlOTxVtum9 DnTCqmDP7Q6mf7W9Tl8somq3E0lTe6G8ggCv7hy7p4PHIdWm/7KCrIBW1fka2Bh4BHlt Z9x+W3bzQX7aFN4ADlnYMLNiDSokiZuqng+2chQgn2Uh+pjLwz3oq2mpRAinH7Y56xFz wgSzqYN3hwK7rhxEaW4nENihBoGZvqCgPSueloD98Rh7XGVSaNrb/LWsZJxRrpzSWT1X LYndaOkW+RF8SQOlt2YC8T+L3PidAe50mKvusiAVfWKtqXZ/54UzWd2o5F0iXfdyxS8n NvGg== 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:message-id:date:subject:cc:to :from; bh=LqPR73leO7kRqnJGyExdE1ugKrBi8tgpzIFBxNTIx0A=; fh=MpSNMiRObaHjN3dq1phSoU/8p8jUSEF3IFI5FC4yd/8=; b=rIDT1x0iEqRE0DGGZQ2zFros+1icDpgv1HPij+sWjfKAxBIrU2H+w9zMyE6Wu0M7gH Xx0b+Yjo6SWk0oCu8qVnYTediutKIhOIWl/pwMCdv/DuCvxOJ6G1aIfUBoxqblSx/+Fj zqB/1wZxxQA/47EFLwrWFANVIZ+1LI9wBCTBb6p37y8TcV25fgKs1yDhzRqYtqziHROS 8rDNDBRJTbfrgjR2bGmBXkZUdFwP7dkXdBufespLIfX4uDGCnnI+QtnYU1xgqnaVFx/O AXgXC7ev6HHMKIe73OZ5NqihfGBep70J5W0SRAMYbcNlDw0dQyrbZeSMWuckTKxXbhQR ugPA==; 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-67666-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67666-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id k7-20020ad45be7000000b0068f10593ee8si2365032qvc.599.2024.02.15.12.48.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 12:48:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67666-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-67666-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67666-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E41CE1C22B5C for ; Thu, 15 Feb 2024 20:48:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9AA3B1419B1; Thu, 15 Feb 2024 20:48:08 +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 E7C9D13AA39 for ; Thu, 15 Feb 2024 20:48:04 +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=1708030087; cv=none; b=GonqZKxEAZBMuABSH6/eTVuM/leodYS3Zpx+ch19S9XgiWQWxqLsqBkyp5j2WOPeNv08kUed8fYvF5laIIEljVz0xu2XTvbTAMXeSS/2H6HhsRbOvCPAg6ja4vVj94N7WyTxoJZM5L5pQYKg0nQO+03JGsMvyZ4cq5RicqugBrA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708030087; c=relaxed/simple; bh=+jo9igZ8eH78xZ54jxpf7OZVLWMsv/b4wz2mLjajbvA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=NC/y7nKgjXe83Whk39uiXtRAHyjZi5y8Gs9Dwtjs0HudNpiigD1TtbZ1Jf47qDStktGf5r0uD1lQkR9ItWJhi6ShDXQJJ94rzmtmVUoVRSp+/GQ+rPYCd+eMp6IqMzFxF5I3rlwTjrCngARugWozJ1vydRzX7LBfVGkZ49qKznY= 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 ) id 1raie7-0007Dj-GX; Thu, 15 Feb 2024 21:47:51 +0100 From: Marco Felsch To: puranjay12@gmail.com, jic23@kernel.org, lars@metafoo.de Cc: thomas.haemmerle@leica-geosystems.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 1/2] dt-bindings: iio: ti,tmp117: add vcc supply binding Date: Thu, 15 Feb 2024 21:47:45 +0100 Message-Id: <20240215204746.1197619-1-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 1790999391130287257 X-GMAIL-MSGID: 1790999391130287257 From: Thomas Haemmerle Add the binding to specify the vcc supply. We can't make it required since this would break the backward compatibility. Signed-off-by: Thomas Haemmerle Signed-off-by: Marco Felsch --- .../devicetree/bindings/iio/temperature/ti,tmp117.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml b/Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml index 8c6d7735e875..cf7799c9734f 100644 --- a/Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml +++ b/Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml @@ -24,6 +24,9 @@ properties: reg: maxItems: 1 + vcc-supply: + description: provide VCC power to the sensor. + required: - compatible - reg @@ -39,5 +42,6 @@ examples: tmp117@48 { compatible = "ti,tmp117"; reg = <0x48>; + vcc-supply = <&pmic_reg_3v3>; }; }; From patchwork Thu Feb 15 20:47:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Felsch X-Patchwork-Id: 201747 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp112047dyb; Thu, 15 Feb 2024 12:48:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXURDFfS6Z3J8O3tzTrytRZc50TjuAzJjK7YVoUETIcCQm99UOgSm+2kwp2MNPA3RLyl9KiE56GEQOkmXCf1b5SF8yI8A== X-Google-Smtp-Source: AGHT+IE+OEq6MZ57QeHrRzN7p1Pv5pcJVylJ5pgIoQEq8TB8z83j+hHQhBmUBsDi/NHCn+ILaswj X-Received: by 2002:a05:6a21:6315:b0:1a0:5fb2:ba9 with SMTP id wu21-20020a056a21631500b001a05fb20ba9mr7448348pzb.26.1708030124869; Thu, 15 Feb 2024 12:48:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708030124; cv=pass; d=google.com; s=arc-20160816; b=I+ObrEE1Gdx0I3IQpLc3IrcmjBxHhmyIaccp5MtHem+VIGiuu8RcrQN76Tuv336xs2 WzjtM8o/FJTGqv7rO7ZMa4HXHrk9Ljrcxf/+oZzqbU2jCpEgcwNUuDMFb6nBYOrUwoia khs7kWnt7f7mHwyqXnJxzXtAUnKJ5btTxMDnvK+gHZDkEBllzRgLjG4/XzYeAXEafkyk gFOJAb4ZyB6RzgT+WE8C5H31Tf7oJNkVhZpr5orZT3FTT8KDQxup/3DThhev67lO+imp jd65PbLQtEJZ+yy+qohmRcJtptdMCBFE1cRIx7nhQRzqDdG99Dc9Ik4106kowWsvvDu4 heag== 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=YOorjQ1ibbnqi7nsFNWuaHQzSHiOIY60FzGunrNWXeY=; fh=MpSNMiRObaHjN3dq1phSoU/8p8jUSEF3IFI5FC4yd/8=; b=Klj10GQAVMW84QpUSmwszHZJ3Zn4QfiiEUDlIuEoRzN7Go+koOf8Cwu+xiLmH4i/gu dQ2O6BZ5YvkmPF7HIumLk1gsqZIv3fJ4bUsItOhq8sslTrseJJwN/p/Sds+uwXYiJdKy 8lVdsobd92lQmvETJ97gxDj/qS2onGqEAp/ZTiQ4VpAmePP9wgpMlPMQJBMzKyWrkuFP N3NvdpYNMutXRHN67b7GZYem1seCdpRhQC4TwaKZCrUtm5bsHf3dswOWJ9xTU/Dl1IFH EuEF4n7/My/Xe5PrH4du72TMtgZAXyy/dsa9QJAGDwlzb/kmf3itAWGisK7RwEaTK8LK wv4g==; 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-67667-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67667-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w127-20020a636285000000b005cdf8b4d2fesi1645549pgb.747.2024.02.15.12.48.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 12:48:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67667-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-67667-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67667-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8CA692837B3 for ; Thu, 15 Feb 2024 20:48:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0537F1420D4; Thu, 15 Feb 2024 20:48:09 +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 60EBF13B2AC for ; Thu, 15 Feb 2024 20:48:05 +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=1708030087; cv=none; b=pwE06lOu76z0WhZikEz8BfGwHGf+4C0jG024y7RMujpeugDfZiNfMAlnHbMAdeej5Px6LowBHekwpZ0ggnrK9AqtKrVM9WXo2nNy+wtZl52yi+KhhvYs6gk9jFClgxtVFEO40PN2JWM+EGDcgm3RkUI0JgWAJ7bgMjjD40zeRvs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708030087; c=relaxed/simple; bh=biCaXPwkDZwZMuX4ynfc//R7623cgWU7REW1Ogj8bf4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OICuKQCk5bP8Ch4myRq3q0hhQip3Nis0p+gX6i4RwTXDMPmTDR9+JJIGXd66L/pP5tVxGgLlsL242p7DF2qZIRj4MMHb3843jsE+Lxhhoq7nyDsfGmBh7Qm2+QVy2qFYeHleBGMkkrTVZxXDFbe4xgBENKLXqVI2j7Sz2Ezsfe0= 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 ) id 1raie7-0007Dj-Hu; Thu, 15 Feb 2024 21:47:51 +0100 From: Marco Felsch To: puranjay12@gmail.com, jic23@kernel.org, lars@metafoo.de Cc: thomas.haemmerle@leica-geosystems.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 2/2] iio: temperature: tmp117: add support for vcc-supply Date: Thu, 15 Feb 2024 21:47:46 +0100 Message-Id: <20240215204746.1197619-2-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215204746.1197619-1-m.felsch@pengutronix.de> References: <20240215204746.1197619-1-m.felsch@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 1790999395888235503 X-GMAIL-MSGID: 1790999395888235503 From: Thomas Haemmerle Add support to specify the VCC supply which is required to power the device. Signed-off-by: Thomas Haemmerle Signed-off-by: Marco Felsch --- 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 #include #include +#include #include @@ -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;