From nobody Fri Nov 22 21:57:31 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 7F84A1304BA; Fri, 22 Nov 2024 08:54:45 +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=1732265685; cv=none; b=GRUbafCV7YPTQ59K2/QQXxsV5H+TjYptiQBSCAfay2/XXZgt7ki4IxIhWJJsVZq7G/Xka1OTRmVfrVFJrQ3KiBy9ys2DiSbBh1PdJPdYOda1ibz72jYcHQDmiLHUObanZNdcHNApG7fWZQhaDOKwx7C74WoO+Uku0TtQzL82aeg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732265685; c=relaxed/simple; bh=Sj0biJtPCEO33Em1tTuS6bWdcbj9/N0ABNsn0QBrn54=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=k0HI6i5AUTDnAk3ut8JJTc2JnFJ2x4UVvCD5xHNAi5My9HBY3o5FlHv22GfXmIBmtjDyes13JiLhjDHbxvDbNL0gZhihMItyEdp+/VH1q7d+xAbTypYXZcqQO1E0JPM6uPfdIScgHlJ/YgEf61sKOdpEL+yOg0gU7H4J2Cq7PTI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PK1xQWHN; 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="PK1xQWHN" Received: by smtp.kernel.org (Postfix) with ESMTPS id 417DDC4CED1; Fri, 22 Nov 2024 08:54:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732265685; bh=Sj0biJtPCEO33Em1tTuS6bWdcbj9/N0ABNsn0QBrn54=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=PK1xQWHNfBMEGSAorQ7d5j0SiHBKcGiIZDxqaIz4iMZnRsENGIvtavFGuR0B7Pyfh GxO7CIZA7nQd3G9ToPiRmsEZnFpQXLwo4sMfPMcmUVFsfdudcOuBL80uvj9iPTWNog y5jhu4iRoW1YzuoOF9yIpBUM0voylu9f6F1HEXzDz22c6E8cPSCLC06PFUYtTzl4pj 0D656WrApwv4/HeJcMqnj4YqIXeUxe2RULgt9NI+wY+6oEx3FBBoGevyOORkNSfSsu 6rAoRaTEV+BfOGyc4yslT8Lp1ArbBuT8DeoXRqxlfZo8/yWhbId07E/8LYIo2ExOoo CpsF+ywg/OhTA== 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 28D0FE65D36; Fri, 22 Nov 2024 08:54:45 +0000 (UTC) From: =?utf-8?q?Kry=C5=A1tof_=C4=8Cern=C3=BD_via_B4_Relay?= Date: Fri, 22 Nov 2024 09:53:57 +0100 Subject: [PATCH v2 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: <20241122-ds2482-add-reg-v2-1-a5a03ee74da7@gmail.com> References: <20241122-ds2482-add-reg-v2-0-a5a03ee74da7@gmail.com> In-Reply-To: <20241122-ds2482-add-reg-v2-0-a5a03ee74da7@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=1732265684; l=2045; i=cleverline1mc@gmail.com; s=20241112; h=from:subject:message-id; bh=/MV/A5HBPIZ49zvbrwPtUxocg+GMGOHnltCMlTjv4CY=; b=Bp597/cVqiz4z/sOiuQm/m4qPin1wLoQfu2HUNckHC0pxdWwRZ8eIli9ajUXui7VQOUrgqxBW IDGhpC9tM0gDV9lYqZ7tSr8zPMNFRE/au8HTZpvqB1eLbjdSbHaQLoL 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 21:57:31 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 BE0971BD4FB; Fri, 22 Nov 2024 08:54:45 +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=1732265685; cv=none; b=AFEKm163OetrvYGAz7wKcXWtsGM3ieZbLVbp2lySSdC2wERrY8uHPB0URhYP5T1QfWhnn1dilUN5Xj9RR3evxjX7u0/oOBjBpjogb+FUdhCPnnjZOd02Gora5VAFxAxnn6qy3lbB0dBANfwOr8UqA/+zYvsrY6+xR0+Q41peN04= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732265685; c=relaxed/simple; bh=kdlOqMd4IaNjJZxka4mv61XTpwsJoXe92l1sEXq/sYU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fQ/Dvb7Sa6bf4bF7PyhLKAZaFhL0HUzyZXJANW5RJKq/X+RM1fvS5aPfKK/l0Q3m0Zrbkr431JRYbialSqW7QPrKG9uCGR8O7lJyFdc3ukeGk7DRycI18/sYnEqXBbwsMBC2JiuUxbZWHh3dd76DHFradvBzA6lb+Q+2Yl4Houk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=a5w0ycjr; 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="a5w0ycjr" Received: by smtp.kernel.org (Postfix) with ESMTPS id 4FF49C4CED8; Fri, 22 Nov 2024 08:54:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732265685; bh=kdlOqMd4IaNjJZxka4mv61XTpwsJoXe92l1sEXq/sYU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=a5w0ycjr+ZUFX5/Zt0bDMFh/NUjxzMV/7C3WxslnBQuQ9VfFz2RhqCPZcjUCH/GRq ihuXh0B/7qAdPKWukUWOMhk0g33cl1CIvb/1IxFkWGz79DxmNNpKaa6qRwACznWcm0 0EOY4tUfrW0sF8E7kB7ykzy8+YwgsSG4IAy1KpvX2UrgbUKu3xWD1gJ0iQMABtk6pU vZ1zEhQ7lKYMeSVVUdAGhJi2THRgC9Hz0G+Dk3y4/oAoewbl0gUrEXdzlndlM4LNlS QUlX8sgoU7w6fQ1qe+npYUtSTreFcGugygke+4mh4KEZekxctUF4U9VGLt4u9Ma+7X J9kyqufjjqn7w== 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 3DDB7E65D35; Fri, 22 Nov 2024 08:54:45 +0000 (UTC) From: =?utf-8?q?Kry=C5=A1tof_=C4=8Cern=C3=BD_via_B4_Relay?= Date: Fri, 22 Nov 2024 09:53:58 +0100 Subject: [PATCH v2 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: <20241122-ds2482-add-reg-v2-2-a5a03ee74da7@gmail.com> References: <20241122-ds2482-add-reg-v2-0-a5a03ee74da7@gmail.com> In-Reply-To: <20241122-ds2482-add-reg-v2-0-a5a03ee74da7@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=1732265684; l=803; i=cleverline1mc@gmail.com; s=20241112; h=from:subject:message-id; bh=UBgH8nzxFBZsf9S6o5ykAjALagVAONUY98VsF7uGHps=; b=OhYzHbJDU8j0/SJRpQ65gCOz7Bf/c2ZRYxJFLQXaSBPLvqtPoUFDQmHbGZObc2QLsGv4hMagW 1MdtDbHvPXuCnH7+CCiUsg85WgiFDu3clVqOOQrFWfw72hVdlR+wja+ 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 21:57:31 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 BE0EB1BD519; Fri, 22 Nov 2024 08:54:45 +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=1732265685; cv=none; b=YGS7Iozbbhd049sYlhcq2D6J35hMWWEpn6SPheJMmmDzyL40GC9+nZyXbXoX1qi7Bn+KDowiOX54cr4fQw4fVHRpYoZgz9DkLDBJYgzbGYdrqtxCWBgWTKcVUMG/4OMCs9eeU6Ozp4/adMev2UZB8OI43dVtY8BUy8tj8BQxvRg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732265685; c=relaxed/simple; bh=6RH/y43YIHSzWQWpbCD/ykLnwAPY271oVr5DpnnOcys=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=r9mqeUQ1vvEAES3iBbUnll0A+f4aRlwou93IA1uRa/yluyq7+ER1kxl1jMuYhiyYNtDCxUF4R4av3f+9q3bZR26q52tmZthijszhCU01ywVWKmDaMGGXVrsD11FpIlda0kzVaYynfhP0lD8cVDmlv5plxC5rVsZxMxYIfiMjuM8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=T5/7eM1F; 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="T5/7eM1F" Received: by smtp.kernel.org (Postfix) with ESMTPS id 60274C4CED7; Fri, 22 Nov 2024 08:54:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732265685; bh=6RH/y43YIHSzWQWpbCD/ykLnwAPY271oVr5DpnnOcys=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=T5/7eM1FvRGaZmCofiOtyibcg5jogwF6B8MfOq1aZmsXW10w2ugQYX4hCZPG/tEUa MKBnlj/pxWimOCJqAfwfpjDNgyVtowN+XntQFvG8ggkUTLeC3+IDVH/OgBAtbYxBfd CpRBfBHEcs8Gh8sZlP07q3ENy8GIvqlp2C5D21o5NLxsCEWDALZR+S/+fMX554U/3d Elhsg/UNuQleMEB+WF0nUYaebmGEd8MntBoNZ43TGLdXa/3ESpjAlNLeCcL8zS0/DV aiAM7mFibS5d9dQ91yYH6Z+NA2n+vFxpcvZavdM2/Iy32Q4WugfGaTRSSrYwvuk5Jo rqGZhJ2UXjPrg== 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 4F8F4E65D39; Fri, 22 Nov 2024 08:54:45 +0000 (UTC) From: =?utf-8?q?Kry=C5=A1tof_=C4=8Cern=C3=BD_via_B4_Relay?= Date: Fri, 22 Nov 2024 09:53:59 +0100 Subject: [PATCH v2 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: <20241122-ds2482-add-reg-v2-3-a5a03ee74da7@gmail.com> References: <20241122-ds2482-add-reg-v2-0-a5a03ee74da7@gmail.com> In-Reply-To: <20241122-ds2482-add-reg-v2-0-a5a03ee74da7@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=1732265684; l=696; i=cleverline1mc@gmail.com; s=20241112; h=from:subject:message-id; bh=fq/t3WqU49PJQPpZQn6+x14CxqIiQvaPHmtq+9hs7xQ=; b=dBAWTA0O/eR2X7TNdA+AbJgVi/EML/3B5fLsEY9eS3rgvmWGfYBHf4Esgp18AKOjSVLPrsdUx GvGY1dmEYbIBoMmeaPEO7U2xERaPWry5Vyilo3Lj1kzbkvz8S1AHkpu 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 ds2482 has a VCC pin, accepting 2.9-5.5 V. Signed-off-by: Kry=C5=A1tof =C4=8Cern=C3=BD --- Documentation/devicetree/bindings/w1/maxim,ds2482.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/w1/maxim,ds2482.yaml b/Docum= entation/devicetree/bindings/w1/maxim,ds2482.yaml index 422becc6e1fa8d58665c5586ebdc611cd0b2c760..fe6b3f9a3f8bbd00366c3e36aad= 3ffa72ec1a31f 100644 --- a/Documentation/devicetree/bindings/w1/maxim,ds2482.yaml +++ b/Documentation/devicetree/bindings/w1/maxim,ds2482.yaml @@ -25,6 +25,8 @@ properties: reg: maxItems: 1 =20 + vcc-supply: true + required: - compatible - reg --=20 2.39.5