* [PATCH v3 0/3] Add support for attaching a regulator to w1: ds2482
@ 2024-11-24 16:21 Kryštof Černý via B4 Relay
2024-11-24 16:21 ` [PATCH v3 1/3] w1: ds2482: Add regulator support Kryštof Černý via B4 Relay
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Kryštof Černý via B4 Relay @ 2024-11-24 16:21 UTC (permalink / raw)
To: Krzysztof Kozlowski, Rob Herring, Conor Dooley, Stefan Wahren
Cc: Ben Gardner, linux-kernel, devicetree, Kryštof Černý
Implemented changes requested in review and retested them.
Signed-off-by: Kryštof Černý <cleverline1mc@gmail.com>
---
Changes in v3:
- Switched from regulator_enable() to devm_regulator_get_enable()
- Removed obvious comments.
- Link to v2: https://lore.kernel.org/r/20241122-ds2482-add-reg-v2-0-a5a03ee74da7@gmail.com
Changes in v2:
- Removed property description
- Changed commit message of binding commit
- Link to v1: https://lore.kernel.org/r/20241115-ds2482-add-reg-v1-0-cc84b9aba126@gmail.com
---
Kryštof Černý (3):
w1: ds2482: Add regulator support
w1: ds2482: Fix datasheet URL
dt-bindings: w1: ds2482: Add vcc-supply property
Documentation/devicetree/bindings/w1/maxim,ds2482.yaml | 2 ++
drivers/w1/masters/ds2482.c | 10 +++++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
---
base-commit: 6d59cab07b8d74d0f0422b750038123334f6ecc2
change-id: 20241111-ds2482-add-reg-fe13200ad7d6
Best regards,
--
Kryštof Černý <cleverline1mc@gmail.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v3 1/3] w1: ds2482: Add regulator support
2024-11-24 16:21 [PATCH v3 0/3] Add support for attaching a regulator to w1: ds2482 Kryštof Černý via B4 Relay
@ 2024-11-24 16:21 ` Kryštof Černý via B4 Relay
2024-11-25 15:49 ` Stefan Wahren
2024-11-24 16:21 ` [PATCH v3 2/3] w1: ds2482: Fix datasheet URL Kryštof Černý via B4 Relay
2024-11-24 16:21 ` [PATCH v3 3/3] dt-bindings: w1: ds2482: Add vcc-supply property Kryštof Černý via B4 Relay
2 siblings, 1 reply; 10+ messages in thread
From: Kryštof Černý via B4 Relay @ 2024-11-24 16:21 UTC (permalink / raw)
To: Krzysztof Kozlowski, Rob Herring, Conor Dooley, Stefan Wahren
Cc: Ben Gardner, linux-kernel, devicetree, Kryštof Černý
From: Kryštof Černý <cleverline1mc@gmail.com>
Adds a support for attaching a supply regulator.
Signed-off-by: Kryštof Černý <cleverline1mc@gmail.com>
---
drivers/w1/masters/ds2482.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/w1/masters/ds2482.c b/drivers/w1/masters/ds2482.c
index a2ecbb863c57f38bffc8e3cd463db1940e603179..4cb05d00cb6743abc5699583f591ef9b5339b44e 100644
--- a/drivers/w1/masters/ds2482.c
+++ b/drivers/w1/masters/ds2482.c
@@ -15,6 +15,7 @@
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/delay.h>
+#include <linux/regulator/consumer.h>
#include <linux/w1.h>
@@ -445,6 +446,7 @@ static int ds2482_probe(struct i2c_client *client)
int err = -ENODEV;
int temp1;
int idx;
+ int ret;
if (!i2c_check_functionality(client->adapter,
I2C_FUNC_SMBUS_WRITE_BYTE_DATA |
@@ -457,6 +459,12 @@ static int ds2482_probe(struct i2c_client *client)
goto exit;
}
+ ret = devm_regulator_get_enable(&client->dev, "vcc");
+ if (ret) {
+ dev_err(&client->dev, "Fail to enable regulator\n");
+ return ret;
+ }
+
data->client = client;
i2c_set_clientdata(client, data);
--
2.39.5
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v3 2/3] w1: ds2482: Fix datasheet URL
2024-11-24 16:21 [PATCH v3 0/3] Add support for attaching a regulator to w1: ds2482 Kryštof Černý via B4 Relay
2024-11-24 16:21 ` [PATCH v3 1/3] w1: ds2482: Add regulator support Kryštof Černý via B4 Relay
@ 2024-11-24 16:21 ` Kryštof Černý via B4 Relay
2024-11-24 16:21 ` [PATCH v3 3/3] dt-bindings: w1: ds2482: Add vcc-supply property Kryštof Černý via B4 Relay
2 siblings, 0 replies; 10+ messages in thread
From: Kryštof Černý via B4 Relay @ 2024-11-24 16:21 UTC (permalink / raw)
To: Krzysztof Kozlowski, Rob Herring, Conor Dooley, Stefan Wahren
Cc: Ben Gardner, linux-kernel, devicetree, Kryštof Černý
From: Kryštof Černý <cleverline1mc@gmail.com>
Current link does redirect to wrong place.
Signed-off-by: Kryštof Černý <cleverline1mc@gmail.com>
---
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 4cb05d00cb6743abc5699583f591ef9b5339b44e..48b4eb7299cb9ba0fc7df6ee7908f1e1709cf303 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
*/
#include <linux/module.h>
--
2.39.5
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v3 3/3] dt-bindings: w1: ds2482: Add vcc-supply property
2024-11-24 16:21 [PATCH v3 0/3] Add support for attaching a regulator to w1: ds2482 Kryštof Černý via B4 Relay
2024-11-24 16:21 ` [PATCH v3 1/3] w1: ds2482: Add regulator support Kryštof Černý via B4 Relay
2024-11-24 16:21 ` [PATCH v3 2/3] w1: ds2482: Fix datasheet URL Kryštof Černý via B4 Relay
@ 2024-11-24 16:21 ` Kryštof Černý via B4 Relay
2024-11-25 15:40 ` Stefan Wahren
2024-11-25 18:35 ` [PATCH v3 3/3] dt-bindings: w1: ds2482: Add vcc-supply propertyy Conor Dooley
2 siblings, 2 replies; 10+ messages in thread
From: Kryštof Černý via B4 Relay @ 2024-11-24 16:21 UTC (permalink / raw)
To: Krzysztof Kozlowski, Rob Herring, Conor Dooley, Stefan Wahren
Cc: Ben Gardner, linux-kernel, devicetree, Kryštof Černý
From: Kryštof Černý <cleverline1mc@gmail.com>
ds2482 has a VCC pin, accepting 2.9-5.5 V.
Signed-off-by: Kryštof Černý <cleverline1mc@gmail.com>
---
Documentation/devicetree/bindings/w1/maxim,ds2482.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/w1/maxim,ds2482.yaml b/Documentation/devicetree/bindings/w1/maxim,ds2482.yaml
index 422becc6e1fa8d58665c5586ebdc611cd0b2c760..fe6b3f9a3f8bbd00366c3e36aad3ffa72ec1a31f 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
+ vcc-supply: true
+
required:
- compatible
- reg
--
2.39.5
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 3/3] dt-bindings: w1: ds2482: Add vcc-supply property
2024-11-24 16:21 ` [PATCH v3 3/3] dt-bindings: w1: ds2482: Add vcc-supply property Kryštof Černý via B4 Relay
@ 2024-11-25 15:40 ` Stefan Wahren
2024-11-25 22:39 ` Kryštof Černý
2024-11-25 18:35 ` [PATCH v3 3/3] dt-bindings: w1: ds2482: Add vcc-supply propertyy Conor Dooley
1 sibling, 1 reply; 10+ messages in thread
From: Stefan Wahren @ 2024-11-25 15:40 UTC (permalink / raw)
To: Kryštof Černý
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Ben Gardner,
Linux Kernel Mailing List,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
Hi Kryštof,
[fix messageid]
> From: Kryštof Černý <cleverline1mc@gmail.com>
>
> ds2482 has a VCC pin, accepting 2.9-5.5 V.
>
> Signed-off-by: Kryštof Černý <cleverline1mc@gmail.com>
Sorry, I'm not able to reply from my chargebyte address.
I'm fine with the content of this patch, but in case you need to send a
v4 please make this the first patch of the series.
Reviewed-by: Stefan Wahren <wahrenst@gmx.net>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 1/3] w1: ds2482: Add regulator support
2024-11-24 16:21 ` [PATCH v3 1/3] w1: ds2482: Add regulator support Kryštof Černý via B4 Relay
@ 2024-11-25 15:49 ` Stefan Wahren
0 siblings, 0 replies; 10+ messages in thread
From: Stefan Wahren @ 2024-11-25 15:49 UTC (permalink / raw)
To: Kryštof Černý
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Ben Gardner,
Linux Kernel Mailing List,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
Hi Kryštof,
> + ret = devm_regulator_get_enable(&client->dev, "vcc");
> + if (ret) {
> + dev_err(&client->dev, "Fail to enable regulator\n");
> + return ret;
> + }
I'm fine with using devm_regulator_get_enable() because it doesn't break
existing DTS like imx6ull-tarragon-master, which doesn't have vcc defined.
But please use dev_err_probe() here instead and s/Fail/Failed/ in the
error message.
Best regards
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 3/3] dt-bindings: w1: ds2482: Add vcc-supply propertyy
2024-11-24 16:21 ` [PATCH v3 3/3] dt-bindings: w1: ds2482: Add vcc-supply property Kryštof Černý via B4 Relay
2024-11-25 15:40 ` Stefan Wahren
@ 2024-11-25 18:35 ` Conor Dooley
1 sibling, 0 replies; 10+ messages in thread
From: Conor Dooley @ 2024-11-25 18:35 UTC (permalink / raw)
To: cleverline1mc
Cc: Krzysztof Kozlowski, Rob Herring, Conor Dooley, Stefan Wahren,
Ben Gardner, linux-kernel, devicetree
[-- Attachment #1: Type: text/plain, Size: 302 bytes --]
On Sun, Nov 24, 2024 at 05:21:37PM +0100, Kryštof Černý via B4 Relay wrote:
> From: Kryštof Černý <cleverline1mc@gmail.com>
>
> ds2482 has a VCC pin, accepting 2.9-5.5 V.
>
> Signed-off-by: Kryštof Černý <cleverline1mc@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 3/3] dt-bindings: w1: ds2482: Add vcc-supply property
2024-11-25 15:40 ` Stefan Wahren
@ 2024-11-25 22:39 ` Kryštof Černý
2024-11-26 7:42 ` Krzysztof Kozlowski
0 siblings, 1 reply; 10+ messages in thread
From: Kryštof Černý @ 2024-11-25 22:39 UTC (permalink / raw)
To: Stefan Wahren
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Ben Gardner,
Linux Kernel Mailing List,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
Hello Stefan,
> Hi Kryštof,
>
> [fix messageid]
>
>> From: Kryštof Černý <cleverline1mc@gmail.com>
>>
>> ds2482 has a VCC pin, accepting 2.9-5.5 V.
>>
>> Signed-off-by: Kryštof Černý <cleverline1mc@gmail.com>
>
> Sorry, I'm not able to reply from my chargebyte address.
>
> I'm fine with the content of this patch, but in case you need to send a
> v4 please make this the first patch of the series.
I will do it, could you point me to the documentation, where this is
specified, so I can avoid similar mistakes in the future?
> Reviewed-by: Stefan Wahren <wahrenst@gmx.net>
Thank you for your reviews,
Kryštof Černý
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 3/3] dt-bindings: w1: ds2482: Add vcc-supply property
2024-11-25 22:39 ` Kryštof Černý
@ 2024-11-26 7:42 ` Krzysztof Kozlowski
0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2024-11-26 7:42 UTC (permalink / raw)
To: Kryštof Černý, Stefan Wahren
Cc: Rob Herring, Conor Dooley, Ben Gardner,
Linux Kernel Mailing List,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
On 25/11/2024 23:39, Kryštof Černý wrote:
> Hello Stefan,
>
>> Hi Kryštof,
>>
>> [fix messageid]
>>
>>> From: Kryštof Černý <cleverline1mc@gmail.com>
>>>
>>> ds2482 has a VCC pin, accepting 2.9-5.5 V.
>>>
>>> Signed-off-by: Kryštof Černý <cleverline1mc@gmail.com>
>>
>> Sorry, I'm not able to reply from my chargebyte address.
>>
>> I'm fine with the content of this patch, but in case you need to send a
>> v4 please make this the first patch of the series.
>
> I will do it, could you point me to the documentation, where this is
> specified, so I can avoid similar mistakes in the future?
First, this is common sense: all ABI documentation must come before the
user actually starts using. Otherwise the series are not bisectable -
testing commit implementing ABI will point to errors in missing ABI
documentation.
Second, doc is submitting patches in bindings directory. Please also
read writing bindings doc, in the same place.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 3/3] dt-bindings: w1: ds2482: Add vcc-supply property
@ 2024-11-25 15:39 Stefan Wahren
0 siblings, 0 replies; 10+ messages in thread
From: Stefan Wahren @ 2024-11-25 15:39 UTC (permalink / raw)
To: Kryštof Černý
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Ben Gardner,
Linux Kernel Mailing List,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
Hi Kryštof,
> From: Kryštof Černý <cleverline1mc@gmail.com>
>
> ds2482 has a VCC pin, accepting 2.9-5.5 V.
>
> Signed-off-by: Kryštof Černý <cleverline1mc@gmail.com>
Sorry, I'm not able to reply from my chargebyte address.
I'm fine with the content of this patch, but in case you need to send a
v4 please make this the first patch of the series.
Reviewed-by: Stefan Wahren <wahrenst@gmx.net>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-11-26 7:42 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-24 16:21 [PATCH v3 0/3] Add support for attaching a regulator to w1: ds2482 Kryštof Černý via B4 Relay
2024-11-24 16:21 ` [PATCH v3 1/3] w1: ds2482: Add regulator support Kryštof Černý via B4 Relay
2024-11-25 15:49 ` Stefan Wahren
2024-11-24 16:21 ` [PATCH v3 2/3] w1: ds2482: Fix datasheet URL Kryštof Černý via B4 Relay
2024-11-24 16:21 ` [PATCH v3 3/3] dt-bindings: w1: ds2482: Add vcc-supply property Kryštof Černý via B4 Relay
2024-11-25 15:40 ` Stefan Wahren
2024-11-25 22:39 ` Kryštof Černý
2024-11-26 7:42 ` Krzysztof Kozlowski
2024-11-25 18:35 ` [PATCH v3 3/3] dt-bindings: w1: ds2482: Add vcc-supply propertyy Conor Dooley
2024-11-25 15:39 [PATCH v3 3/3] dt-bindings: w1: ds2482: Add vcc-supply property Stefan Wahren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®