summaryrefslogtreecommitdiff
path: root/drivers/hwmon/da9052-adc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/da9052-adc.c')
-rwxr-xr-xdrivers/hwmon/da9052-adc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/hwmon/da9052-adc.c b/drivers/hwmon/da9052-adc.c
index 6803fc2ccea3..3260eb5f4359 100755
--- a/drivers/hwmon/da9052-adc.c
+++ b/drivers/hwmon/da9052-adc.c
@@ -2,6 +2,7 @@
* da9052-adc.c -- ADC Driver for Dialog DA9052
*
* Copyright(c) 2009 Dialog Semiconductor Ltd.
+ * Copyright (C) 2012 Freescale Semiconductor, Inc.
*
* Author: Dialog Semiconductor Ltd <dchen@diasemi.com>
*
@@ -39,6 +40,15 @@ static const char *input_names[] = {
[DA9052_ADC_VBBAT] = "BACK-UP BATTERY TEMP",
};
+static struct da9052 *da9052_local;
+
+int da9052_adc_read(unsigned char channel)
+{
+ if (da9052_local != NULL)
+ return da9052_manual_read(da9052_local, channel);
+ return -1;
+}
+EXPORT_SYMBOL(da9052_adc_read);
int da9052_manual_read(struct da9052 *da9052,
unsigned char channel)
@@ -591,6 +601,7 @@ static int __init da9052_adc_probe(struct platform_device *pdev)
/* Initialize mutex required for ADC Manual read */
mutex_init(&priv->da9052->manconv_lock);
+ da9052_local = priv->da9052;
return 0;
out_err_create2: