Lines Matching refs:io_base

133 	unsigned io_base;  member
188 static inline void sscape_write_unsafe(unsigned io_base, enum GA_REG reg, in sscape_write_unsafe() argument
191 outb(reg, ODIE_ADDR_IO(io_base)); in sscape_write_unsafe()
192 outb(val, ODIE_DATA_IO(io_base)); in sscape_write_unsafe()
205 sscape_write_unsafe(s->io_base, reg, val); in sscape_write()
213 static inline unsigned char sscape_read_unsafe(unsigned io_base, in sscape_read_unsafe() argument
216 outb(reg, ODIE_ADDR_IO(io_base)); in sscape_read_unsafe()
217 return inb(ODIE_DATA_IO(io_base)); in sscape_read_unsafe()
223 static inline void set_host_mode_unsafe(unsigned io_base) in set_host_mode_unsafe() argument
225 outb(0x0, HOST_CTRL_IO(io_base)); in set_host_mode_unsafe()
231 static inline void set_midi_mode_unsafe(unsigned io_base) in set_midi_mode_unsafe() argument
233 outb(0x3, HOST_CTRL_IO(io_base)); in set_midi_mode_unsafe()
240 static inline int host_read_unsafe(unsigned io_base) in host_read_unsafe() argument
243 if ((inb(HOST_CTRL_IO(io_base)) & RX_READY) != 0) in host_read_unsafe()
244 data = inb(HOST_DATA_IO(io_base)); in host_read_unsafe()
254 static int host_read_ctrl_unsafe(unsigned io_base, unsigned timeout) in host_read_ctrl_unsafe() argument
258 while (((data = host_read_unsafe(io_base)) < 0) && (timeout != 0)) { in host_read_ctrl_unsafe()
270 static inline int host_write_unsafe(unsigned io_base, unsigned char data) in host_write_unsafe() argument
272 if ((inb(HOST_CTRL_IO(io_base)) & TX_READY) != 0) { in host_write_unsafe()
273 outb(data, HOST_DATA_IO(io_base)); in host_write_unsafe()
285 static int host_write_ctrl_unsafe(unsigned io_base, unsigned char data, in host_write_ctrl_unsafe() argument
290 while (!(err = host_write_unsafe(io_base, data)) && (timeout != 0)) { in host_write_ctrl_unsafe()
323 static void activate_ad1845_unsafe(unsigned io_base) in activate_ad1845_unsafe() argument
325 unsigned char val = sscape_read_unsafe(io_base, GA_HMCTL_REG); in activate_ad1845_unsafe()
326 sscape_write_unsafe(io_base, GA_HMCTL_REG, (val & 0xcf) | 0x10); in activate_ad1845_unsafe()
327 sscape_write_unsafe(io_base, GA_CDCFG_REG, 0x80); in activate_ad1845_unsafe()
334 static void sscape_start_dma_unsafe(unsigned io_base, enum GA_REG reg) in sscape_start_dma_unsafe() argument
336 sscape_write_unsafe(io_base, reg, in sscape_start_dma_unsafe()
337 sscape_read_unsafe(io_base, reg) | 0x01); in sscape_start_dma_unsafe()
338 sscape_write_unsafe(io_base, reg, in sscape_start_dma_unsafe()
339 sscape_read_unsafe(io_base, reg) & 0xfe); in sscape_start_dma_unsafe()
346 static int sscape_wait_dma_unsafe(unsigned io_base, enum GA_REG reg, in sscape_wait_dma_unsafe() argument
349 while (!(sscape_read_unsafe(io_base, reg) & 0x01) && (timeout != 0)) { in sscape_wait_dma_unsafe()
354 return sscape_read_unsafe(io_base, reg) & 0x01; in sscape_wait_dma_unsafe()
373 x = host_read_unsafe(s->io_base); in obp_startup_ack()
400 x = host_read_unsafe(s->io_base); in host_startup_ack()
430 val = sscape_read_unsafe(s->io_base, GA_HMCTL_REG); in upload_dma_data()
431 sscape_write_unsafe(s->io_base, GA_HMCTL_REG, val & 0x3f); in upload_dma_data()
437 sscape_write_unsafe(s->io_base, GA_DMAA_REG, val); in upload_dma_data()
438 sscape_write_unsafe(s->io_base, GA_DMAB_REG, 0x20); in upload_dma_data()
443 val = sscape_read_unsafe(s->io_base, GA_HMCTL_REG); in upload_dma_data()
444 sscape_write_unsafe(s->io_base, GA_HMCTL_REG, val | 0x80); in upload_dma_data()
459 sscape_start_dma_unsafe(s->io_base, GA_DMAA_REG); in upload_dma_data()
460 if (!sscape_wait_dma_unsafe(s->io_base, GA_DMAA_REG, 5000)) { in upload_dma_data()
473 set_host_mode_unsafe(s->io_base); in upload_dma_data()
474 outb(0x0, s->io_base); in upload_dma_data()
479 val = sscape_read_unsafe(s->io_base, GA_HMCTL_REG); in upload_dma_data()
480 sscape_write_unsafe(s->io_base, GA_HMCTL_REG, val | 0x40); in upload_dma_data()
533 data = host_read_ctrl_unsafe(sscape->io_base, 100); in sscape_upload_bootblock()
536 sscape_write_unsafe(sscape->io_base, GA_SMCFGA_REG, 0x2f); in sscape_upload_bootblock()
622 set_host_mode_unsafe(s->io_base); in sscape_midi_put()
634 change = host_write_ctrl_unsafe(s->io_base, CMD_SET_MIDI_VOL, 100) in sscape_midi_put()
635 && host_write_ctrl_unsafe(s->io_base, new_val, 100) in sscape_midi_put()
636 && host_write_ctrl_unsafe(s->io_base, CMD_XXX_MIDI_VOL, 100) in sscape_midi_put()
637 && host_write_ctrl_unsafe(s->io_base, new_val, 100); in sscape_midi_put()
644 set_midi_mode_unsafe(s->io_base); in sscape_midi_put()
699 if ((inb(HOST_CTRL_IO(s->io_base)) & 0x78) != 0) in detect_sscape()
702 d = inb(ODIE_ADDR_IO(s->io_base)) & 0xf0; in detect_sscape()
713 outb(0xfa, ODIE_ADDR_IO(s->io_base)); in detect_sscape()
714 if ((inb(ODIE_ADDR_IO(s->io_base)) & 0x9f) != 0x0a) in detect_sscape()
717 outb(0xfe, ODIE_ADDR_IO(s->io_base)); in detect_sscape()
718 if ((inb(ODIE_ADDR_IO(s->io_base)) & 0x9f) != 0x0e) in detect_sscape()
721 outb(0xfe, ODIE_ADDR_IO(s->io_base)); in detect_sscape()
722 d = inb(ODIE_DATA_IO(s->io_base)); in detect_sscape()
727 activate_ad1845_unsafe(s->io_base); in detect_sscape()
732 d = sscape_read_unsafe(s->io_base, GA_HMCTL_REG); in detect_sscape()
733 sscape_write_unsafe(s->io_base, GA_HMCTL_REG, d | 0xc0); in detect_sscape()
750 d = sscape_read_unsafe(s->io_base, GA_HMCTL_REG) & 0x3f; in detect_sscape()
751 sscape_write_unsafe(s->io_base, GA_HMCTL_REG, d); in detect_sscape()
756 d = sscape_read_unsafe(s->io_base, GA_HMCTL_REG); in detect_sscape()
757 sscape_write_unsafe(s->io_base, GA_HMCTL_REG, d | 0xc0); in detect_sscape()
962 sscape->io_base = port[dev]; in create_sscape()
966 sscape->io_base); in create_sscape()
989 name, sscape->io_base, irq[dev], dma[dev]); in create_sscape()
1012 sscape_write_unsafe(sscape->io_base, GA_SMCFGA_REG, 0x2e); in create_sscape()
1013 sscape_write_unsafe(sscape->io_base, GA_SMCFGB_REG, 0x00); in create_sscape()
1018 sscape_write_unsafe(sscape->io_base, GA_DMACFG_REG, 0x50); in create_sscape()
1020 sscape_write_unsafe(sscape->io_base, GA_DMAA_REG, dma_cfg); in create_sscape()
1021 sscape_write_unsafe(sscape->io_base, GA_DMAB_REG, 0x20); in create_sscape()
1024 val = sscape_read_unsafe(sscape->io_base, GA_HMCTL_REG) & 0xF7; in create_sscape()
1027 sscape_write_unsafe(sscape->io_base, GA_HMCTL_REG, val | 0x10); in create_sscape()
1028 sscape_write_unsafe(sscape->io_base, GA_INTCFG_REG, 0xf0 | mpu_irq_cfg); in create_sscape()
1029 sscape_write_unsafe(sscape->io_base, in create_sscape()
1035 sscape_write_unsafe(sscape->io_base, GA_INTENA_REG, 0x80); in create_sscape()
1079 host_write_ctrl_unsafe(sscape->io_base, in create_sscape()
1081 host_write_ctrl_unsafe(sscape->io_base, in create_sscape()
1083 host_write_ctrl_unsafe(sscape->io_base, in create_sscape()
1085 host_write_ctrl_unsafe(sscape->io_base, in create_sscape()
1087 host_write_ctrl_unsafe(sscape->io_base, in create_sscape()
1089 host_write_ctrl_unsafe(sscape->io_base, in create_sscape()
1091 host_write_ctrl_unsafe(sscape->io_base, CMD_ACK, 100); in create_sscape()
1093 set_midi_mode_unsafe(sscape->io_base); in create_sscape()