Lines Matching refs:gpreg
243 static void S24C16_set_bit(struct sym_device *np, u_char write_bit, u_char *gpreg, in S24C16_set_bit() argument
249 *gpreg |= write_bit; in S24C16_set_bit()
252 *gpreg &= 0xfe; in S24C16_set_bit()
255 *gpreg |= 0x02; in S24C16_set_bit()
258 *gpreg &= 0xfd; in S24C16_set_bit()
262 OUTB(np, nc_gpreg, *gpreg); in S24C16_set_bit()
270 static void S24C16_start(struct sym_device *np, u_char *gpreg) in S24C16_start() argument
272 S24C16_set_bit(np, 1, gpreg, SET_BIT); in S24C16_start()
273 S24C16_set_bit(np, 0, gpreg, SET_CLK); in S24C16_start()
274 S24C16_set_bit(np, 0, gpreg, CLR_BIT); in S24C16_start()
275 S24C16_set_bit(np, 0, gpreg, CLR_CLK); in S24C16_start()
281 static void S24C16_stop(struct sym_device *np, u_char *gpreg) in S24C16_stop() argument
283 S24C16_set_bit(np, 0, gpreg, SET_CLK); in S24C16_stop()
284 S24C16_set_bit(np, 1, gpreg, SET_BIT); in S24C16_stop()
292 u_char *gpreg) in S24C16_do_bit() argument
294 S24C16_set_bit(np, write_bit, gpreg, SET_BIT); in S24C16_do_bit()
295 S24C16_set_bit(np, 0, gpreg, SET_CLK); in S24C16_do_bit()
298 S24C16_set_bit(np, 0, gpreg, CLR_CLK); in S24C16_do_bit()
299 S24C16_set_bit(np, 0, gpreg, CLR_BIT); in S24C16_do_bit()
306 static void S24C16_write_ack(struct sym_device *np, u_char write_bit, u_char *gpreg, in S24C16_write_ack() argument
310 S24C16_do_bit(np, NULL, write_bit, gpreg); in S24C16_write_ack()
318 static void S24C16_read_ack(struct sym_device *np, u_char *read_bit, u_char *gpreg, in S24C16_read_ack() argument
322 S24C16_do_bit(np, read_bit, 1, gpreg); in S24C16_read_ack()
331 u_char *gpreg, u_char *gpcntl) in S24C16_write_byte() argument
336 S24C16_do_bit(np, NULL, (write_data >> (7 - x)) & 0x01, gpreg); in S24C16_write_byte()
338 S24C16_read_ack(np, ack_data, gpreg, gpcntl); in S24C16_write_byte()
346 u_char *gpreg, u_char *gpcntl) in S24C16_read_byte() argument
353 S24C16_do_bit(np, &read_bit, 1, gpreg); in S24C16_read_byte()
357 S24C16_write_ack(np, ack_data, gpreg, gpcntl); in S24C16_read_byte()
367 u_char gpcntl, gpreg; in sym_write_S24C16_nvram() local
382 gpreg = old_gpreg; in sym_write_S24C16_nvram()
383 S24C16_set_bit(np, 0, &gpreg, CLR_CLK); in sym_write_S24C16_nvram()
384 S24C16_set_bit(np, 0, &gpreg, CLR_BIT); in sym_write_S24C16_nvram()
387 S24C16_stop(np, &gpreg); in sym_write_S24C16_nvram()
392 S24C16_start(np, &gpreg); in sym_write_S24C16_nvram()
395 &gpreg, &gpcntl); in sym_write_S24C16_nvram()
399 &gpreg, &gpcntl); in sym_write_S24C16_nvram()
403 &gpreg, &gpcntl); in sym_write_S24C16_nvram()
404 S24C16_stop(np, &gpreg); in sym_write_S24C16_nvram()
420 u_char gpcntl, gpreg; in sym_read_S24C16_nvram() local
436 gpreg = old_gpreg; in sym_read_S24C16_nvram()
437 S24C16_set_bit(np, 0, &gpreg, CLR_CLK); in sym_read_S24C16_nvram()
438 S24C16_set_bit(np, 0, &gpreg, CLR_BIT); in sym_read_S24C16_nvram()
441 S24C16_stop(np, &gpreg); in sym_read_S24C16_nvram()
444 S24C16_start(np, &gpreg); in sym_read_S24C16_nvram()
448 0xa0 | ((offset >> 7) & 0x0e), &gpreg, &gpcntl); in sym_read_S24C16_nvram()
454 offset & 0xff, &gpreg, &gpcntl); in sym_read_S24C16_nvram()
459 S24C16_start(np, &gpreg); in sym_read_S24C16_nvram()
463 0xa1 | ((offset >> 7) & 0x0e), &gpreg, &gpcntl); in sym_read_S24C16_nvram()
473 S24C16_read_byte(np, &data[x], (x == (len-1)), &gpreg, &gpcntl); in sym_read_S24C16_nvram()
478 S24C16_stop(np, &gpreg); in sym_read_S24C16_nvram()
538 static void T93C46_Clk(struct sym_device *np, u_char *gpreg) in T93C46_Clk() argument
540 OUTB(np, nc_gpreg, *gpreg | 0x04); in T93C46_Clk()
543 OUTB(np, nc_gpreg, *gpreg); in T93C46_Clk()
549 static void T93C46_Read_Bit(struct sym_device *np, u_char *read_bit, u_char *gpreg) in T93C46_Read_Bit() argument
552 T93C46_Clk(np, gpreg); in T93C46_Read_Bit()
559 static void T93C46_Write_Bit(struct sym_device *np, u_char write_bit, u_char *gpreg) in T93C46_Write_Bit() argument
562 *gpreg |= 0x02; in T93C46_Write_Bit()
564 *gpreg &= 0xfd; in T93C46_Write_Bit()
566 *gpreg |= 0x10; in T93C46_Write_Bit()
568 OUTB(np, nc_gpreg, *gpreg); in T93C46_Write_Bit()
572 T93C46_Clk(np, gpreg); in T93C46_Write_Bit()
578 static void T93C46_Stop(struct sym_device *np, u_char *gpreg) in T93C46_Stop() argument
580 *gpreg &= 0xef; in T93C46_Stop()
581 OUTB(np, nc_gpreg, *gpreg); in T93C46_Stop()
585 T93C46_Clk(np, gpreg); in T93C46_Stop()
592 u_char *read_bit, u_char *gpreg) in T93C46_Send_Command() argument
598 T93C46_Write_Bit(np, (u_char) (write_data >> (8 - x)), gpreg); in T93C46_Send_Command()
607 unsigned short *nvram_data, unsigned char *gpreg) in T93C46_Read_Word() argument
614 T93C46_Read_Bit(np, &read_bit, gpreg); in T93C46_Read_Word()
627 int len, unsigned char *gpreg) in T93C46_Read_Data() argument
634 T93C46_Send_Command(np, 0x180 | x, &read_bit, gpreg); in T93C46_Read_Data()
637 T93C46_Read_Word(np, &data[x], gpreg); in T93C46_Read_Data()
638 T93C46_Stop(np, gpreg); in T93C46_Read_Data()
649 u_char gpcntl, gpreg; in sym_read_T93C46_nvram() local
659 gpreg = old_gpreg & 0xe9; in sym_read_T93C46_nvram()
660 OUTB(np, nc_gpreg, gpreg); in sym_read_T93C46_nvram()
666 sizeof(*nvram) / sizeof(short), &gpreg); in sym_read_T93C46_nvram()