From nobody Fri Nov 22 16:30:50 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E7E501CEACD; Fri, 15 Nov 2024 14:58:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731682737; cv=none; b=IHQJqHl6C243/E2w8LmIbMEjrnA0xdgsyVuClcHzY/T/KrhdbNgbJm4IaYYlI/jZ2F99khOWPmZ+VlUws0N4LILxos57697vIP6YVUJ0BHIYh/D+vVbedGpUHdK1w7wLh4wmUQmeG4iyuqoPKWwyFHB5YW0dFGzbdv3EKmUnE4o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731682737; c=relaxed/simple; bh=Sj0biJtPCEO33Em1tTuS6bWdcbj9/N0ABNsn0QBrn54=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=F330vMMA/Z9WefORHfEmc42pF4f8+gkzsEmd3ofHRsiecnrOmmQo0KCQMgtFxScDGzVWKMTFbTwlssQfQ3e2z3Nwv/YapZmIMtrM1xCtKwwiMhDkKy7YI5uKvym2IjzTzvSVVKoA7E2gSI1saWOkihAreucZJykt1FuarB7sABo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ma2OP7ox; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ma2OP7ox" Received: by smtp.kernel.org (Postfix) with ESMTPS id 860F3C4CECF; Fri, 15 Nov 2024 14:58:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1731682736; bh=Sj0biJtPCEO33Em1tTuS6bWdcbj9/N0ABNsn0QBrn54=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Ma2OP7oxNWtriCoB/ONEM0PTNcAZg8628XtDceTTp9SYpjNEZ2hmrv/7z9/tbQ/lW Ev6RxYRvpVqz1HimKfyoEJoTDtrAH5zBm5JZshwzKrdEPD2m1aCiy/kA9usL0rrzgZ Fgr1mISsfeR9hh9Z7oGXTG677Etm/oNckmz7Cy5q4pFEaE2NeqpttTklOSP+NOcCM5 8z2iqGiKpFuUUCCieAK6JLOCnBcRktgv30YzNDVprJ7QJDojP27ElOiFuMIqSGv6Z/ lD2gLSuG5XWgr0KDolcYuDSMr6485b44hI44kb7x+0eUSk3XT8t9x1mRzPFQ0mNKg6 BpktGV2kHWc7w== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D7C8D68BC5; Fri, 15 Nov 2024 14:58:56 +0000 (UTC) From: =?utf-8?q?Kry=C5=A1tof_=C4=8Cern=C3=BD_via_B4_Relay?= Date: Fri, 15 Nov 2024 15:58:04 +0100 Subject: [PATCH 1/3] w1: ds2482: Add regulator support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241115-ds2482-add-reg-v1-1-cc84b9aba126@gmail.com> References: <20241115-ds2482-add-reg-v1-0-cc84b9aba126@gmail.com> In-Reply-To: <20241115-ds2482-add-reg-v1-0-cc84b9aba126@gmail.com> To: Krzysztof Kozlowski , Rob Herring , Conor Dooley , Stefan Wahren Cc: Ben Gardner , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, =?utf-8?q?Kry=C5=A1tof_=C4=8Cern=C3=BD?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1731682735; l=2045; i=cleverline1mc@gmail.com; s=20241112; h=from:subject:message-id; bh=/MV/A5HBPIZ49zvbrwPtUxocg+GMGOHnltCMlTjv4CY=; b=4ujHrq56di8Z9ZW59yDJ2UvrZ4lzPNxqnEbXmS895tkdASU9WCcP1n0n3U/QdKMRGhqqUTcsz Gg/XxT94p41Bf82rGnCO70ssTogKAsM3Puf0QnfLB3mznqItpO7t8VS X-Developer-Key: i=cleverline1mc@gmail.com; a=ed25519; pk=EJoEbw03UiRORQuCiEyNA8gH1Q6fIpEWnn/MyaWOWX0= X-Endpoint-Received: by B4 Relay for cleverline1mc@gmail.com/20241112 with auth_id=275 X-Original-From: =?utf-8?q?Kry=C5=A1tof_=C4=8Cern=C3=BD?= Reply-To: cleverline1mc@gmail.com From: Kry=C5=A1tof =C4=8Cern=C3=BD Adds a support for attaching a supply regulator. Signed-off-by: Kry=C5=A1tof =C4=8Cern=C3=BD --- drivers/w1/masters/ds2482.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/w1/masters/ds2482.c b/drivers/w1/masters/ds2482.c index a2ecbb863c57f38bffc8e3cd463db1940e603179..3fb35e92fc1587dc4e609c0061f= a5057e0027a80 100644 --- a/drivers/w1/masters/ds2482.c +++ b/drivers/w1/masters/ds2482.c @@ -15,6 +15,7 @@ #include #include #include +#include =20 #include =20 @@ -117,6 +118,9 @@ struct ds2482_data { u8 channel; u8 read_prt; /* see DS2482_PTR_CODE_xxx */ u8 reg_config; + + /* reference to the optional regulator */ + struct regulator *vcc_reg; }; =20 =20 @@ -445,6 +449,7 @@ static int ds2482_probe(struct i2c_client *client) int err =3D -ENODEV; int temp1; int idx; + int ret; =20 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA | @@ -457,6 +462,18 @@ static int ds2482_probe(struct i2c_client *client) goto exit; } =20 + /* Get the vcc regulator */ + data->vcc_reg =3D devm_regulator_get(&client->dev, "vcc"); + if (IS_ERR(data->vcc_reg)) + return PTR_ERR(data->vcc_reg); + + /* Enable the vcc regulator */ + ret =3D regulator_enable(data->vcc_reg); + if (ret) { + dev_err(&client->dev, "Fail to enable regulator\n"); + return ret; + } + data->client =3D client; i2c_set_clientdata(client, data); =20 @@ -517,6 +534,7 @@ static int ds2482_probe(struct i2c_client *client) w1_remove_master_device(&data->w1_ch[idx].w1_bm); } exit_free: + regulator_disable(data->vcc_reg); kfree(data); exit: return err; @@ -533,6 +551,9 @@ static void ds2482_remove(struct i2c_client *client) w1_remove_master_device(&data->w1_ch[idx].w1_bm); } =20 + /* Disable the vcc regulator */ + regulator_disable(data->vcc_reg); + /* Free the memory */ kfree(data); } --=20 2.39.5 From nobody Fri Nov 22 16:30:50 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0E9C91BF7FC; Fri, 15 Nov 2024 14:58:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731682737; cv=none; b=Y+Gjg64p0k7ItW7M0rAp/x7FFvYPYRlbZr+twKCWsyminV5z2hYKiCbF61BDhGDmheOzJlraSbKGLz7Au56eL73Md7TAJxZCtQ6cAAB3j6a/Pxjbcjmsupjlgw2gNeOy8QVlXPo0prQxOnZbumVD43R5Sh4UFkHOkq22f+IikdA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731682737; c=relaxed/simple; bh=kdlOqMd4IaNjJZxka4mv61XTpwsJoXe92l1sEXq/sYU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bQnhvyv8Lnum+so1LJUk08zuqPhd7xxC53Ciks/TrwLS8NFQrdkJL5UfcvcR/I1E8sL4zGmgx40LvYjqhQNBFwikduMb1zydjuCIEdds2ARolSHuRHepOPkYrO3sFifJT26PJ8OMHJK5rrNTz7iUeZqbErclsRuMHuMUKUUFpQ4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XzWVDSuh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XzWVDSuh" Received: by smtp.kernel.org (Postfix) with ESMTPS id 9D93FC4CED5; Fri, 15 Nov 2024 14:58:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1731682736; bh=kdlOqMd4IaNjJZxka4mv61XTpwsJoXe92l1sEXq/sYU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=XzWVDSuhAVR9kwP71gBuAn+315yvfBC4I7mhPSoijFxCUUOFbDvGSLxf0HFmUnUQv Ab14rCQ6uH3gOXxTm5Mb44fTGuciGtjXw7Vkapm1nplbRt03YHa8oNDOlebSLLgcFD Bs+guhgX8dfXi+IfmfJJlQasePAh8mTUjZ+4y9YgYv35jmiEGKWHEYviD2HLjmjiop AlEWCuoMzCFTEPNckr0DqukZdujqFBNFX7xW3Mi0k2XaYaxnJeGS1DydB4MVQZGI4q XQ3/D740fM9/W7y8Nu+y140ZGYwkgnHrvJ5PGHmj/6yitxmaaOY1xHDQwy/60jweqo k/Te98DVZ4EiA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BCFAD68BC3; Fri, 15 Nov 2024 14:58:56 +0000 (UTC) From: =?utf-8?q?Kry=C5=A1tof_=C4=8Cern=C3=BD_via_B4_Relay?= Date: Fri, 15 Nov 2024 15:58:05 +0100 Subject: [PATCH 2/3] w1: ds2482: Fix datasheet URL Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241115-ds2482-add-reg-v1-2-cc84b9aba126@gmail.com> References: <20241115-ds2482-add-reg-v1-0-cc84b9aba126@gmail.com> In-Reply-To: <20241115-ds2482-add-reg-v1-0-cc84b9aba126@gmail.com> To: Krzysztof Kozlowski , Rob Herring , Conor Dooley , Stefan Wahren Cc: Ben Gardner , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, =?utf-8?q?Kry=C5=A1tof_=C4=8Cern=C3=BD?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1731682735; l=803; i=cleverline1mc@gmail.com; s=20241112; h=from:subject:message-id; bh=UBgH8nzxFBZsf9S6o5ykAjALagVAONUY98VsF7uGHps=; b=sTMk5PlH+nZLJyIJDx7waGCt3zg4eC0dpAhiRuKCuPsW0LoLQSZHzM8//6aMRD800Nyu9OKNS rQ9Z5JfHdFkDNqwaUQNpGqiNohSVWcHkAjMS5REYlEfDnryjm5vzXDw X-Developer-Key: i=cleverline1mc@gmail.com; a=ed25519; pk=EJoEbw03UiRORQuCiEyNA8gH1Q6fIpEWnn/MyaWOWX0= X-Endpoint-Received: by B4 Relay for cleverline1mc@gmail.com/20241112 with auth_id=275 X-Original-From: =?utf-8?q?Kry=C5=A1tof_=C4=8Cern=C3=BD?= Reply-To: cleverline1mc@gmail.com From: Kry=C5=A1tof =C4=8Cern=C3=BD Current link does redirect to wrong place. Signed-off-by: Kry=C5=A1tof =C4=8Cern=C3=BD --- drivers/w1/masters/ds2482.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/w1/masters/ds2482.c b/drivers/w1/masters/ds2482.c index 3fb35e92fc1587dc4e609c0061fa5057e0027a80..ba86b5953b8d3ed1fe40d40a1a2= b018c57fb91b8 100644 --- a/drivers/w1/masters/ds2482.c +++ b/drivers/w1/masters/ds2482.c @@ -7,7 +7,7 @@ * It is a I2C to 1-wire bridge. * There are two variations: -100 and -800, which have 1 or 8 1-wire ports. * The complete datasheet can be obtained from MAXIM's website at: - * http://www.maxim-ic.com/quick_view2.cfm/qv_pk/4382 + * https://www.analog.com/en/products/ds2482-100.html */ =20 #include --=20 2.39.5 From nobody Fri Nov 22 16:30:50 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 103161D4339; Fri, 15 Nov 2024 14:58:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731682737; cv=none; b=LLACLrzDgLSgP+/V/blxIqxk22o01VL5H5CcFriP27oSW9YU1smEh2db9zvclNjh7vJ+iJYgz048Bv+O5LnWC6LktR7Gq4sXf3IjXMVw/KJc5rPjLTKKIwasOSrlBqHn1ZbDzGet9rQ3bYIKoQCnBCfVA8Elk48HCmiMBx7S/eU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731682737; c=relaxed/simple; bh=wWL9XhOTeOyRzFVFxjGXg2m2x4739+IAAx+ijemyDe0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NhADxaKS7wzEF7mKj0Vi+We/3LxhGtsi752sOLrOULNJE3slSKnQnX4y6YeW3PJFzTGOEfDtuMm9Aa8utEUcK0JQK0rsLi30w+3uI26MBTXZ0qrfvBnIBjaN/l8m2QNEyyjXXl/XRgQqClPEHbpnbvpbxH2dVaAnzeowFTc2EwA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jQJAdcf2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jQJAdcf2" Received: by smtp.kernel.org (Postfix) with ESMTPS id AB74FC4CED9; Fri, 15 Nov 2024 14:58:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1731682736; bh=wWL9XhOTeOyRzFVFxjGXg2m2x4739+IAAx+ijemyDe0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=jQJAdcf2qAjiEBeNAcKVMFOa9OAuAO0bVTstX4ughhISy9u8MCHaXU6UJWH7cuZUZ F5WbGsY3n15OMA3xBoI2TrI8c/Hiu8zEBK6yahtfSKDwSJWDTaVpVeCFYM8HpNJnYq ztMgXG7ER0qENq2buwJa04aG4iKj4l/8l6LVamRkgSqxBAT4EoX/6jAAWfsMe7AAdW 5o0dI3o3N4a8D6RB3BFqYS/MVg4s1v6+eH2788t9ZzJxZrUGaD8mE4QwbKOYO5uw4x 0aPWjPOGhr4fVY9RSKJ7mnKXx8uqi2hNsESdAXZ9meiNI7GLiylt/+gvgP3ESnyrTM EyceZGdEz0OPA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1DA1D68BC8; Fri, 15 Nov 2024 14:58:56 +0000 (UTC) From: =?utf-8?q?Kry=C5=A1tof_=C4=8Cern=C3=BD_via_B4_Relay?= Date: Fri, 15 Nov 2024 15:58:06 +0100 Subject: [PATCH 3/3] dt-bindings: w1: ds2482: Add vcc-supply property Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241115-ds2482-add-reg-v1-3-cc84b9aba126@gmail.com> References: <20241115-ds2482-add-reg-v1-0-cc84b9aba126@gmail.com> In-Reply-To: <20241115-ds2482-add-reg-v1-0-cc84b9aba126@gmail.com> To: Krzysztof Kozlowski , Rob Herring , Conor Dooley , Stefan Wahren Cc: Ben Gardner , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, =?utf-8?q?Kry=C5=A1tof_=C4=8Cern=C3=BD?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1731682735; l=781; i=cleverline1mc@gmail.com; s=20241112; h=from:subject:message-id; bh=UCNjIrPX7cETnGBQGIv8oPibmNQ+Ah/w0u0cd9E5Xfw=; b=fnkTpsmCVfDQgbR4yJ50Yo8UWgWnRZrm+QvcKqLoMy+VNV0jyThRFwjYkNxO3TCPTqmMwIoim OST8Plmv159D68kesgnzORJvorsWkIkAFvDssk9upp22e2KDYRuDseX X-Developer-Key: i=cleverline1mc@gmail.com; a=ed25519; pk=EJoEbw03UiRORQuCiEyNA8gH1Q6fIpEWnn/MyaWOWX0= X-Endpoint-Received: by B4 Relay for cleverline1mc@gmail.com/20241112 with auth_id=275 X-Original-From: =?utf-8?q?Kry=C5=A1tof_=C4=8Cern=C3=BD?= Reply-To: cleverline1mc@gmail.com From: Kry=C5=A1tof =C4=8Cern=C3=BD Adds the newly added vcc-supply property to bindings. Signed-off-by: Kry=C5=A1tof =C4=8Cern=C3=BD --- Documentation/devicetree/bindings/w1/maxim,ds2482.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/w1/maxim,ds2482.yaml b/Docum= entation/devicetree/bindings/w1/maxim,ds2482.yaml index 422becc6e1fa8d58665c5586ebdc611cd0b2c760..a6b9e0658ec858cb24b21cf6444= 3a061bb43e4ef 100644 --- a/Documentation/devicetree/bindings/w1/maxim,ds2482.yaml +++ b/Documentation/devicetree/bindings/w1/maxim,ds2482.yaml @@ -25,6 +25,9 @@ properties: reg: maxItems: 1 =20 + vcc-supply: + description: phandle of the regulator that provides the supply voltage. + required: - compatible - reg --=20 2.39.5