Lines Matching refs:ci

3  * ci.h - common structures, functions, and macros of the ChipIdea driver
83 * @ci: pointer to the controller
101 struct ci_hdrc *ci;
264 static inline struct ci_role_driver *ci_role(struct ci_hdrc *ci)
266 BUG_ON(ci->role >= CI_ROLE_END || !ci->roles[ci->role]);
267 return ci->roles[ci->role];
270 static inline int ci_role_start(struct ci_hdrc *ci, enum ci_role role)
277 if (!ci->roles[role])
280 ret = ci->roles[role]->start(ci);
282 ci->role = role;
286 static inline void ci_role_stop(struct ci_hdrc *ci)
288 enum ci_role role = ci->role;
293 ci->role = CI_ROLE_END;
295 ci->roles[role]->stop(ci);
298 static inline enum usb_role ci_role_to_usb_role(struct ci_hdrc *ci)
300 if (ci->role == CI_ROLE_HOST)
302 else if (ci->role == CI_ROLE_GADGET && ci->vbus_active)
320 * @ci: the controller
326 static inline u32 hw_read_id_reg(struct ci_hdrc *ci, u32 offset, u32 mask)
328 return ioread32(ci->hw_bank.abs + offset) & mask;
333 * @ci: the controller
338 static inline void hw_write_id_reg(struct ci_hdrc *ci, u32 offset,
342 data = (ioread32(ci->hw_bank.abs + offset) & ~mask)
345 iowrite32(data, ci->hw_bank.abs + offset);
350 * @ci: the controller
356 static inline u32 hw_read(struct ci_hdrc *ci, enum ci_hw_regs reg, u32 mask)
358 return ioread32(ci->hw_bank.regmap[reg]) & mask;
372 static inline void __hw_write(struct ci_hdrc *ci, u32 val,
375 if (ci->imx28_write_fix)
383 * @ci: the controller
388 static inline void hw_write(struct ci_hdrc *ci, enum ci_hw_regs reg,
392 data = (ioread32(ci->hw_bank.regmap[reg]) & ~mask)
395 __hw_write(ci, data, ci->hw_bank.regmap[reg]);
400 * @ci: the controller
406 static inline u32 hw_test_and_clear(struct ci_hdrc *ci, enum ci_hw_regs reg,
409 u32 val = ioread32(ci->hw_bank.regmap[reg]) & mask;
411 __hw_write(ci, val, ci->hw_bank.regmap[reg]);
417 * @ci: the controller
424 static inline u32 hw_test_and_write(struct ci_hdrc *ci, enum ci_hw_regs reg,
427 u32 val = hw_read(ci, reg, ~0);
429 hw_write(ci, reg, mask, data);
437 * @ci: chipidea device
439 static inline bool ci_otg_is_fsm_mode(struct ci_hdrc *ci)
442 struct usb_otg_caps *otg_caps = &ci->platdata->ci_otg_caps;
444 return ci->is_otg && ci->roles[CI_ROLE_HOST] &&
445 ci->roles[CI_ROLE_GADGET] && (otg_caps->srp_support ||
452 int ci_ulpi_init(struct ci_hdrc *ci);
453 void ci_ulpi_exit(struct ci_hdrc *ci);
454 int ci_ulpi_resume(struct ci_hdrc *ci);
456 u32 hw_read_intr_enable(struct ci_hdrc *ci);
458 u32 hw_read_intr_status(struct ci_hdrc *ci);
460 int hw_device_reset(struct ci_hdrc *ci);
462 int hw_port_test_set(struct ci_hdrc *ci, u8 mode);
464 u8 hw_port_test_get(struct ci_hdrc *ci);
466 void hw_phymode_configure(struct ci_hdrc *ci);
468 void ci_platform_configure(struct ci_hdrc *ci);
470 void dbg_create_files(struct ci_hdrc *ci);
472 void dbg_remove_files(struct ci_hdrc *ci);