linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Enable RTP (GPADC) controller on Allwinner R40
@ 2021-11-19 19:14 Evgeny Boger
  2021-11-19 19:14 ` [PATCH 1/3] iio: adc: sun4i-gpadc-iio: no temp sensor on R40 Evgeny Boger
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Evgeny Boger @ 2021-11-19 19:14 UTC (permalink / raw)
  To: Chen-Yu Tsai, linux-sunxi, Maxime Ripard
  Cc: Evgeny Boger, Lee Jones, Rob Herring, devicetree, Jernej Skrabec,
	linux-arm-kernel


R40 SoC has touchscreen controller also serving as general-purpose ADC.
The hardware is very similar to A31, except that R40 has separate
calibrated thermal sensor IP, so temperature sensing channel in RTP is
not documented and is not to be used.


Evgeny Boger (3):
  iio: adc: sun4i-gpadc-iio: no temp sensor on R40
  dt-bindings: iio: adc: new compatible for Allwinner R40 RTP controller
  ARM: dts: sun8i: r40: add rtp node

 .../bindings/mfd/allwinner,sun4i-a10-ts.yaml  |  1 +
 arch/arm/boot/dts/sun8i-r40.dtsi              |  8 +++++
 drivers/iio/adc/sun4i-gpadc-iio.c             | 32 ++++++++++++++-----
 drivers/mfd/sun4i-gpadc.c                     | 17 ++++++++++
 4 files changed, 50 insertions(+), 8 deletions(-)

-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/3] iio: adc: sun4i-gpadc-iio: no temp sensor on R40
  2021-11-19 19:14 [PATCH 0/3] Enable RTP (GPADC) controller on Allwinner R40 Evgeny Boger
@ 2021-11-19 19:14 ` Evgeny Boger
  2021-11-22  9:11   ` Maxime Ripard
  2022-01-17  9:00   ` Lee Jones
  2021-11-19 19:14 ` [PATCH 2/3] dt-bindings: iio: adc: new compatible for Allwinner R40 RTP controller Evgeny Boger
  2021-11-19 19:14 ` [PATCH 3/3] ARM: dts: sun8i: r40: add rtp node Evgeny Boger
  2 siblings, 2 replies; 11+ messages in thread
From: Evgeny Boger @ 2021-11-19 19:14 UTC (permalink / raw)
  To: Chen-Yu Tsai, linux-sunxi, Maxime Ripard
  Cc: Evgeny Boger, Lee Jones, Rob Herring, devicetree, Jernej Skrabec,
	linux-arm-kernel

R40 SoC has touchscreen controller also serving as general-purpose ADC.
The hardware is very similar to A31, except that R40 has separate
calibrated thermal sensor IP (handled by sun8i_thermal).

Despite the temperature sensor in the RTP is never mentioned in
the R40 family user manuals, it appears to be working. However,
it's not very useful as it lacks calibration data and there is another
fully functioning temperature sensor anyway.

This patch disables the temperature sensor in RTP/GPADC IP on R40.

The reason for disabling the temperature sensor is that the IP
needs to be switched back and forth between RTP and GPADC modes for
temperature measurements. Not only this introduces delays, but it also
disturbs external circuitry by injecting current into ADC inputs.

Signed-off-by: Evgeny Boger <boger@wirenboard.com>
---
 drivers/iio/adc/sun4i-gpadc-iio.c | 32 +++++++++++++++++++++++--------
 drivers/mfd/sun4i-gpadc.c         | 17 ++++++++++++++++
 2 files changed, 41 insertions(+), 8 deletions(-)

diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c
index 2d393a4dfff6..e63a45c092ab 100644
--- a/drivers/iio/adc/sun4i-gpadc-iio.c
+++ b/drivers/iio/adc/sun4i-gpadc-iio.c
@@ -53,6 +53,7 @@ struct gpadc_data {
 	unsigned int	tp_adc_select;
 	unsigned int	(*adc_chan_select)(unsigned int chan);
 	unsigned int	adc_chan_mask;
+	bool            has_temp_sensor;
 };
 
 static const struct gpadc_data sun4i_gpadc_data = {
@@ -62,6 +63,7 @@ static const struct gpadc_data sun4i_gpadc_data = {
 	.tp_adc_select = SUN4I_GPADC_CTRL1_TP_ADC_SELECT,
 	.adc_chan_select = &sun4i_gpadc_chan_select,
 	.adc_chan_mask = SUN4I_GPADC_CTRL1_ADC_CHAN_MASK,
+	.has_temp_sensor = true,
 };
 
 static const struct gpadc_data sun5i_gpadc_data = {
@@ -71,6 +73,7 @@ static const struct gpadc_data sun5i_gpadc_data = {
 	.tp_adc_select = SUN4I_GPADC_CTRL1_TP_ADC_SELECT,
 	.adc_chan_select = &sun4i_gpadc_chan_select,
 	.adc_chan_mask = SUN4I_GPADC_CTRL1_ADC_CHAN_MASK,
+	.has_temp_sensor = true,
 };
 
 static const struct gpadc_data sun6i_gpadc_data = {
@@ -80,12 +83,24 @@ static const struct gpadc_data sun6i_gpadc_data = {
 	.tp_adc_select = SUN6I_GPADC_CTRL1_TP_ADC_SELECT,
 	.adc_chan_select = &sun6i_gpadc_chan_select,
 	.adc_chan_mask = SUN6I_GPADC_CTRL1_ADC_CHAN_MASK,
+	.has_temp_sensor = true,
+};
+
+static const struct gpadc_data sun8i_r40_gpadc_data = {
+	.temp_offset = -1623,
+	.temp_scale = 167,
+	.tp_mode_en = SUN6I_GPADC_CTRL1_TP_MODE_EN,
+	.tp_adc_select = SUN6I_GPADC_CTRL1_TP_ADC_SELECT,
+	.adc_chan_select = &sun6i_gpadc_chan_select,
+	.adc_chan_mask = SUN6I_GPADC_CTRL1_ADC_CHAN_MASK,
+	.has_temp_sensor = false,
 };
 
 static const struct gpadc_data sun8i_a33_gpadc_data = {
 	.temp_offset = -1662,
 	.temp_scale = 162,
 	.tp_mode_en = SUN8I_GPADC_CTRL1_CHOP_TEMP_EN,
+	.has_temp_sensor = true,
 };
 
 struct sun4i_gpadc_iio {
@@ -499,7 +514,7 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev,
 	void __iomem *base;
 	int ret;
 
-	info->data = of_device_get_match_data(&pdev->dev);
+	info->data = (struct gpadc_data *)of_device_get_match_data(&pdev->dev);
 	if (!info->data)
 		return -ENODEV;
 
@@ -519,7 +534,7 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev,
 		return ret;
 	}
 
-	if (IS_ENABLED(CONFIG_THERMAL_OF))
+	if (IS_ENABLED(CONFIG_THERMAL_OF) && info->data->has_temp_sensor)
 		info->sensor_device = &pdev->dev;
 
 	return 0;
@@ -552,7 +567,7 @@ static int sun4i_gpadc_probe_mfd(struct platform_device *pdev,
 	 * that choice to the user.
 	 */
 
-	if (IS_ENABLED(CONFIG_THERMAL_OF)) {
+	if (IS_ENABLED(CONFIG_THERMAL_OF) && info->data->has_temp_sensor) {
 		/*
 		 * This driver is a child of an MFD which has a node in the DT
 		 * but not its children, because of DT backward compatibility
@@ -575,7 +590,7 @@ static int sun4i_gpadc_probe_mfd(struct platform_device *pdev,
 		indio_dev->channels = sun4i_gpadc_channels_no_temp;
 	}
 
-	if (IS_ENABLED(CONFIG_THERMAL_OF)) {
+	if (IS_ENABLED(CONFIG_THERMAL_OF) && info->data->has_temp_sensor) {
 		ret = sun4i_irq_init(pdev, "TEMP_DATA_PENDING",
 				     sun4i_gpadc_temp_data_irq_handler,
 				     "temp_data", &info->temp_data_irq,
@@ -590,7 +605,7 @@ static int sun4i_gpadc_probe_mfd(struct platform_device *pdev,
 	if (ret < 0)
 		return ret;
 
-	if (IS_ENABLED(CONFIG_THERMAL_OF)) {
+	if (IS_ENABLED(CONFIG_THERMAL_OF) && info->data->has_temp_sensor) {
 		ret = iio_map_array_register(indio_dev, sun4i_gpadc_hwmon_maps);
 		if (ret < 0) {
 			dev_err(&pdev->dev,
@@ -636,7 +651,7 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
 	pm_runtime_set_suspended(&pdev->dev);
 	pm_runtime_enable(&pdev->dev);
 
-	if (IS_ENABLED(CONFIG_THERMAL_OF)) {
+	if (IS_ENABLED(CONFIG_THERMAL_OF) && info->data->has_temp_sensor) {
 		info->tzd = thermal_zone_of_sensor_register(info->sensor_device,
 							    0, info,
 							    &sun4i_ts_tz_ops);
@@ -661,7 +676,7 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
 	return 0;
 
 err_map:
-	if (!info->no_irq && IS_ENABLED(CONFIG_THERMAL_OF))
+	if (!info->no_irq && IS_ENABLED(CONFIG_THERMAL_OF) && info->data->has_temp_sensor)
 		iio_map_array_unregister(indio_dev);
 
 	pm_runtime_put(&pdev->dev);
@@ -678,7 +693,7 @@ static int sun4i_gpadc_remove(struct platform_device *pdev)
 	pm_runtime_put(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 
-	if (!IS_ENABLED(CONFIG_THERMAL_OF))
+	if (!IS_ENABLED(CONFIG_THERMAL_OF) || !info->data->has_temp_sensor)
 		return 0;
 
 	thermal_zone_of_sensor_unregister(info->sensor_device, info->tzd);
@@ -693,6 +708,7 @@ static const struct platform_device_id sun4i_gpadc_id[] = {
 	{ "sun4i-a10-gpadc-iio", (kernel_ulong_t)&sun4i_gpadc_data },
 	{ "sun5i-a13-gpadc-iio", (kernel_ulong_t)&sun5i_gpadc_data },
 	{ "sun6i-a31-gpadc-iio", (kernel_ulong_t)&sun6i_gpadc_data },
+	{ "sun8i-r40-gpadc-iio", (kernel_ulong_t)&sun8i_r40_gpadc_data },
 	{ /* sentinel */ },
 };
 MODULE_DEVICE_TABLE(platform, sun4i_gpadc_id);
diff --git a/drivers/mfd/sun4i-gpadc.c b/drivers/mfd/sun4i-gpadc.c
index cfe14d9bf6dc..293acad52e5a 100644
--- a/drivers/mfd/sun4i-gpadc.c
+++ b/drivers/mfd/sun4i-gpadc.c
@@ -17,6 +17,7 @@
 #define ARCH_SUN4I_A10 0
 #define ARCH_SUN5I_A13 1
 #define ARCH_SUN6I_A31 2
+#define ARCH_SUN8I_R40 3
 
 static const struct resource adc_resources[] = {
 	DEFINE_RES_IRQ_NAMED(SUN4I_GPADC_IRQ_FIFO_DATA, "FIFO_DATA_PENDING"),
@@ -69,6 +70,15 @@ static struct mfd_cell sun6i_gpadc_cells[] = {
 	{ .name = "iio_hwmon" },
 };
 
+static struct mfd_cell sun8i_r40_gpadc_cells[] = {
+	{
+		.name	= "sun8i-r40-gpadc-iio",
+		.resources = adc_resources,
+		.num_resources = ARRAY_SIZE(adc_resources),
+	},
+	{ .name = "iio_hwmon" },
+};
+
 static const struct regmap_config sun4i_gpadc_regmap_config = {
 	.reg_bits = 32,
 	.val_bits = 32,
@@ -86,6 +96,9 @@ static const struct of_device_id sun4i_gpadc_of_match[] = {
 	}, {
 		.compatible = "allwinner,sun6i-a31-ts",
 		.data = (void *)ARCH_SUN6I_A31,
+	}, {
+		.compatible = "allwinner,sun8i-r40-ts",
+		.data = (void *)ARCH_SUN8I_R40,
 	}, { /* sentinel */ }
 };
 
@@ -117,6 +130,10 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
 		cells = sun6i_gpadc_cells;
 		size = ARRAY_SIZE(sun6i_gpadc_cells);
 		break;
+	case ARCH_SUN8I_R40:
+		cells = sun8i_r40_gpadc_cells;
+		size = ARRAY_SIZE(sun8i_r40_gpadc_cells);
+		break;
 	default:
 		return -EINVAL;
 	}
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/3] dt-bindings: iio: adc: new compatible for Allwinner R40 RTP controller
  2021-11-19 19:14 [PATCH 0/3] Enable RTP (GPADC) controller on Allwinner R40 Evgeny Boger
  2021-11-19 19:14 ` [PATCH 1/3] iio: adc: sun4i-gpadc-iio: no temp sensor on R40 Evgeny Boger
@ 2021-11-19 19:14 ` Evgeny Boger
  2021-11-22  9:10   ` Maxime Ripard
  2021-11-30  1:46   ` Rob Herring
  2021-11-19 19:14 ` [PATCH 3/3] ARM: dts: sun8i: r40: add rtp node Evgeny Boger
  2 siblings, 2 replies; 11+ messages in thread
From: Evgeny Boger @ 2021-11-19 19:14 UTC (permalink / raw)
  To: Chen-Yu Tsai, linux-sunxi, Maxime Ripard
  Cc: Evgeny Boger, Lee Jones, Rob Herring, devicetree, Jernej Skrabec,
	linux-arm-kernel

R40 SoC has touchscreen controller also serving as general-purpose ADC.
The hardware is very similar to A31, except that R40 has separate
calibrated thermal sensor IP, so temperature sensing channel in RTP is
not documented and is not to be used.

Signed-off-by: Evgeny Boger <boger@wirenboard.com>
---
 .../devicetree/bindings/mfd/allwinner,sun4i-a10-ts.yaml          | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/mfd/allwinner,sun4i-a10-ts.yaml b/Documentation/devicetree/bindings/mfd/allwinner,sun4i-a10-ts.yaml
index f591332fc462..6214477465b8 100644
--- a/Documentation/devicetree/bindings/mfd/allwinner,sun4i-a10-ts.yaml
+++ b/Documentation/devicetree/bindings/mfd/allwinner,sun4i-a10-ts.yaml
@@ -19,6 +19,7 @@ properties:
       - allwinner,sun4i-a10-ts
       - allwinner,sun5i-a13-ts
       - allwinner,sun6i-a31-ts
+      - allwinner,sun8i-r40-ts
 
   reg:
     maxItems: 1
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 3/3] ARM: dts: sun8i: r40: add rtp node
  2021-11-19 19:14 [PATCH 0/3] Enable RTP (GPADC) controller on Allwinner R40 Evgeny Boger
  2021-11-19 19:14 ` [PATCH 1/3] iio: adc: sun4i-gpadc-iio: no temp sensor on R40 Evgeny Boger
  2021-11-19 19:14 ` [PATCH 2/3] dt-bindings: iio: adc: new compatible for Allwinner R40 RTP controller Evgeny Boger
@ 2021-11-19 19:14 ` Evgeny Boger
  2 siblings, 0 replies; 11+ messages in thread
From: Evgeny Boger @ 2021-11-19 19:14 UTC (permalink / raw)
  To: Chen-Yu Tsai, linux-sunxi, Maxime Ripard
  Cc: Evgeny Boger, Lee Jones, Rob Herring, devicetree, Jernej Skrabec,
	linux-arm-kernel

R40 SoC has touchscreen controller also serving as general-purpose ADC.
The hardware is very similar to A31, except that R40 has separate
calibrated thermal sensor IP, so temperature sensing channel in RTP is
not documented and is not to be used.

Signed-off-by: Evgeny Boger <boger@wirenboard.com>
---
 arch/arm/boot/dts/sun8i-r40.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi
index 1d87fc0c24ee..3e98f24c1400 100644
--- a/arch/arm/boot/dts/sun8i-r40.dtsi
+++ b/arch/arm/boot/dts/sun8i-r40.dtsi
@@ -786,6 +786,14 @@ ths: thermal-sensor@1c24c00 {
 			#thermal-sensor-cells = <1>;
 		};
 
+		rtp: rtp@1c25000 {
+			compatible = "allwinner,sun8i-r40-ts",
+				     "allwinner,sun6i-a31-ts";
+			reg = <0x01c25000 0x100>;
+			interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
+			#thermal-sensor-cells = <0>;
+		};
+
 		uart0: serial@1c28000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x01c28000 0x400>;
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/3] dt-bindings: iio: adc: new compatible for Allwinner R40 RTP controller
  2021-11-19 19:14 ` [PATCH 2/3] dt-bindings: iio: adc: new compatible for Allwinner R40 RTP controller Evgeny Boger
@ 2021-11-22  9:10   ` Maxime Ripard
  2021-11-30  1:46   ` Rob Herring
  1 sibling, 0 replies; 11+ messages in thread
From: Maxime Ripard @ 2021-11-22  9:10 UTC (permalink / raw)
  To: Evgeny Boger
  Cc: Chen-Yu Tsai, linux-sunxi, Lee Jones, Rob Herring, devicetree,
	Jernej Skrabec, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 437 bytes --]

On Fri, Nov 19, 2021 at 10:14:55PM +0300, Evgeny Boger wrote:
> R40 SoC has touchscreen controller also serving as general-purpose ADC.
> The hardware is very similar to A31, except that R40 has separate
> calibrated thermal sensor IP, so temperature sensing channel in RTP is
> not documented and is not to be used.
> 
> Signed-off-by: Evgeny Boger <boger@wirenboard.com>

Acked-by: Maxime Ripard <maxime@cerno.tech>

Maxime

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/3] iio: adc: sun4i-gpadc-iio: no temp sensor on R40
  2021-11-19 19:14 ` [PATCH 1/3] iio: adc: sun4i-gpadc-iio: no temp sensor on R40 Evgeny Boger
@ 2021-11-22  9:11   ` Maxime Ripard
  2021-11-22 12:41     ` Jonathan Cameron
  2022-01-17  9:00   ` Lee Jones
  1 sibling, 1 reply; 11+ messages in thread
From: Maxime Ripard @ 2021-11-22  9:11 UTC (permalink / raw)
  To: Evgeny Boger
  Cc: Chen-Yu Tsai, linux-sunxi, Lee Jones, Rob Herring, devicetree,
	Jernej Skrabec, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1000 bytes --]

On Fri, Nov 19, 2021 at 10:14:54PM +0300, Evgeny Boger wrote:
> R40 SoC has touchscreen controller also serving as general-purpose ADC.
> The hardware is very similar to A31, except that R40 has separate
> calibrated thermal sensor IP (handled by sun8i_thermal).
> 
> Despite the temperature sensor in the RTP is never mentioned in
> the R40 family user manuals, it appears to be working. However,
> it's not very useful as it lacks calibration data and there is another
> fully functioning temperature sensor anyway.
> 
> This patch disables the temperature sensor in RTP/GPADC IP on R40.
> 
> The reason for disabling the temperature sensor is that the IP
> needs to be switched back and forth between RTP and GPADC modes for
> temperature measurements. Not only this introduces delays, but it also
> disturbs external circuitry by injecting current into ADC inputs.
> 
> Signed-off-by: Evgeny Boger <boger@wirenboard.com>

Acked-by: Maxime Ripard <maxime@cerno.tech>

Maxime

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/3] iio: adc: sun4i-gpadc-iio: no temp sensor on R40
  2021-11-22  9:11   ` Maxime Ripard
@ 2021-11-22 12:41     ` Jonathan Cameron
  2022-01-11 13:13       ` Evgeny Boger
  0 siblings, 1 reply; 11+ messages in thread
From: Jonathan Cameron @ 2021-11-22 12:41 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Evgeny Boger, Chen-Yu Tsai, linux-sunxi, Lee Jones, Rob Herring,
	devicetree, Jernej Skrabec, linux-arm-kernel, linux-iio

On Mon, 22 Nov 2021 10:11:32 +0100
Maxime Ripard <maxime@cerno.tech> wrote:

> On Fri, Nov 19, 2021 at 10:14:54PM +0300, Evgeny Boger wrote:
> > R40 SoC has touchscreen controller also serving as general-purpose ADC.
> > The hardware is very similar to A31, except that R40 has separate
> > calibrated thermal sensor IP (handled by sun8i_thermal).
> > 
> > Despite the temperature sensor in the RTP is never mentioned in
> > the R40 family user manuals, it appears to be working. However,
> > it's not very useful as it lacks calibration data and there is another
> > fully functioning temperature sensor anyway.
> > 
> > This patch disables the temperature sensor in RTP/GPADC IP on R40.
> > 
> > The reason for disabling the temperature sensor is that the IP
> > needs to be switched back and forth between RTP and GPADC modes for
> > temperature measurements. Not only this introduces delays, but it also
> > disturbs external circuitry by injecting current into ADC inputs.
> > 
> > Signed-off-by: Evgeny Boger <boger@wirenboard.com>  
> 
> Acked-by: Maxime Ripard <maxime@cerno.tech>

+Cc linux-iio@vger.kernel.org

I'm fine with this and assuming Lee is happy to pick it up + send
me an immutable branch in case anything crosses with it this cycle..

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Thanks,

Jonathan

> 
> Maxime
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/3] dt-bindings: iio: adc: new compatible for Allwinner R40 RTP controller
  2021-11-19 19:14 ` [PATCH 2/3] dt-bindings: iio: adc: new compatible for Allwinner R40 RTP controller Evgeny Boger
  2021-11-22  9:10   ` Maxime Ripard
@ 2021-11-30  1:46   ` Rob Herring
  1 sibling, 0 replies; 11+ messages in thread
From: Rob Herring @ 2021-11-30  1:46 UTC (permalink / raw)
  To: Evgeny Boger
  Cc: Chen-Yu Tsai, linux-sunxi, linux-arm-kernel, Maxime Ripard,
	devicetree, Rob Herring, Jernej Skrabec, Lee Jones

On Fri, 19 Nov 2021 22:14:55 +0300, Evgeny Boger wrote:
> R40 SoC has touchscreen controller also serving as general-purpose ADC.
> The hardware is very similar to A31, except that R40 has separate
> calibrated thermal sensor IP, so temperature sensing channel in RTP is
> not documented and is not to be used.
> 
> Signed-off-by: Evgeny Boger <boger@wirenboard.com>
> ---
>  .../devicetree/bindings/mfd/allwinner,sun4i-a10-ts.yaml          | 1 +
>  1 file changed, 1 insertion(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/3] iio: adc: sun4i-gpadc-iio: no temp sensor on R40
  2021-11-22 12:41     ` Jonathan Cameron
@ 2022-01-11 13:13       ` Evgeny Boger
  2022-01-15 15:41         ` Jonathan Cameron
  0 siblings, 1 reply; 11+ messages in thread
From: Evgeny Boger @ 2022-01-11 13:13 UTC (permalink / raw)
  To: Jonathan Cameron, Maxime Ripard
  Cc: Chen-Yu Tsai, linux-sunxi, Lee Jones, Rob Herring, devicetree,
	Jernej Skrabec, linux-arm-kernel, linux-iio


22.11.2021 15:41, Jonathan Cameron пишет:
> On Mon, 22 Nov 2021 10:11:32 +0100
> Maxime Ripard <maxime@cerno.tech> wrote:
>
>> On Fri, Nov 19, 2021 at 10:14:54PM +0300, Evgeny Boger wrote:
>>> R40 SoC has touchscreen controller also serving as general-purpose ADC.
>>> The hardware is very similar to A31, except that R40 has separate
>>> calibrated thermal sensor IP (handled by sun8i_thermal).
>>>
>>> Despite the temperature sensor in the RTP is never mentioned in
>>> the R40 family user manuals, it appears to be working. However,
>>> it's not very useful as it lacks calibration data and there is another
>>> fully functioning temperature sensor anyway.
>>>
>>> This patch disables the temperature sensor in RTP/GPADC IP on R40.
>>>
>>> The reason for disabling the temperature sensor is that the IP
>>> needs to be switched back and forth between RTP and GPADC modes for
>>> temperature measurements. Not only this introduces delays, but it also
>>> disturbs external circuitry by injecting current into ADC inputs.
>>>
>>> Signed-off-by: Evgeny Boger <boger@wirenboard.com>
>> Acked-by: Maxime Ripard <maxime@cerno.tech>
> +Cc linux-iio@vger.kernel.org
>
> I'm fine with this and assuming Lee is happy to pick it up + send
> me an immutable branch in case anything crosses with it this cycle..
>
> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Hi Jonathan!

Is there anything else I should do to make this patch series accepted?


> Thanks,
>
> Jonathan
>
>> Maxime
>>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/3] iio: adc: sun4i-gpadc-iio: no temp sensor on R40
  2022-01-11 13:13       ` Evgeny Boger
@ 2022-01-15 15:41         ` Jonathan Cameron
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Cameron @ 2022-01-15 15:41 UTC (permalink / raw)
  To: Evgeny Boger
  Cc: Jonathan Cameron, Maxime Ripard, Chen-Yu Tsai, linux-sunxi,
	Lee Jones, Rob Herring, devicetree, Jernej Skrabec,
	linux-arm-kernel, linux-iio

