aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/oxygen/oxygen_io.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-10-14 20:31:54 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-10-14 20:31:54 -0400
commit6dc6472581f693b5fc95aebedf67b4960fb85cf0 (patch)
tree06a5a9a08519950575505273eabced331ed51405 /sound/pci/oxygen/oxygen_io.c
parentee673eaa72d8d185012b1027a05e25aba18c267f (diff)
parent8acd3a60bcca17c6d89c73cee3ad6057eb83ba1e (diff)
Merge commit 'origin'
Manual fixup of conflicts on: arch/powerpc/include/asm/dcr-regs.h drivers/net/ibm_newemac/core.h
Diffstat (limited to 'sound/pci/oxygen/oxygen_io.c')
-rw-r--r--sound/pci/oxygen/oxygen_io.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/sound/pci/oxygen/oxygen_io.c b/sound/pci/oxygen/oxygen_io.c
index 83f135f80df4..3126c4b403dd 100644
--- a/sound/pci/oxygen/oxygen_io.c
+++ b/sound/pci/oxygen/oxygen_io.c
@@ -20,6 +20,7 @@
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/sched.h> 21#include <linux/sched.h>
22#include <sound/core.h> 22#include <sound/core.h>
23#include <sound/mpu401.h>
23#include <asm/io.h> 24#include <asm/io.h>
24#include "oxygen.h" 25#include "oxygen.h"
25 26
@@ -232,3 +233,24 @@ void oxygen_write_i2c(struct oxygen *chip, u8 device, u8 map, u8 data)
232 device | OXYGEN_2WIRE_DIR_WRITE); 233 device | OXYGEN_2WIRE_DIR_WRITE);
233} 234}
234EXPORT_SYMBOL(oxygen_write_i2c); 235EXPORT_SYMBOL(oxygen_write_i2c);
236
237static void _write_uart(struct oxygen *chip, unsigned int port, u8 data)
238{
239 if (oxygen_read8(chip, OXYGEN_MPU401 + 1) & MPU401_TX_FULL)
240 msleep(1);
241 oxygen_write8(chip, OXYGEN_MPU401 + port, data);
242}
243
244void oxygen_reset_uart(struct oxygen *chip)
245{
246 _write_uart(chip, 1, MPU401_RESET);
247 msleep(1); /* wait for ACK */
248 _write_uart(chip, 1, MPU401_ENTER_UART);
249}
250EXPORT_SYMBOL(oxygen_reset_uart);
251
252void oxygen_write_uart(struct oxygen *chip, u8 data)
253{
254 _write_uart(chip, 0, data);
255}
256EXPORT_SYMBOL(oxygen_write_uart);