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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 25/08/2021 18:25, Miquel Raynal wrote:
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 <jreeder@xxxxxx>
Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
Signed-off-by: Jason Reeder <jreeder@xxxxxx>
---
  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



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux