On 28 June 2016 15:18:56 BST, Peter Meerwald-Stadler <pmeerw@xxxxxxxxxx> wrote: > >> >> +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 > Surprised me as well. That function should probably be taking it as const. Can't immediately see a reason not to! >regards, p. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html