Lines Matching refs:port

29 static u8 opal_lpc_inb(unsigned long port)  in opal_lpc_inb()  argument
34 if (opal_lpc_chip_id < 0 || port > 0xffff) in opal_lpc_inb()
36 rc = opal_lpc_read(opal_lpc_chip_id, OPAL_LPC_IO, port, &data, 1); in opal_lpc_inb()
40 static __le16 __opal_lpc_inw(unsigned long port) in __opal_lpc_inw() argument
45 if (opal_lpc_chip_id < 0 || port > 0xfffe) in __opal_lpc_inw()
47 if (port & 1) in __opal_lpc_inw()
48 return (__le16)opal_lpc_inb(port) << 8 | opal_lpc_inb(port + 1); in __opal_lpc_inw()
49 rc = opal_lpc_read(opal_lpc_chip_id, OPAL_LPC_IO, port, &data, 2); in __opal_lpc_inw()
52 static u16 opal_lpc_inw(unsigned long port) in opal_lpc_inw() argument
54 return le16_to_cpu(__opal_lpc_inw(port)); in opal_lpc_inw()
57 static __le32 __opal_lpc_inl(unsigned long port) in __opal_lpc_inl() argument
62 if (opal_lpc_chip_id < 0 || port > 0xfffc) in __opal_lpc_inl()
64 if (port & 3) in __opal_lpc_inl()
65 return (__le32)opal_lpc_inb(port ) << 24 | in __opal_lpc_inl()
66 (__le32)opal_lpc_inb(port + 1) << 16 | in __opal_lpc_inl()
67 (__le32)opal_lpc_inb(port + 2) << 8 | in __opal_lpc_inl()
68 opal_lpc_inb(port + 3); in __opal_lpc_inl()
69 rc = opal_lpc_read(opal_lpc_chip_id, OPAL_LPC_IO, port, &data, 4); in __opal_lpc_inl()
73 static u32 opal_lpc_inl(unsigned long port) in opal_lpc_inl() argument
75 return le32_to_cpu(__opal_lpc_inl(port)); in opal_lpc_inl()
78 static void opal_lpc_outb(u8 val, unsigned long port) in opal_lpc_outb() argument
80 if (opal_lpc_chip_id < 0 || port > 0xffff) in opal_lpc_outb()
82 opal_lpc_write(opal_lpc_chip_id, OPAL_LPC_IO, port, val, 1); in opal_lpc_outb()
85 static void __opal_lpc_outw(__le16 val, unsigned long port) in __opal_lpc_outw() argument
87 if (opal_lpc_chip_id < 0 || port > 0xfffe) in __opal_lpc_outw()
89 if (port & 1) { in __opal_lpc_outw()
90 opal_lpc_outb(val >> 8, port); in __opal_lpc_outw()
91 opal_lpc_outb(val , port + 1); in __opal_lpc_outw()
94 opal_lpc_write(opal_lpc_chip_id, OPAL_LPC_IO, port, val, 2); in __opal_lpc_outw()
97 static void opal_lpc_outw(u16 val, unsigned long port) in opal_lpc_outw() argument
99 __opal_lpc_outw(cpu_to_le16(val), port); in opal_lpc_outw()
102 static void __opal_lpc_outl(__le32 val, unsigned long port) in __opal_lpc_outl() argument
104 if (opal_lpc_chip_id < 0 || port > 0xfffc) in __opal_lpc_outl()
106 if (port & 3) { in __opal_lpc_outl()
107 opal_lpc_outb(val >> 24, port); in __opal_lpc_outl()
108 opal_lpc_outb(val >> 16, port + 1); in __opal_lpc_outl()
109 opal_lpc_outb(val >> 8, port + 2); in __opal_lpc_outl()
110 opal_lpc_outb(val , port + 3); in __opal_lpc_outl()
113 opal_lpc_write(opal_lpc_chip_id, OPAL_LPC_IO, port, val, 4); in __opal_lpc_outl()
116 static void opal_lpc_outl(u32 val, unsigned long port) in opal_lpc_outl() argument
118 __opal_lpc_outl(cpu_to_le32(val), port); in opal_lpc_outl()