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

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

 



Hi Lee,

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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux