Lines Matching defs:io_port
3806 * @io_port: base I/O address
3808 static void trms1040_wait_30us(unsigned long io_port)
3811 outb(5, io_port + TRM_S1040_GEN_TIMER);
3812 while (!(inb(io_port + TRM_S1040_GEN_STATUS) & GTIMEOUT))
3821 * @io_port: base I/O address
3825 static void trms1040_write_cmd(unsigned long io_port, u8 cmd, u8 addr)
3836 outb(send_data, io_port + TRM_S1040_GEN_NVRAM);
3837 trms1040_wait_30us(io_port);
3839 io_port + TRM_S1040_GEN_NVRAM);
3840 trms1040_wait_30us(io_port);
3849 outb(send_data, io_port + TRM_S1040_GEN_NVRAM);
3850 trms1040_wait_30us(io_port);
3852 io_port + TRM_S1040_GEN_NVRAM);
3853 trms1040_wait_30us(io_port);
3855 outb(NVR_SELECT, io_port + TRM_S1040_GEN_NVRAM);
3856 trms1040_wait_30us(io_port);
3866 * @io_port: base I/O address
3870 static void trms1040_set_data(unsigned long io_port, u8 addr, u8 byte)
3876 trms1040_write_cmd(io_port, 0x05, addr);
3884 outb(send_data, io_port + TRM_S1040_GEN_NVRAM);
3885 trms1040_wait_30us(io_port);
3886 outb((send_data | NVR_CLOCK), io_port + TRM_S1040_GEN_NVRAM);
3887 trms1040_wait_30us(io_port);
3889 outb(NVR_SELECT, io_port + TRM_S1040_GEN_NVRAM);
3890 trms1040_wait_30us(io_port);
3893 outb(0, io_port + TRM_S1040_GEN_NVRAM);
3894 trms1040_wait_30us(io_port);
3896 outb(NVR_SELECT, io_port + TRM_S1040_GEN_NVRAM);
3897 trms1040_wait_30us(io_port);
3901 outb((NVR_SELECT | NVR_CLOCK), io_port + TRM_S1040_GEN_NVRAM);
3902 trms1040_wait_30us(io_port);
3904 outb(NVR_SELECT, io_port + TRM_S1040_GEN_NVRAM);
3905 trms1040_wait_30us(io_port);
3907 if (inb(io_port + TRM_S1040_GEN_NVRAM) & NVR_BITIN)
3912 outb(0, io_port + TRM_S1040_GEN_NVRAM);
3922 * @io_port: the base io port
3924 static void trms1040_write_all(struct NvRamType *eeprom, unsigned long io_port)
3930 outb((inb(io_port + TRM_S1040_GEN_CONTROL) | EN_EEPROM),
3931 io_port + TRM_S1040_GEN_CONTROL);
3934 trms1040_write_cmd(io_port, 0x04, 0xFF);
3935 outb(0, io_port + TRM_S1040_GEN_NVRAM);
3936 trms1040_wait_30us(io_port);
3940 trms1040_set_data(io_port, addr, *b_eeprom);
3943 trms1040_write_cmd(io_port, 0x04, 0x00);
3944 outb(0, io_port + TRM_S1040_GEN_NVRAM);
3945 trms1040_wait_30us(io_port);
3948 outb((inb(io_port + TRM_S1040_GEN_CONTROL) & ~EN_EEPROM),
3949 io_port + TRM_S1040_GEN_CONTROL);
3959 * @io_port: base I/O address
3964 static u8 trms1040_get_data(unsigned long io_port, u8 addr)
3971 trms1040_write_cmd(io_port, 0x06, addr);
3975 outb((NVR_SELECT | NVR_CLOCK), io_port + TRM_S1040_GEN_NVRAM);
3976 trms1040_wait_30us(io_port);
3977 outb(NVR_SELECT, io_port + TRM_S1040_GEN_NVRAM);
3980 read_byte = inb(io_port + TRM_S1040_GEN_NVRAM);
3985 trms1040_wait_30us(io_port);
3989 outb(0, io_port + TRM_S1040_GEN_NVRAM);
4000 * @io_port: the base io port
4002 static void trms1040_read_all(struct NvRamType *eeprom, unsigned long io_port)
4008 outb((inb(io_port + TRM_S1040_GEN_CONTROL) | EN_EEPROM),
4009 io_port + TRM_S1040_GEN_CONTROL);
4013 *b_eeprom = trms1040_get_data(io_port, addr);
4016 outb((inb(io_port + TRM_S1040_GEN_CONTROL) & ~EN_EEPROM),
4017 io_port + TRM_S1040_GEN_CONTROL);
4030 * @io_port: io port to read from
4032 static void check_eeprom(struct NvRamType *eeprom, unsigned long io_port)
4040 trms1040_read_all(eeprom, io_port); /* read eeprom */
4086 trms1040_write_all(eeprom, io_port);
4211 * early (when this instance is created) and the io_port and irq
4291 host->io_port = acb->io_port_base;
4365 * @io_port: The base I/O port
4371 static int adapter_init(struct AdapterCtlBlk *acb, unsigned long io_port,
4374 if (!request_region(io_port, io_port_len, DC395X_NAME)) {
4375 dprintkl(KERN_ERR, "Failed to reserve IO region 0x%lx\n", io_port);
4379 acb->io_port_base = io_port;
4391 check_eeprom(&acb->eeprom, io_port);