Initial commit of ADS7924 driver
Change-Id: If74b8c4f6bbc0aec67e2dca6c0162c3d15e08ae8
diff --git a/qcom-adc/adc-averaging.h b/qcom-adc/adc-averaging.h
new file mode 100644
index 0000000..1744d1a
--- /dev/null
+++ b/qcom-adc/adc-averaging.h
@@ -0,0 +1,47 @@
+/*
+ * ./kernel_modules/qcom-adc/adc_averaging.h
+ *
+ * This is the header file for adc_averaging and defines the interface for
+ * users of the averaging logic
+ *
+ * Author: Cradlepoint Technology, Inc. <source@cradlepoint.com>
+ * Kyle Swenson <kswenson@cradlepoint.com>
+ *
+ * Copyright 2017 Cradlepoint Technology, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ */
+#ifndef __ADC_AVERAGING_H__
+#define __ADC_AVERAGING_H__
+
+#include <linux/kernel.h>
+#include <linux/mutex.h>
+
+#define MAX_SAMPLE_LENGTH 128
+struct adc_channel {
+ uint16_t *samples;
+ uint16_t total_length;
+ uint16_t index;
+ struct mutex lock;
+};
+
+
+
+void free_adc_channel(struct adc_channel *ch);
+struct adc_channel *create_adc_channel(uint16_t fifo_length);
+uint16_t compute_average(struct adc_channel *ch);
+void add_sample(struct adc_channel *ch, uint16_t sample);
+
+void show_data(struct adc_channel *ch);
+int verify_average(struct adc_channel *ch);
+
+
+#endif