public inbox for linux-aspeed@lists.ozlabs.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] dt-bindings: iio: adc: Add AST2700 ADC compatible strings
@ 2025-11-03 10:52 Billy Tsai
  2025-11-03 10:52 ` [PATCH v1 2/2] iio: adc: aspeed: Add AST2700 ADC support Billy Tsai
  2025-11-04 10:08 ` [PATCH v1 1/2] dt-bindings: iio: adc: Add AST2700 ADC compatible strings Krzysztof Kozlowski
  0 siblings, 2 replies; 5+ messages in thread
From: Billy Tsai @ 2025-11-03 10:52 UTC (permalink / raw)
  To: jic23, dlechner, nuno.sa, andy, robh, krzk+dt, conor+dt, joel,
	andrew, billy_tsai, linux-iio, devicetree, linux-arm-kernel,
	linux-aspeed, linux-kernel

Add the compatible strings "aspeed,ast2700-adc0" and "aspeed,ast2700-adc1"
to the binding for the Aspeed ADC. These new compatibles represent the
ADC instances found on the AST2700 SoC, which are similar to the AST2600
but have their trimming data located at different SCU offset.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
---
 .../devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml         | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml b/Documentation/devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml
index 5c08d8b6e995..509bfb1007c4 100644
--- a/Documentation/devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml
@@ -29,6 +29,8 @@ properties:
     enum:
       - aspeed,ast2600-adc0
       - aspeed,ast2600-adc1
+      - aspeed,ast2700-adc0
+      - aspeed,ast2700-adc1
     description:
       Their trimming data, which is used to calibrate internal reference volage,
       locates in different address of OTP.
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v1 2/2] iio: adc: aspeed: Add AST2700 ADC support
  2025-11-03 10:52 [PATCH v1 1/2] dt-bindings: iio: adc: Add AST2700 ADC compatible strings Billy Tsai
@ 2025-11-03 10:52 ` Billy Tsai
  2025-11-03 15:20   ` David Lechner
  2025-11-04 10:08 ` [PATCH v1 1/2] dt-bindings: iio: adc: Add AST2700 ADC compatible strings Krzysztof Kozlowski
  1 sibling, 1 reply; 5+ messages in thread
From: Billy Tsai @ 2025-11-03 10:52 UTC (permalink / raw)
  To: jic23, dlechner, nuno.sa, andy, robh, krzk+dt, conor+dt, joel,
	andrew, billy_tsai, linux-iio, devicetree, linux-arm-kernel,
	linux-aspeed, linux-kernel

This patch adds support for the ADCs found on the Aspeed AST2700 SoC,
which includes two instances: "ast2700-adc0" and "ast2700-adc1". While
they are functionally similar to those on AST2600, the OTP trimming data
is located at the same offset (0x820), but uses different bitfields.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
---
 drivers/iio/adc/aspeed_adc.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/drivers/iio/adc/aspeed_adc.c b/drivers/iio/adc/aspeed_adc.c
index 8ab29948214a..9df6e7f68f19 100644
--- a/drivers/iio/adc/aspeed_adc.c
+++ b/drivers/iio/adc/aspeed_adc.c
@@ -646,6 +646,16 @@ static const struct aspeed_adc_trim_locate ast2600_adc1_trim = {
 	.field = GENMASK(7, 4),
 };
 
+static const struct aspeed_adc_trim_locate ast2700_adc0_trim = {
+	.offset = 0x820,
+	.field = GENMASK(3, 0),
+};
+
+static const struct aspeed_adc_trim_locate ast2700_adc1_trim = {
+	.offset = 0x820,
+	.field = GENMASK(7, 4),
+};
+
 static const struct aspeed_adc_model_data ast2400_model_data = {
 	.model_name = "ast2400-adc",
 	.vref_fixed_mv = 2500,
@@ -690,11 +700,35 @@ static const struct aspeed_adc_model_data ast2600_adc1_model_data = {
 	.trim_locate = &ast2600_adc1_trim,
 };
 
+static const struct aspeed_adc_model_data ast2700_adc0_model_data = {
+	.model_name = "ast2700-adc0",
+	.min_sampling_rate = 10000,
+	.max_sampling_rate = 500000,
+	.wait_init_sequence = true,
+	.bat_sense_sup = true,
+	.scaler_bit_width = 16,
+	.num_channels = 8,
+	.trim_locate = &ast2700_adc0_trim,
+};
+
+static const struct aspeed_adc_model_data ast2700_adc1_model_data = {
+	.model_name = "ast2700-adc1",
+	.min_sampling_rate = 10000,
+	.max_sampling_rate = 500000,
+	.wait_init_sequence = true,
+	.bat_sense_sup = true,
+	.scaler_bit_width = 16,
+	.num_channels = 8,
+	.trim_locate = &ast2700_adc1_trim,
+};
+
 static const struct of_device_id aspeed_adc_matches[] = {
 	{ .compatible = "aspeed,ast2400-adc", .data = &ast2400_model_data },
 	{ .compatible = "aspeed,ast2500-adc", .data = &ast2500_model_data },
 	{ .compatible = "aspeed,ast2600-adc0", .data = &ast2600_adc0_model_data },
 	{ .compatible = "aspeed,ast2600-adc1", .data = &ast2600_adc1_model_data },
+	{ .compatible = "aspeed,ast2700-adc0", .data = &ast2700_adc0_model_data },
+	{ .compatible = "aspeed,ast2700-adc1", .data = &ast2700_adc1_model_data },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, aspeed_adc_matches);
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 2/2] iio: adc: aspeed: Add AST2700 ADC support
  2025-11-03 10:52 ` [PATCH v1 2/2] iio: adc: aspeed: Add AST2700 ADC support Billy Tsai
