Re: [PATCH 2/3] iio: adc: add support for Allwinner SoCs ADC

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

 



> >> +struct sunxi_gpadc_dev {
> >> +	void __iomem			*regs;
> >> +	struct completion		completion;
> >> +	int				temp_data;
> > 
> > s32 maybe? what is the datatype and unit of temp_data? IIO wants 
> > milliCelsius
> > 
> 
> temp_data has no real datatype as it is the raw value given by the ADC
> before conversion (with an offset and scale different for each SoC). The
> temperature after conversion is given in milliCelsius as expected.

great!
 
> >> +	u32				adc_data;
> >> +	struct regmap			*regmap;
> >> +	unsigned int			fifo_data_irq;
> >> +	unsigned int			temp_data_irq;
> >> +	unsigned int			flags;
> >> +};
> >> +
> >> +#define ADC_CHANNEL(_channel, _name) {				\
> > 
> > prefix needed
> > 
> >> +	.type = IIO_VOLTAGE,					\
> >> +	.indexed = 1,						\
> >> +	.channel = _channel,					\
> >> +	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),		\
> >> +	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),	\
> >> +	.datasheet_name = _name,				\
> >> +}
> >> +
> >> +static struct iio_map sunxi_gpadc_hwmon_maps[] = {
> > 
> > const possible?
> > 
> 
> The compiler complains with the following error:
> warning: passing argument 2 of ‘iio_map_array_register’ discards ‘const’
> qualifier from pointer target type [-Wdiscarded-qualifiers]
> ret = iio_map_array_register(indio_dev, sunxi_gpadc_hwmon_maps);
> 
> Is there a point to leave const even if it is discarded by the only
> function using it?

my bad, leave as is
 
regards, p.

-- 

Peter Meerwald-Stadler
+43-664-2444418 (mobile)

[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