aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/oxygen/oxygen_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/oxygen/oxygen_io.c')
-rw-r--r--sound/pci/oxygen/oxygen_io.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sound/pci/oxygen/oxygen_io.c b/sound/pci/oxygen/oxygen_io.c
index 3126c4b403dd..05f48ef1a442 100644
--- a/sound/pci/oxygen/oxygen_io.c
+++ b/sound/pci/oxygen/oxygen_io.c
@@ -254,3 +254,18 @@ void oxygen_write_uart(struct oxygen *chip, u8 data)
254 _write_uart(chip, 0, data); 254 _write_uart(chip, 0, data);
255} 255}
256EXPORT_SYMBOL(oxygen_write_uart); 256EXPORT_SYMBOL(oxygen_write_uart);
257
258u16 oxygen_read_eeprom(struct oxygen *chip, unsigned int index)
259{
260 unsigned int timeout;
261
262 oxygen_write8(chip, OXYGEN_EEPROM_CONTROL,
263 index | OXYGEN_EEPROM_DIR_READ);
264 for (timeout = 0; timeout < 100; ++timeout) {
265 udelay(1);
266 if (!(oxygen_read8(chip, OXYGEN_EEPROM_STATUS)
267 & OXYGEN_EEPROM_BUSY))
268 break;
269 }
270 return oxygen_read16(chip, OXYGEN_EEPROM_DATA);
271}