hwmon: epm_adc: Add average buffering command
The average buffering is used by clients who want
to set a period for which they want the PSoC to
measure and collect samples for the enabled channels.
The data obtained from the PSoC is a 12bit data for
each channel measurement. The EPM driver parses the
data for each of this channel and stores the result
for clients who issued the average buffered request.
Change-Id: I78dd7024c3146aa9578dc65e497021e42efbbd45
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
diff --git a/include/linux/epm_adc.h b/include/linux/epm_adc.h
index 076302b..b7b7d90 100644
--- a/include/linux/epm_adc.h
+++ b/include/linux/epm_adc.h
@@ -64,12 +64,19 @@
uint32_t channel_mask;
};
+struct result_buffer {
+ uint32_t channel;
+ uint32_t avg_buffer_sample;
+ uint32_t result;
+};
+
struct epm_psoc_get_avg_buffered_switch_data {
- u8 cmd;
- u8 status;
- uint32_t timestamp_start;
- uint32_t channel_mask;
- u8 avg_data[54];
+ u8 cmd;
+ u8 status;
+ uint32_t timestamp_start;
+ uint32_t channel_mask;
+ u8 avg_data[54];
+ struct result_buffer data[54];
};
struct epm_psoc_set_channel_switch {