On Tue, 11 Jan 2022 16:13:02 +0300
Evgeny Boger <boger@wirenboard.com> wrote:

> 22.11.2021 15:41, Jonathan Cameron пишет:
> > On Mon, 22 Nov 2021 10:11:32 +0100
> > Maxime Ripard <maxime@cerno.tech> wrote:
> >  
> >> On Fri, Nov 19, 2021 at 10:14:54PM +0300, Evgeny Boger wrote:  
> >>> R40 SoC has touchscreen controller also serving as general-purpose ADC.
> >>> The hardware is very similar to A31, except that R40 has separate
> >>> calibrated thermal sensor IP (handled by sun8i_thermal).
> >>>
> >>> Despite the temperature sensor in the RTP is never mentioned in
> >>> the R40 family user manuals, it appears to be working. However,
> >>> it's not very useful as it lacks calibration data and there is another
> >>> fully functioning temperature sensor anyway.
> >>>
> >>> This patch disables the temperature sensor in RTP/GPADC IP on R40.
> >>>
> >>> The reason for disabling the temperature sensor is that the IP
> >>> needs to be switched back and forth between RTP and GPADC modes for
> >>> temperature measurements. Not only this introduces delays, but it also
> >>> disturbs external circuitry by injecting current into ADC inputs.
> >>>
> >>> Signed-off-by: Evgeny Boger <boger@wirenboard.com>  
> >> Acked-by: Maxime Ripard <maxime@cerno.tech>  
> > +Cc linux-iio@vger.kernel.org
> >
> > I'm fine with this and assuming Lee is happy to pick it up + send
> > me an immutable branch in case anything crosses with it this cycle..
> >
> > Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>  
> 
> Hi Jonathan!
> 
> Is there anything else I should do to make this patch series accepted?

Perhaps try a resend to Lee Jones, making sure to cc linux-iio
Chances are it just got missed in the deluge!

Jonathan


> 
> 
> > Thanks,
> >
> > Jonathan
> >  
> >> Maxime
> >>  
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/3] iio: adc: sun4i-gpadc-iio: no temp sensor on R40
  2021-11-19 19:14 ` [PATCH 1/3] iio: adc: sun4i-gpadc-iio: no temp sensor on R40 Evgeny Boger
  2021-11-22  9:11   ` Maxime Ripard
@ 2022-01-17  9:00   ` Lee Jones
  1 sibling, 0 replies; 11+ messages in thread
From: Lee Jones @ 2022-01-17  9:00 UTC (permalink / raw)
  To: Evgeny Boger
  Cc: Chen-Yu Tsai, linux-sunxi, Maxime Ripard, Rob Herring,
	devicetree, Jernej Skrabec, linux-arm-kernel

On Fri, 19 Nov 2021, Evgeny Boger wrote:

> R40 SoC has touchscreen controller also serving as general-purpose ADC.
> The hardware is very similar to A31, except that R40 has separate
> calibrated thermal sensor IP (handled by sun8i_thermal).
> 
> Despite the temperature sensor in the RTP is never mentioned in
> the R40 family user manuals, it appears to be working. However,
> it's not very useful as it lacks calibration data and there is another
> fully functioning temperature sensor anyway.
> 
> This patch disables the temperature sensor in RTP/GPADC IP on R40.
> 
> The reason for disabling the temperature sensor is that the IP
> needs to be switched back and forth between RTP and GPADC modes for
> temperature measurements. Not only this introduces delays, but it also
> disturbs external circuitry by injecting current into ADC inputs.
> 
> Signed-off-by: Evgeny Boger <boger@wirenboard.com>
> ---
>  drivers/iio/adc/sun4i-gpadc-iio.c | 32 +++++++++++++++++++++++--------
>  drivers/mfd/sun4i-gpadc.c         | 17 ++++++++++++++++

Please split these out.

They don't *need* to go in via a single tree.

>  2 files changed, 41 insertions(+), 8 deletions(-)

-- 
Lee Jones [李琼斯]
Principal Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-01-17  9:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-19 19:14 [PATCH 0/3] Enable RTP (GPADC) controller on Allwinner R40 Evgeny Boger
2021-11-19 19:14 ` [PATCH 1/3] iio: adc: sun4i-gpadc-iio: no temp sensor on R40 Evgeny Boger
2021-11-22  9:11   ` Maxime Ripard
2021-11-22 12:41     ` Jonathan Cameron
2022-01-11 13:13       ` Evgeny Boger
2022-01-15 15:41         ` Jonathan Cameron
2022-01-17  9:00   ` Lee Jones
2021-11-19 19:14 ` [PATCH 2/3] dt-bindings: iio: adc: new compatible for Allwinner R40 RTP controller Evgeny Boger
2021-11-22  9:10   ` Maxime Ripard
2021-11-30  1:46   ` Rob Herring
2021-11-19 19:14 ` [PATCH 3/3] ARM: dts: sun8i: r40: add rtp node Evgeny Boger

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).