* [v2 1/2] iio: adc: aspeed: Remove the trim valid dts property.
@ 2022-11-07 9:15 Billy Tsai
2022-11-07 9:15 ` [v2 2/2] dt-bindings: iio: adc: Remove the property "aspeed,trim-data-valid" Billy Tsai
0 siblings, 1 reply; 4+ messages in thread
From: Billy Tsai @ 2022-11-07 9:15 UTC (permalink / raw)
To: jic23, lars, robh+dt, krzysztof.kozlowski+dt, joel, andrew,
billy_tsai, linmq006, linux-iio, devicetree, linux-arm-kernel,
linux-aspeed, linux-kernel
The dts property "aspeed,trim-data-valid" is currently used to determine
whether to read trimming data from the OTP register. If this is set on
a device without valid trimming data in the OTP the ADC will not function
correctly. This patch drops the use of this property and instead uses the
default (unprogrammed) OTP value of 0 to detect when a fallback value of
0x8 should be used rather then the value read from the OTP.
Fixes: d0a4c17b4073 ("iio: adc: aspeed: Get and set trimming data.")
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
---
drivers/iio/adc/aspeed_adc.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/iio/adc/aspeed_adc.c b/drivers/iio/adc/aspeed_adc.c
index 9341e0e0eb55..998e8bcc06e1 100644
--- a/drivers/iio/adc/aspeed_adc.c
+++ b/drivers/iio/adc/aspeed_adc.c
@@ -202,6 +202,8 @@ static int aspeed_adc_set_trim_data(struct iio_dev *indio_dev)
((scu_otp) &
(data->model_data->trim_locate->field)) >>
__ffs(data->model_data->trim_locate->field);
+ if (!trimming_val)
+ trimming_val = 0x8;
}
dev_dbg(data->dev,
"trimming val = %d, offset = %08x, fields = %08x\n",
@@ -563,12 +565,9 @@ static int aspeed_adc_probe(struct platform_device *pdev)
if (ret)
return ret;
- if (of_find_property(data->dev->of_node, "aspeed,trim-data-valid",
- NULL)) {
- ret = aspeed_adc_set_trim_data(indio_dev);
- if (ret)
- return ret;
- }
+ ret = aspeed_adc_set_trim_data(indio_dev);
+ if (ret)
+ return ret;
if (of_find_property(data->dev->of_node, "aspeed,battery-sensing",
NULL)) {
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [v2 2/2] dt-bindings: iio: adc: Remove the property "aspeed,trim-data-valid"
2022-11-07 9:15 [v2 1/2] iio: adc: aspeed: Remove the trim valid dts property Billy Tsai
@ 2022-11-07 9:15 ` Billy Tsai
2022-11-07 9:16 ` Krzysztof Kozlowski
0 siblings, 1 reply; 4+ messages in thread
From: Billy Tsai @ 2022-11-07 9:15 UTC (permalink / raw)
To: jic23, lars, robh+dt, krzysztof.kozlowski+dt, joel, andrew,
billy_tsai, linmq006, linux-iio, devicetree, linux-arm-kernel,
linux-aspeed, linux-kernel
The valid of the trimming data will use the otp default value as a
criterion.
Fixes: 2bdb2f00a895 ("dt-bindings: iio: adc: Add ast2600-adc bindings")
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
---
.../devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml | 7 -------
1 file changed, 7 deletions(-)
diff --git a/Documentation/devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml b/Documentation/devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml
index b283c8ca2bbf..5c08d8b6e995 100644
--- a/Documentation/devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml
@@ -62,13 +62,6 @@ properties:
description:
Inform the driver that last channel will be used to sensor battery.
- aspeed,trim-data-valid:
- type: boolean
- description: |
- The ADC reference voltage can be calibrated to obtain the trimming
- data which will be stored in otp. This property informs the driver that
- the data store in the otp is valid.
-
required:
- compatible
- reg
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [v2 2/2] dt-bindings: iio: adc: Remove the property "aspeed,trim-data-valid"
2022-11-07 9:15 ` [v2 2/2] dt-bindings: iio: adc: Remove the property "aspeed,trim-data-valid" Billy Tsai
@ 2022-11-07 9:16 ` Krzysztof Kozlowski
2022-11-12 16:38 ` Jonathan Cameron
0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-07 9:16 UTC (permalink / raw)
To: Billy Tsai, jic23, lars, robh+dt, krzysztof.kozlowski+dt, joel,
andrew, linmq006, linux-iio, devicetree, linux-arm-kernel,
linux-aspeed, linux-kernel
On 07/11/2022 10:15, Billy Tsai wrote:
> The valid of the trimming data will use the otp default value as a
> criterion.
>
> Fixes: 2bdb2f00a895 ("dt-bindings: iio: adc: Add ast2600-adc bindings")
If this is a fix, you need to describe the bug.
> Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
This is a friendly reminder during the review process.
It looks like you received a tag and forgot to add it.
If you do not know the process, here is a short explanation:
Please add Acked-by/Reviewed-by/Tested-by tags when posting new
versions. However, there's no need to repost patches *only* to add the
tags. The upstream maintainer will do that for acks received on the
version they apply.
https://elixir.bootlin.com/linux/v5.17/source/Documentation/process/submitting-patches.rst#L540
If a tag was not added on purpose, please state why and what changed.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [v2 2/2] dt-bindings: iio: adc: Remove the property "aspeed,trim-data-valid"
2022-11-07 9:16 ` Krzysztof Kozlowski
@ 2022-11-12 16:38 ` Jonathan Cameron
0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2022-11-12 16:38 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Billy Tsai, lars, robh+dt, krzysztof.kozlowski+dt, joel, andrew,
linmq006, linux-iio, devicetree, linux-arm-kernel, linux-aspeed,
linux-kernel
On Mon, 7 Nov 2022 10:16:31 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> On 07/11/2022 10:15, Billy Tsai wrote:
> > The valid of the trimming data will use the otp default value as a
> > criterion.
> >
> > Fixes: 2bdb2f00a895 ("dt-bindings: iio: adc: Add ast2600-adc bindings")
>
> If this is a fix, you need to describe the bug.
Hi Billy,
Please pull forwards some of the description from the previous patch.
Key thing is that people may be looking at the two parts of the
fix independently.
Also as Krzysztof noted, pick up Rob's tag for v3.
>
> > Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
>
> This is a friendly reminder during the review process.
>
> It looks like you received a tag and forgot to add it.
>
> If you do not know the process, here is a short explanation:
> Please add Acked-by/Reviewed-by/Tested-by tags when posting new
> versions. However, there's no need to repost patches *only* to add the
> tags. The upstream maintainer will do that for acks received on the
> version they apply.
>
> https://elixir.bootlin.com/linux/v5.17/source/Documentation/process/submitting-patches.rst#L540
>
> If a tag was not added on purpose, please state why and what changed.
>
>
> Best regards,
> Krzysztof
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-12 16:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-07 9:15 [v2 1/2] iio: adc: aspeed: Remove the trim valid dts property Billy Tsai
2022-11-07 9:15 ` [v2 2/2] dt-bindings: iio: adc: Remove the property "aspeed,trim-data-valid" Billy Tsai
2022-11-07 9:16 ` Krzysztof Kozlowski
2022-11-12 16:38 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).