Lines Matching refs:hsotg
59 #define dwc2_sch_dbg(hsotg, fmt, ...) \ argument
61 dev_name(hsotg->dev), ##__VA_ARGS__)
64 #define dwc2_sch_vdbg(hsotg, fmt, ...) \ argument
66 dev_name(hsotg->dev), ##__VA_ARGS__)
1204 static inline u32 dwc2_readl(struct dwc2_hsotg *hsotg, u32 offset) in dwc2_readl() argument
1208 val = readl(hsotg->regs + offset); in dwc2_readl()
1209 if (hsotg->needs_byte_swap) in dwc2_readl()
1215 static inline void dwc2_writel(struct dwc2_hsotg *hsotg, u32 value, u32 offset) in dwc2_writel() argument
1217 if (hsotg->needs_byte_swap) in dwc2_writel()
1218 writel(swab32(value), hsotg->regs + offset); in dwc2_writel()
1220 writel(value, hsotg->regs + offset); in dwc2_writel()
1223 pr_info("info:: wrote %08x to %p\n", value, hsotg->regs + offset); in dwc2_writel()
1227 static inline void dwc2_readl_rep(struct dwc2_hsotg *hsotg, u32 offset, in dwc2_readl_rep() argument
1234 u32 x = dwc2_readl(hsotg, offset); in dwc2_readl_rep()
1240 static inline void dwc2_writel_rep(struct dwc2_hsotg *hsotg, u32 offset, in dwc2_writel_rep() argument
1247 dwc2_writel(hsotg, *buf++, offset); in dwc2_writel_rep()
1271 static inline bool dwc2_is_iot(struct dwc2_hsotg *hsotg) in dwc2_is_iot() argument
1273 return (hsotg->hw_params.snpsid & 0xfff00000) == 0x55300000; in dwc2_is_iot()
1276 static inline bool dwc2_is_fs_iot(struct dwc2_hsotg *hsotg) in dwc2_is_fs_iot() argument
1278 return (hsotg->hw_params.snpsid & 0xffff0000) == 0x55310000; in dwc2_is_fs_iot()
1281 static inline bool dwc2_is_hs_iot(struct dwc2_hsotg *hsotg) in dwc2_is_hs_iot() argument
1283 return (hsotg->hw_params.snpsid & 0xffff0000) == 0x55320000; in dwc2_is_hs_iot()
1290 int dwc2_core_reset(struct dwc2_hsotg *hsotg, bool skip_wait);
1291 int dwc2_enter_partial_power_down(struct dwc2_hsotg *hsotg);
1292 int dwc2_exit_partial_power_down(struct dwc2_hsotg *hsotg, bool restore);
1293 int dwc2_enter_hibernation(struct dwc2_hsotg *hsotg, int is_host);
1294 int dwc2_exit_hibernation(struct dwc2_hsotg *hsotg, int rem_wakeup,
1296 void dwc2_init_fs_ls_pclk_sel(struct dwc2_hsotg *hsotg);
1297 int dwc2_phy_init(struct dwc2_hsotg *hsotg, bool select_phy);
1299 void dwc2_force_mode(struct dwc2_hsotg *hsotg, bool host);
1300 void dwc2_force_dr_mode(struct dwc2_hsotg *hsotg);
1302 bool dwc2_is_controller_alive(struct dwc2_hsotg *hsotg);
1309 void dwc2_read_packet(struct dwc2_hsotg *hsotg, u8 *dest, u16 bytes);
1310 void dwc2_flush_tx_fifo(struct dwc2_hsotg *hsotg, const int num);
1311 void dwc2_flush_rx_fifo(struct dwc2_hsotg *hsotg);
1316 void dwc2_hib_restore_common(struct dwc2_hsotg *hsotg, int rem_wakeup,
1318 int dwc2_backup_global_registers(struct dwc2_hsotg *hsotg);
1319 int dwc2_restore_global_registers(struct dwc2_hsotg *hsotg);
1321 void dwc2_enable_acg(struct dwc2_hsotg *hsotg);
1329 int dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg);
1330 int dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg);
1338 int dwc2_get_hwparams(struct dwc2_hsotg *hsotg);
1339 int dwc2_init_params(struct dwc2_hsotg *hsotg);
1349 unsigned int dwc2_op_mode(struct dwc2_hsotg *hsotg);
1350 bool dwc2_hw_is_otg(struct dwc2_hsotg *hsotg);
1351 bool dwc2_hw_is_host(struct dwc2_hsotg *hsotg);
1352 bool dwc2_hw_is_device(struct dwc2_hsotg *hsotg);
1357 static inline int dwc2_is_host_mode(struct dwc2_hsotg *hsotg) in dwc2_is_host_mode() argument
1359 return (dwc2_readl(hsotg, GINTSTS) & GINTSTS_CURMODE_HOST) != 0; in dwc2_is_host_mode()
1362 static inline int dwc2_is_device_mode(struct dwc2_hsotg *hsotg) in dwc2_is_device_mode() argument
1364 return (dwc2_readl(hsotg, GINTSTS) & GINTSTS_CURMODE_HOST) == 0; in dwc2_is_device_mode()
1370 void dwc2_dump_dev_registers(struct dwc2_hsotg *hsotg);
1371 void dwc2_dump_host_registers(struct dwc2_hsotg *hsotg);
1372 void dwc2_dump_global_registers(struct dwc2_hsotg *hsotg);
1377 int dwc2_hsotg_remove(struct dwc2_hsotg *hsotg);
1380 int dwc2_gadget_init(struct dwc2_hsotg *hsotg);
1383 void dwc2_hsotg_core_connect(struct dwc2_hsotg *hsotg);
1385 int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg, int testmode);
1386 #define dwc2_is_device_connected(hsotg) (hsotg->connected) argument
1387 int dwc2_backup_device_registers(struct dwc2_hsotg *hsotg);
1388 int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg, int remote_wakeup);
1389 int dwc2_gadget_enter_hibernation(struct dwc2_hsotg *hsotg);
1390 int dwc2_gadget_exit_hibernation(struct dwc2_hsotg *hsotg,
1392 int dwc2_hsotg_tx_fifo_count(struct dwc2_hsotg *hsotg);
1393 int dwc2_hsotg_tx_fifo_total_depth(struct dwc2_hsotg *hsotg);
1394 int dwc2_hsotg_tx_fifo_average_depth(struct dwc2_hsotg *hsotg);
1395 void dwc2_gadget_init_lpm(struct dwc2_hsotg *hsotg);
1396 void dwc2_gadget_program_ref_clk(struct dwc2_hsotg *hsotg);
1404 static inline int dwc2_gadget_init(struct dwc2_hsotg *hsotg) in dwc2_gadget_init() argument
1408 static inline void dwc2_hsotg_core_connect(struct dwc2_hsotg *hsotg) {} in dwc2_hsotg_core_connect() argument
1410 static inline int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg, in dwc2_hsotg_set_test_mode() argument
1413 #define dwc2_is_device_connected(hsotg) (0) argument
1414 static inline int dwc2_backup_device_registers(struct dwc2_hsotg *hsotg) in dwc2_backup_device_registers() argument
1416 static inline int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg, in dwc2_restore_device_registers() argument
1419 static inline int dwc2_gadget_enter_hibernation(struct dwc2_hsotg *hsotg) in dwc2_gadget_enter_hibernation() argument
1421 static inline int dwc2_gadget_exit_hibernation(struct dwc2_hsotg *hsotg, in dwc2_gadget_exit_hibernation() argument
1424 static inline int dwc2_hsotg_tx_fifo_count(struct dwc2_hsotg *hsotg) in dwc2_hsotg_tx_fifo_count() argument
1426 static inline int dwc2_hsotg_tx_fifo_total_depth(struct dwc2_hsotg *hsotg) in dwc2_hsotg_tx_fifo_total_depth() argument
1428 static inline int dwc2_hsotg_tx_fifo_average_depth(struct dwc2_hsotg *hsotg) in dwc2_hsotg_tx_fifo_average_depth() argument
1430 static inline void dwc2_gadget_init_lpm(struct dwc2_hsotg *hsotg) {} in dwc2_gadget_init_lpm() argument
1431 static inline void dwc2_gadget_program_ref_clk(struct dwc2_hsotg *hsotg) {} in dwc2_gadget_program_ref_clk() argument
1435 int dwc2_hcd_get_frame_number(struct dwc2_hsotg *hsotg);
1436 int dwc2_hcd_get_future_frame_number(struct dwc2_hsotg *hsotg, int us);
1437 void dwc2_hcd_connect(struct dwc2_hsotg *hsotg);
1438 void dwc2_hcd_disconnect(struct dwc2_hsotg *hsotg, bool force);
1439 void dwc2_hcd_start(struct dwc2_hsotg *hsotg);
1440 int dwc2_core_init(struct dwc2_hsotg *hsotg, bool initial_setup);
1441 int dwc2_backup_host_registers(struct dwc2_hsotg *hsotg);
1442 int dwc2_restore_host_registers(struct dwc2_hsotg *hsotg);
1443 int dwc2_host_enter_hibernation(struct dwc2_hsotg *hsotg);
1444 int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg,
1447 static inline void dwc2_host_schedule_phy_reset(struct dwc2_hsotg *hsotg) in dwc2_host_schedule_phy_reset() argument
1448 { schedule_work(&hsotg->phy_reset_work); } in dwc2_host_schedule_phy_reset()
1450 static inline int dwc2_hcd_get_frame_number(struct dwc2_hsotg *hsotg) in dwc2_hcd_get_frame_number() argument
1452 static inline int dwc2_hcd_get_future_frame_number(struct dwc2_hsotg *hsotg, in dwc2_hcd_get_future_frame_number() argument
1455 static inline void dwc2_hcd_connect(struct dwc2_hsotg *hsotg) {} in dwc2_hcd_connect() argument
1456 static inline void dwc2_hcd_disconnect(struct dwc2_hsotg *hsotg, bool force) {} in dwc2_hcd_disconnect() argument
1457 static inline void dwc2_hcd_start(struct dwc2_hsotg *hsotg) {} in dwc2_hcd_start() argument
1458 static inline void dwc2_hcd_remove(struct dwc2_hsotg *hsotg) {} in dwc2_hcd_remove() argument
1459 static inline int dwc2_core_init(struct dwc2_hsotg *hsotg, bool initial_setup) in dwc2_core_init() argument
1461 static inline int dwc2_hcd_init(struct dwc2_hsotg *hsotg) in dwc2_hcd_init() argument
1463 static inline int dwc2_backup_host_registers(struct dwc2_hsotg *hsotg) in dwc2_backup_host_registers() argument
1465 static inline int dwc2_restore_host_registers(struct dwc2_hsotg *hsotg) in dwc2_restore_host_registers() argument
1467 static inline int dwc2_host_enter_hibernation(struct dwc2_hsotg *hsotg) in dwc2_host_enter_hibernation() argument
1469 static inline int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg, in dwc2_host_exit_hibernation() argument
1474 static inline void dwc2_host_schedule_phy_reset(struct dwc2_hsotg *hsotg) {} in dwc2_host_schedule_phy_reset() argument