Lines Matching refs:hw

381 	int (*init)(struct hermes *hw);
382 int (*cmd_wait)(struct hermes *hw, u16 cmd, u16 parm0,
384 int (*init_cmd_wait)(struct hermes *hw, u16 cmd,
387 int (*allocate)(struct hermes *hw, u16 size, u16 *fid);
388 int (*read_ltv)(struct hermes *hw, int bap, u16 rid, unsigned buflen,
390 int (*write_ltv)(struct hermes *hw, int bap, u16 rid,
392 int (*bap_pread)(struct hermes *hw, int bap, void *buf, int len,
394 int (*bap_pwrite)(struct hermes *hw, int bap, const void *buf,
396 int (*read_pda)(struct hermes *hw, __le16 *pda,
398 int (*program_init)(struct hermes *hw, u32 entry_point);
399 int (*program_end)(struct hermes *hw);
400 int (*program)(struct hermes *hw, const char *buf,
421 #define hermes_read_reg(hw, off) \ argument
422 (ioread16((hw)->iobase + ((off) << (hw)->reg_spacing)))
423 #define hermes_write_reg(hw, off, val) \ argument
424 (iowrite16((val), (hw)->iobase + ((off) << (hw)->reg_spacing)))
425 #define hermes_read_regn(hw, name) hermes_read_reg((hw), HERMES_##name) argument
426 #define hermes_write_regn(hw, name, val) \ argument
427 hermes_write_reg((hw), HERMES_##name, (val))
430 void hermes_struct_init(struct hermes *hw, void __iomem *address,
435 static inline int hermes_present(struct hermes *hw) in hermes_present() argument
437 return hermes_read_regn(hw, SWSUPPORT0) == HERMES_MAGIC; in hermes_present()
440 static inline void hermes_set_irqmask(struct hermes *hw, u16 events) in hermes_set_irqmask() argument
442 hw->inten = events; in hermes_set_irqmask()
443 hermes_write_regn(hw, INTEN, events); in hermes_set_irqmask()
446 static inline int hermes_enable_port(struct hermes *hw, int port) in hermes_enable_port() argument
448 return hw->ops->cmd_wait(hw, HERMES_CMD_ENABLE | (port << 8), in hermes_enable_port()
452 static inline int hermes_disable_port(struct hermes *hw, int port) in hermes_disable_port() argument
454 return hw->ops->cmd_wait(hw, HERMES_CMD_DISABLE | (port << 8), in hermes_disable_port()
460 static inline int hermes_inquire(struct hermes *hw, u16 rid) in hermes_inquire() argument
462 return hw->ops->cmd_wait(hw, HERMES_CMD_INQUIRE, rid, NULL); in hermes_inquire()
469 static inline void hermes_read_words(struct hermes *hw, int off, in hermes_read_words() argument
472 off = off << hw->reg_spacing; in hermes_read_words()
473 ioread16_rep(hw->iobase + off, buf, count); in hermes_read_words()
476 static inline void hermes_write_bytes(struct hermes *hw, int off, in hermes_write_bytes() argument
479 off = off << hw->reg_spacing; in hermes_write_bytes()
480 iowrite16_rep(hw->iobase + off, buf, count >> 1); in hermes_write_bytes()
482 iowrite8(buf[count - 1], hw->iobase + off); in hermes_write_bytes()
485 static inline void hermes_clear_words(struct hermes *hw, int off, in hermes_clear_words() argument
490 off = off << hw->reg_spacing; in hermes_clear_words()
493 iowrite16(0, hw->iobase + off); in hermes_clear_words()
496 #define HERMES_READ_RECORD(hw, bap, rid, buf) \ argument
497 (hw->ops->read_ltv((hw), (bap), (rid), sizeof(*buf), NULL, (buf)))
498 #define HERMES_WRITE_RECORD(hw, bap, rid, buf) \ argument
499 (hw->ops->write_ltv((hw), (bap), (rid), \
502 static inline int hermes_read_wordrec(struct hermes *hw, int bap, u16 rid, in hermes_read_wordrec() argument
508 err = HERMES_READ_RECORD(hw, bap, rid, &rec); in hermes_read_wordrec()
513 static inline int hermes_write_wordrec(struct hermes *hw, int bap, u16 rid, in hermes_write_wordrec() argument
517 return HERMES_WRITE_RECORD(hw, bap, rid, &rec); in hermes_write_wordrec()