summaryrefslogtreecommitdiff
path: root/io-module/mts-io.c
diff options
context:
space:
mode:
authorVolodymyr Vorobiov <volodymyr.vorobiov@globallogic.com>2019-12-13 15:40:14 +0200
committerVolodymyr Vorobiov <volodymyr.vorobiov@globallogic.com>2019-12-13 15:40:14 +0200
commit57651686d90c05a186604a27a532834fa7979c15 (patch)
treea2c7d74ce707e715a5a4c818f586c072d7ad8f48 /io-module/mts-io.c
parente4577b095d086eeccc37516de42b331fd771a2fe (diff)
downloadmts-io-57651686d90c05a186604a27a532834fa7979c15.tar.gz
mts-io-57651686d90c05a186604a27a532834fa7979c15.tar.bz2
mts-io-57651686d90c05a186604a27a532834fa7979c15.zip
Add ADC to mts-io
Diffstat (limited to 'io-module/mts-io.c')
-rw-r--r--io-module/mts-io.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/io-module/mts-io.c b/io-module/mts-io.c
index 489f0d5..8c35f74 100644
--- a/io-module/mts-io.c
+++ b/io-module/mts-io.c
@@ -23,7 +23,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/ioctl.h>
#include <linux/input.h>
@@ -74,6 +74,11 @@ static const struct of_device_id mts_io_dt_ids[] = {
};
MODULE_DEVICE_TABLE(of, mts_io_dt_ids);
+/* on-board EEPROM */
+static struct mts_id_eeprom_layout id_eeprom;
+
+#include "adc.c"
+
/*
* We must call platform_set_drvdata, or else the
* devres_head for the driver has junk in it, and
@@ -86,7 +91,11 @@ MODULE_DEVICE_TABLE(of, mts_io_dt_ids);
*/
static int mts_io_probe(struct platform_device *pdev)
{
- return 0;
+ int ret = 0;
+ if (!DEVICE_CAPA(id_eeprom.capa, CAPA_ADC)) {
+ ret = mts_io_board_adc_probe(pdev);
+ }
+ return ret;
}
static int mts_io_remove(struct platform_device *pdev)
@@ -107,8 +116,6 @@ static struct platform_driver mts_io_driver = {
};
-/* on-board EEPROM */
-static struct mts_id_eeprom_layout id_eeprom;
static uint8_t mts_hw_version;
struct platform_device *mts_io_platform_device;
EXPORT_SYMBOL(mts_io_platform_device);