@ 2025-11-03 15:20   ` David Lechner
  2025-11-09 15:03     ` Jonathan Cameron
  0 siblings, 1 reply; 5+ messages in thread
From: David Lechner @ 2025-11-03 15:20 UTC (permalink / raw)
  To: Billy Tsai, jic23, nuno.sa, andy, robh, krzk+dt, conor+dt, joel,
	andrew, linux-iio, devicetree, linux-arm-kernel, linux-aspeed,
	linux-kernel

On 11/3/25 4:52 AM, Billy Tsai wrote:
> This patch adds support for the ADCs found on the Aspeed AST2700 SoC,
> which includes two instances: "ast2700-adc0" and "ast2700-adc1". While
> they are functionally similar to those on AST2600, the OTP trimming data
> is located at the same offset (0x820), but uses different bitfields.
> 
> Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
> ---
Reviewed-by: David Lechner <dlechner@baylibre.com>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/2] dt-bindings: iio: adc: Add AST2700 ADC compatible strings
  2025-11-03 10:52 [PATCH v1 1/2] dt-bindings: iio: adc: Add AST2700 ADC compatible strings Billy Tsai
  2025-11-03 10:52 ` [PATCH v1 2/2] iio: adc: aspeed: Add AST2700 ADC support Billy Tsai
@ 2025-11-04 10:08 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-04 10:08 UTC (permalink / raw)
  To: Billy Tsai
  Cc: jic23, dlechner, nuno.sa, andy, robh, krzk+dt, conor+dt, joel,
	andrew, linux-iio, devicetree, linux-arm-kernel, linux-aspeed,
	linux-kernel

On Mon, Nov 03, 2025 at 06:52:16PM +0800, Billy Tsai wrote:
> Add the compatible strings "aspeed,ast2700-adc0" and "aspeed,ast2700-adc1"
> to the binding for the Aspeed ADC. These new compatibles represent the
> ADC instances found on the AST2700 SoC, which are similar to the AST2600
> but have their trimming data located at different SCU offset.
> 
> Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
> ---
>  .../devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml         | 2 ++
>  1 file changed, 2 insertions(+)

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 2/2] iio: adc: aspeed: Add AST2700 ADC support
  2025-11-03 15:20   ` David Lechner
@ 2025-11-09 15:03     ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2025-11-09 15:03 UTC (permalink / raw)
  To: David Lechner
  Cc: Billy Tsai, nuno.sa, andy, robh, krzk+dt, conor+dt, joel, andrew,
	linux-iio, devicetree, linux-arm-kernel, linux-aspeed,
	linux-kernel

On Mon, 3 Nov 2025 09:20:48 -0600
David Lechner <dlechner@baylibre.com> wrote:

> On 11/3/25 4:52 AM, Billy Tsai wrote:
> > This patch adds support for the ADCs found on the Aspeed AST2700 SoC,
> > which includes two instances: "ast2700-adc0" and "ast2700-adc1". While
> > they are functionally similar to those on AST2600, the OTP trimming data
> > is located at the same offset (0x820), but uses different bitfields.
> > 
> > Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
> > ---  
> Reviewed-by: David Lechner <dlechner@baylibre.com>
> 

Series applied.  I'd have preferred a cover letter given more than one patch
as it both gives a meaningful series name in patchwork and provides a common
place for replies like this one.

Thanks,

Jonathan


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-11-09 15:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-03 10:52 [PATCH v1 1/2] dt-bindings: iio: adc: Add AST2700 ADC compatible strings Billy Tsai
2025-11-03 10:52 ` [PATCH v1 2/2] iio: adc: aspeed: Add AST2700 ADC support Billy Tsai
2025-11-03 15:20   ` David Lechner
2025-11-09 15:03     ` Jonathan Cameron
2025-11-04 10:08 ` [PATCH v1 1/2] dt-bindings: iio: adc: Add AST2700 ADC compatible strings Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox