Lines Matching refs:io_port

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