Thread (73 messages) 73 messages, 5 authors, 2021-09-28

Re: [PATCH v3 35/47] mfd: ti_am335x_tscadc: Add ADC1/magnetic reader support

From: Miquel Raynal <miquel.raynal@bootlin.com>
Date: 2021-09-28 10:34:22
Also in: linux-iio, linux-omap

Hi Lee,
quoted
 static const struct ti_tscadc_data tscdata = {
 	.has_tsc = true,
+	.has_mag = false,
 	.name_tscmag = "TI-am335x-tsc",
 	.compat_tscmag = "ti,am3359-tsc",
 	.name_adc = "TI-am335x-adc",
@@ -341,11 +356,25 @@ static const struct ti_tscadc_data tscdata = {
 	.target_clk_rate = TSC_ADC_CLK,
 };
 
+static const struct ti_tscadc_data magdata = {
+	.has_tsc = false,
+	.has_mag = true,  
Why 2 bools?

Better to have a single u8:

  MODE_TOUCHSCREEN
  MODE_MAG_STRING
  MODE_NONE
I was about to add an enum for these but actually it is totally
redundant with the compatible name. Instead, I have added a
helper which checks the compatible string and gives the same
information.

Thanks,
Miquèl
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help