Thread (88 messages) 88 messages, 4 authors, 2021-09-05

Re: [PATCH 28/40] mfd: ti_am335x_tscadc: Add ADC1/magnetic reader support

From: Grygorii Strashko <grygorii.strashko@ti.com>
Date: 2021-09-01 19:26:58
Also in: linux-devicetree, linux-iio, linux-input, linux-omap


On 25/08/2021 18:25, Miquel Raynal wrote:
quoted hunk ↗ jump to hunk
Introduce a new compatible that has another set of driver data,
targeting am437x SoCs with a magnetic reader instead of the
touchscreen and a more featureful set of registers.

Co-developed-by: Jason Reeder <redacted>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Jason Reeder <redacted>
---
  drivers/mfd/ti_am335x_tscadc.c       | 43 ++++++++++++++++++++++------
  include/linux/mfd/ti_am335x_tscadc.h |  9 +++++-
  2 files changed, 43 insertions(+), 9 deletions(-)
diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
index 1a30610dc65f..f4f6b9db4d2a 100644
--- a/drivers/mfd/ti_am335x_tscadc.c
+++ b/drivers/mfd/ti_am335x_tscadc.c
@@ -122,9 +122,9 @@ static	int ti_tscadc_probe(struct platform_device *pdev)
  	const __be32 *cur;
  	struct clk *clk;
  	u32 val;
-	bool use_tsc = false;
+	bool use_tsc = false, use_mag = false;
  	int tscmag_wires = 0, adc_channels = 0, readouts = 0, cell_idx = 0;
-	int total_channels, err;
+	int mag_tracks = 0, total_channels, err;
  
  	/* Allocate memory for device */
  	tscadc = devm_kzalloc(&pdev->dev, sizeof(*tscadc), GFP_KERNEL);
@@ -146,6 +146,12 @@ static	int ti_tscadc_probe(struct platform_device *pdev)
  		of_property_read_u32(node, "ti,coordiante-readouts", &readouts);
  		if (tscmag_wires)
  			use_tsc = true;
+	} else {
+		node = of_get_child_by_name(pdev->dev.of_node, "mag");
+		of_property_read_u32(node, "ti,tracks", &mag_tracks);
"ti,tracks" seems undocumented?

[....]

-- 
Best regards,
grygorii
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help