Lines Matching refs:hsotg

60 #define dwc2_sch_dbg(hsotg, fmt, ...)					\  argument
62 dev_name(hsotg->dev), ##__VA_ARGS__)
65 #define dwc2_sch_vdbg(hsotg, fmt, ...) \ argument
67 dev_name(hsotg->dev), ##__VA_ARGS__)
1227 static inline u32 dwc2_readl(struct dwc2_hsotg *hsotg, u32 offset) in dwc2_readl() argument
1231 val = readl(hsotg->regs + offset); in dwc2_readl()
1232 if (hsotg->needs_byte_swap) in dwc2_readl()
1238 static inline void dwc2_writel(struct dwc2_hsotg *hsotg, u32 value, u32 offset) in dwc2_writel() argument
1240 if (hsotg->needs_byte_swap) in dwc2_writel()
1241 writel(swab32(value), hsotg->regs + offset); in dwc2_writel()
1243 writel(value, hsotg->regs + offset); in dwc2_writel()
1246 pr_info("info:: wrote %08x to %p\n", value, hsotg->regs + offset); in dwc2_writel()
1250 static inline void dwc2_readl_rep(struct dwc2_hsotg *hsotg, u32 offset, in dwc2_readl_rep() argument
1257 u32 x = dwc2_readl(hsotg, offset); in dwc2_readl_rep()
1263 static inline void dwc2_writel_rep(struct dwc2_hsotg *hsotg, u32 offset, in dwc2_writel_rep() argument
1270 dwc2_writel(hsotg, *buf++, offset); in dwc2_writel_rep()
1294 static inline bool dwc2_is_iot(struct dwc2_hsotg *hsotg) in dwc2_is_iot() argument
1296 return (hsotg->hw_params.snpsid & 0xfff00000) == 0x55300000; in dwc2_is_iot()
1299 static inline bool dwc2_is_fs_iot(struct dwc2_hsotg *hsotg) in dwc2_is_fs_iot() argument
1301 return (hsotg->hw_params.snpsid & 0xffff0000) == 0x55310000; in dwc2_is_fs_iot()
1304 static inline bool dwc2_is_hs_iot(struct dwc2_hsotg *hsotg) in dwc2_is_hs_iot() argument
1306 return (hsotg->hw_params.snpsid & 0xffff0000) == 0x55320000; in dwc2_is_hs_iot()
1313 int dwc2_core_reset(struct dwc2_hsotg *hsotg, bool skip_wait);
1314 int dwc2_enter_partial_power_down(struct dwc2_hsotg *hsotg);
1315 int dwc2_exit_partial_power_down(struct dwc2_hsotg *hsotg, int rem_wakeup,
1317 int dwc2_enter_hibernation(struct dwc2_hsotg *hsotg, int is_host);
1318 int dwc2_exit_hibernation(struct dwc2_hsotg *hsotg, int rem_wakeup,
1320 void dwc2_init_fs_ls_pclk_sel(struct dwc2_hsotg *hsotg);
1321 int dwc2_phy_init(struct dwc2_hsotg *hsotg, bool select_phy);
1323 void dwc2_force_mode(struct dwc2_hsotg *hsotg, bool host);
1324 void dwc2_force_dr_mode(struct dwc2_hsotg *hsotg);
1326 bool dwc2_is_controller_alive(struct dwc2_hsotg *hsotg);
1328 int dwc2_check_core_version(struct dwc2_hsotg *hsotg);
1335 void dwc2_read_packet(struct dwc2_hsotg *hsotg, u8 *dest, u16 bytes);
1336 void dwc2_flush_tx_fifo(struct dwc2_hsotg *hsotg, const int num);
1337 void dwc2_flush_rx_fifo(struct dwc2_hsotg *hsotg);
1342 void dwc2_hib_restore_common(struct dwc2_hsotg *hsotg, int rem_wakeup,
1344 int dwc2_backup_global_registers(struct dwc2_hsotg *hsotg);
1345 int dwc2_restore_global_registers(struct dwc2_hsotg *hsotg);
1347 void dwc2_enable_acg(struct dwc2_hsotg *hsotg);
1356 int dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg);
1357 int dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg);
1365 int dwc2_get_hwparams(struct dwc2_hsotg *hsotg);
1366 int dwc2_init_params(struct dwc2_hsotg *hsotg);
1376 unsigned int dwc2_op_mode(struct dwc2_hsotg *hsotg);
1377 bool dwc2_hw_is_otg(struct dwc2_hsotg *hsotg);
1378 bool dwc2_hw_is_host(struct dwc2_hsotg *hsotg);
1379 bool dwc2_hw_is_device(struct dwc2_hsotg *hsotg);
1384 static inline int dwc2_is_host_mode(struct dwc2_hsotg *hsotg) in dwc2_is_host_mode() argument
1386 return (dwc2_readl(hsotg, GINTSTS) & GINTSTS_CURMODE_HOST) != 0; in dwc2_is_host_mode()
1389 static inline int dwc2_is_device_mode(struct dwc2_hsotg *hsotg) in dwc2_is_device_mode() argument
1391 return (dwc2_readl(hsotg, GINTSTS) & GINTSTS_CURMODE_HOST) == 0; in dwc2_is_device_mode()
1394 int dwc2_drd_init(struct dwc2_hsotg *hsotg);
1395 void dwc2_drd_suspend(struct dwc2_hsotg *hsotg);
1396 void dwc2_drd_resume(struct dwc2_hsotg *hsotg);
1397 void dwc2_drd_exit(struct dwc2_hsotg *hsotg);
1402 void dwc2_dump_dev_registers(struct dwc2_hsotg *hsotg);
1403 void dwc2_dump_host_registers(struct dwc2_hsotg *hsotg);
1404 void dwc2_dump_global_registers(struct dwc2_hsotg *hsotg);
1409 int dwc2_hsotg_remove(struct dwc2_hsotg *hsotg);
1412 int dwc2_gadget_init(struct dwc2_hsotg *hsotg);
1415 void dwc2_hsotg_core_disconnect(struct dwc2_hsotg *hsotg);
1416 void dwc2_hsotg_core_connect(struct dwc2_hsotg *hsotg);
1418 int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg, int testmode);
1419 #define dwc2_is_device_connected(hsotg) (hsotg->connected) argument
1420 int dwc2_backup_device_registers(struct dwc2_hsotg *hsotg);
1421 int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg, int remote_wakeup);
1422 int dwc2_gadget_enter_hibernation(struct dwc2_hsotg *hsotg);
1423 int dwc2_gadget_exit_hibernation(struct dwc2_hsotg *hsotg,
1425 int dwc2_gadget_enter_partial_power_down(struct dwc2_hsotg *hsotg);
1426 int dwc2_gadget_exit_partial_power_down(struct dwc2_hsotg *hsotg,
1428 void dwc2_gadget_enter_clock_gating(struct dwc2_hsotg *hsotg);
1429 void dwc2_gadget_exit_clock_gating(struct dwc2_hsotg *hsotg,
1431 int dwc2_hsotg_tx_fifo_count(struct dwc2_hsotg *hsotg);
1432 int dwc2_hsotg_tx_fifo_total_depth(struct dwc2_hsotg *hsotg);
1433 int dwc2_hsotg_tx_fifo_average_depth(struct dwc2_hsotg *hsotg);
1434 void dwc2_gadget_init_lpm(struct dwc2_hsotg *hsotg);
1435 void dwc2_gadget_program_ref_clk(struct dwc2_hsotg *hsotg);
1436 static inline void dwc2_clear_fifo_map(struct dwc2_hsotg *hsotg) in dwc2_clear_fifo_map() argument
1437 { hsotg->fifo_map = 0; } in dwc2_clear_fifo_map()
1445 static inline int dwc2_gadget_init(struct dwc2_hsotg *hsotg) in dwc2_gadget_init() argument
1449 static inline void dwc2_hsotg_core_disconnect(struct dwc2_hsotg *hsotg) {} in dwc2_hsotg_core_disconnect() argument
1450 static inline void dwc2_hsotg_core_connect(struct dwc2_hsotg *hsotg) {} in dwc2_hsotg_core_connect() argument
1452 static inline int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg, in dwc2_hsotg_set_test_mode() argument
1455 #define dwc2_is_device_connected(hsotg) (0) argument
1456 static inline int dwc2_backup_device_registers(struct dwc2_hsotg *hsotg) in dwc2_backup_device_registers() argument
1458 static inline int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg, in dwc2_restore_device_registers() argument
1461 static inline int dwc2_gadget_enter_hibernation(struct dwc2_hsotg *hsotg) in dwc2_gadget_enter_hibernation() argument
1463 static inline int dwc2_gadget_exit_hibernation(struct dwc2_hsotg *hsotg, in dwc2_gadget_exit_hibernation() argument
1466 static inline int dwc2_gadget_enter_partial_power_down(struct dwc2_hsotg *hsotg) in dwc2_gadget_enter_partial_power_down() argument
1468 static inline int dwc2_gadget_exit_partial_power_down(struct dwc2_hsotg *hsotg, in dwc2_gadget_exit_partial_power_down() argument
1471 static inline void dwc2_gadget_enter_clock_gating(struct dwc2_hsotg *hsotg) {} in dwc2_gadget_enter_clock_gating() argument
1472 static inline void dwc2_gadget_exit_clock_gating(struct dwc2_hsotg *hsotg, in dwc2_gadget_exit_clock_gating() argument
1474 static inline int dwc2_hsotg_tx_fifo_count(struct dwc2_hsotg *hsotg) in dwc2_hsotg_tx_fifo_count() argument
1476 static inline int dwc2_hsotg_tx_fifo_total_depth(struct dwc2_hsotg *hsotg) in dwc2_hsotg_tx_fifo_total_depth() argument
1478 static inline int dwc2_hsotg_tx_fifo_average_depth(struct dwc2_hsotg *hsotg) in dwc2_hsotg_tx_fifo_average_depth() argument
1480 static inline void dwc2_gadget_init_lpm(struct dwc2_hsotg *hsotg) {} in dwc2_gadget_init_lpm() argument
1481 static inline void dwc2_gadget_program_ref_clk(struct dwc2_hsotg *hsotg) {} in dwc2_gadget_program_ref_clk() argument
1482 static inline void dwc2_clear_fifo_map(struct dwc2_hsotg *hsotg) {} in dwc2_clear_fifo_map() argument
1486 int dwc2_hcd_get_frame_number(struct dwc2_hsotg *hsotg);
1487 int dwc2_hcd_get_future_frame_number(struct dwc2_hsotg *hsotg, int us);
1488 void dwc2_hcd_connect(struct dwc2_hsotg *hsotg);
1489 void dwc2_hcd_disconnect(struct dwc2_hsotg *hsotg, bool force);
1490 void dwc2_hcd_start(struct dwc2_hsotg *hsotg);
1491 int dwc2_core_init(struct dwc2_hsotg *hsotg, bool initial_setup);
1492 int dwc2_port_suspend(struct dwc2_hsotg *hsotg, u16 windex);
1493 int dwc2_port_resume(struct dwc2_hsotg *hsotg);
1494 int dwc2_backup_host_registers(struct dwc2_hsotg *hsotg);
1495 int dwc2_restore_host_registers(struct dwc2_hsotg *hsotg);
1496 int dwc2_host_enter_hibernation(struct dwc2_hsotg *hsotg);
1497 int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg,
1499 int dwc2_host_enter_partial_power_down(struct dwc2_hsotg *hsotg);
1500 int dwc2_host_exit_partial_power_down(struct dwc2_hsotg *hsotg,
1502 void dwc2_host_enter_clock_gating(struct dwc2_hsotg *hsotg);
1503 void dwc2_host_exit_clock_gating(struct dwc2_hsotg *hsotg, int rem_wakeup);
1505 static inline void dwc2_host_schedule_phy_reset(struct dwc2_hsotg *hsotg) in dwc2_host_schedule_phy_reset() argument
1506 { schedule_work(&hsotg->phy_reset_work); } in dwc2_host_schedule_phy_reset()
1508 static inline int dwc2_hcd_get_frame_number(struct dwc2_hsotg *hsotg) in dwc2_hcd_get_frame_number() argument
1510 static inline int dwc2_hcd_get_future_frame_number(struct dwc2_hsotg *hsotg, in dwc2_hcd_get_future_frame_number() argument
1513 static inline void dwc2_hcd_connect(struct dwc2_hsotg *hsotg) {} in dwc2_hcd_connect() argument
1514 static inline void dwc2_hcd_disconnect(struct dwc2_hsotg *hsotg, bool force) {} in dwc2_hcd_disconnect() argument
1515 static inline void dwc2_hcd_start(struct dwc2_hsotg *hsotg) {} in dwc2_hcd_start() argument
1516 static inline void dwc2_hcd_remove(struct dwc2_hsotg *hsotg) {} in dwc2_hcd_remove() argument
1517 static inline int dwc2_core_init(struct dwc2_hsotg *hsotg, bool initial_setup) in dwc2_core_init() argument
1519 static inline int dwc2_port_suspend(struct dwc2_hsotg *hsotg, u16 windex) in dwc2_port_suspend() argument
1521 static inline int dwc2_port_resume(struct dwc2_hsotg *hsotg) in dwc2_port_resume() argument
1523 static inline int dwc2_hcd_init(struct dwc2_hsotg *hsotg) in dwc2_hcd_init() argument
1525 static inline int dwc2_backup_host_registers(struct dwc2_hsotg *hsotg) in dwc2_backup_host_registers() argument
1527 static inline int dwc2_restore_host_registers(struct dwc2_hsotg *hsotg) in dwc2_restore_host_registers() argument
1529 static inline int dwc2_host_enter_hibernation(struct dwc2_hsotg *hsotg) in dwc2_host_enter_hibernation() argument
1531 static inline int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg, in dwc2_host_exit_hibernation() argument
1534 static inline int dwc2_host_enter_partial_power_down(struct dwc2_hsotg *hsotg) in dwc2_host_enter_partial_power_down() argument
1536 static inline int dwc2_host_exit_partial_power_down(struct dwc2_hsotg *hsotg, in dwc2_host_exit_partial_power_down() argument
1539 static inline void dwc2_host_enter_clock_gating(struct dwc2_hsotg *hsotg) {} in dwc2_host_enter_clock_gating() argument
1540 static inline void dwc2_host_exit_clock_gating(struct dwc2_hsotg *hsotg, in dwc2_host_exit_clock_gating() argument
1544 static inline void dwc2_host_schedule_phy_reset(struct dwc2_hsotg *hsotg) {} in dwc2_host_schedule_phy_reset() argument