Lines Matching refs:io_port
3762 static void trms1040_wait_30us(unsigned long io_port) in trms1040_wait_30us() argument
3765 outb(5, io_port + TRM_S1040_GEN_TIMER); in trms1040_wait_30us()
3766 while (!(inb(io_port + TRM_S1040_GEN_STATUS) & GTIMEOUT)) in trms1040_wait_30us()
3779 static void trms1040_write_cmd(unsigned long io_port, u8 cmd, u8 addr) in trms1040_write_cmd() argument
3790 outb(send_data, io_port + TRM_S1040_GEN_NVRAM); in trms1040_write_cmd()
3791 trms1040_wait_30us(io_port); in trms1040_write_cmd()
3793 io_port + TRM_S1040_GEN_NVRAM); in trms1040_write_cmd()
3794 trms1040_wait_30us(io_port); in trms1040_write_cmd()
3803 outb(send_data, io_port + TRM_S1040_GEN_NVRAM); in trms1040_write_cmd()
3804 trms1040_wait_30us(io_port); in trms1040_write_cmd()
3806 io_port + TRM_S1040_GEN_NVRAM); in trms1040_write_cmd()
3807 trms1040_wait_30us(io_port); in trms1040_write_cmd()
3809 outb(NVR_SELECT, io_port + TRM_S1040_GEN_NVRAM); in trms1040_write_cmd()
3810 trms1040_wait_30us(io_port); in trms1040_write_cmd()
3824 static void trms1040_set_data(unsigned long io_port, u8 addr, u8 byte) in trms1040_set_data() argument
3830 trms1040_write_cmd(io_port, 0x05, addr); in trms1040_set_data()
3838 outb(send_data, io_port + TRM_S1040_GEN_NVRAM); in trms1040_set_data()
3839 trms1040_wait_30us(io_port); in trms1040_set_data()
3840 outb((send_data | NVR_CLOCK), io_port + TRM_S1040_GEN_NVRAM); in trms1040_set_data()
3841 trms1040_wait_30us(io_port); in trms1040_set_data()
3843 outb(NVR_SELECT, io_port + TRM_S1040_GEN_NVRAM); in trms1040_set_data()
3844 trms1040_wait_30us(io_port); in trms1040_set_data()
3847 outb(0, io_port + TRM_S1040_GEN_NVRAM); in trms1040_set_data()
3848 trms1040_wait_30us(io_port); in trms1040_set_data()
3850 outb(NVR_SELECT, io_port + TRM_S1040_GEN_NVRAM); in trms1040_set_data()
3851 trms1040_wait_30us(io_port); in trms1040_set_data()
3855 outb((NVR_SELECT | NVR_CLOCK), io_port + TRM_S1040_GEN_NVRAM); in trms1040_set_data()
3856 trms1040_wait_30us(io_port); in trms1040_set_data()
3858 outb(NVR_SELECT, io_port + TRM_S1040_GEN_NVRAM); in trms1040_set_data()
3859 trms1040_wait_30us(io_port); in trms1040_set_data()
3861 if (inb(io_port + TRM_S1040_GEN_NVRAM) & NVR_BITIN) in trms1040_set_data()
3866 outb(0, io_port + TRM_S1040_GEN_NVRAM); in trms1040_set_data()
3878 static void trms1040_write_all(struct NvRamType *eeprom, unsigned long io_port) in trms1040_write_all() argument
3884 outb((inb(io_port + TRM_S1040_GEN_CONTROL) | EN_EEPROM), in trms1040_write_all()
3885 io_port + TRM_S1040_GEN_CONTROL); in trms1040_write_all()
3888 trms1040_write_cmd(io_port, 0x04, 0xFF); in trms1040_write_all()
3889 outb(0, io_port + TRM_S1040_GEN_NVRAM); in trms1040_write_all()
3890 trms1040_wait_30us(io_port); in trms1040_write_all()
3894 trms1040_set_data(io_port, addr, *b_eeprom); in trms1040_write_all()
3897 trms1040_write_cmd(io_port, 0x04, 0x00); in trms1040_write_all()
3898 outb(0, io_port + TRM_S1040_GEN_NVRAM); in trms1040_write_all()
3899 trms1040_wait_30us(io_port); in trms1040_write_all()
3902 outb((inb(io_port + TRM_S1040_GEN_CONTROL) & ~EN_EEPROM), in trms1040_write_all()
3903 io_port + TRM_S1040_GEN_CONTROL); in trms1040_write_all()
3918 static u8 trms1040_get_data(unsigned long io_port, u8 addr) in trms1040_get_data() argument
3925 trms1040_write_cmd(io_port, 0x06, addr); in trms1040_get_data()
3929 outb((NVR_SELECT | NVR_CLOCK), io_port + TRM_S1040_GEN_NVRAM); in trms1040_get_data()
3930 trms1040_wait_30us(io_port); in trms1040_get_data()
3931 outb(NVR_SELECT, io_port + TRM_S1040_GEN_NVRAM); in trms1040_get_data()
3934 read_byte = inb(io_port + TRM_S1040_GEN_NVRAM); in trms1040_get_data()
3939 trms1040_wait_30us(io_port); in trms1040_get_data()
3943 outb(0, io_port + TRM_S1040_GEN_NVRAM); in trms1040_get_data()
3956 static void trms1040_read_all(struct NvRamType *eeprom, unsigned long io_port) in trms1040_read_all() argument
3962 outb((inb(io_port + TRM_S1040_GEN_CONTROL) | EN_EEPROM), in trms1040_read_all()
3963 io_port + TRM_S1040_GEN_CONTROL); in trms1040_read_all()
3967 *b_eeprom = trms1040_get_data(io_port, addr); in trms1040_read_all()
3970 outb((inb(io_port + TRM_S1040_GEN_CONTROL) & ~EN_EEPROM), in trms1040_read_all()
3971 io_port + TRM_S1040_GEN_CONTROL); in trms1040_read_all()
3986 static void check_eeprom(struct NvRamType *eeprom, unsigned long io_port) in check_eeprom() argument
3994 trms1040_read_all(eeprom, io_port); /* read eeprom */ in check_eeprom()
4040 trms1040_write_all(eeprom, io_port); in check_eeprom()
4245 host->io_port = acb->io_port_base; in adapter_init_scsi_host()
4326 static int adapter_init(struct AdapterCtlBlk *acb, unsigned long io_port, in adapter_init() argument
4329 if (!request_region(io_port, io_port_len, DC395X_NAME)) { in adapter_init()
4330 dprintkl(KERN_ERR, "Failed to reserve IO region 0x%lx\n", io_port); in adapter_init()
4334 acb->io_port_base = io_port; in adapter_init()
4346 check_eeprom(&acb->eeprom, io_port); in adapter_init()