]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
Input: ucb1400 - move static function from header into core
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Wed, 27 May 2009 13:22:58 +0000 (06:22 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 27 May 2009 13:25:05 +0000 (06:25 -0700)
it's a little too large for static line.
The ts is currently the only mainline user but Marek Vasut claims that
there is a battery driver in an ARM tree which also needs this function.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/mfd/ucb1400_core.c
include/linux/ucb1400.h

index 178159e264ce8f69e523ee4d0d35e2150c4cd455..78c2135c5de65f8717bb92bed2498429bc4df871 100644 (file)
 #include <linux/module.h>
 #include <linux/ucb1400.h>
 
+unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel,
+               int adcsync)
+{
+       unsigned int val;
+
+       if (adcsync)
+               adc_channel |= UCB_ADC_SYNC_ENA;
+
+       ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA | adc_channel);
+       ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA | adc_channel |
+                       UCB_ADC_START);
+
+       while (!((val = ucb1400_reg_read(ac97, UCB_ADC_DATA))
+                               & UCB_ADC_DAT_VALID))
+               schedule_timeout_uninterruptible(1);
+
+       return val & UCB_ADC_DAT_MASK;
+}
+EXPORT_SYMBOL_GPL(ucb1400_adc_read);
+
 static int ucb1400_core_probe(struct device *dev)
 {
        int err;
index 970473bf8d5a0a89339594a2ef8bf5f6eee9d3fd..ed889f4168f301a877c4e7384e207cb6fae2bb4d 100644 (file)
@@ -134,28 +134,13 @@ static inline void ucb1400_adc_enable(struct snd_ac97 *ac97)
        ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA);
 }
 
-static unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel,
-                                       int adcsync)
-{
-       unsigned int val;
-
-       if (adcsync)
-               adc_channel |= UCB_ADC_SYNC_ENA;
-
-       ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA | adc_channel);
-       ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA | adc_channel |
-                               UCB_ADC_START);
-
-       while (!((val = ucb1400_reg_read(ac97, UCB_ADC_DATA))
-                       & UCB_ADC_DAT_VALID))
-               schedule_timeout_uninterruptible(1);
-
-       return val & UCB_ADC_DAT_MASK;
-}
-
 static inline void ucb1400_adc_disable(struct snd_ac97 *ac97)
 {
        ucb1400_reg_write(ac97, UCB_ADC_CR, 0);
 }
 
+
+unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel,
+                             int adcsync);
+
 #endif