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__)
1167 static inline u32 dwc2_readl(struct dwc2_hsotg *hsotg, u32 offset) in dwc2_readl() argument
1171 val = readl(hsotg->regs + offset); in dwc2_readl()
1172 if (hsotg->needs_byte_swap) in dwc2_readl()
1178 static inline void dwc2_writel(struct dwc2_hsotg *hsotg, u32 value, u32 offset) in dwc2_writel() argument
1180 if (hsotg->needs_byte_swap) in dwc2_writel()
1181 writel(swab32(value), hsotg->regs + offset); in dwc2_writel()
1183 writel(value, hsotg->regs + offset); in dwc2_writel()
1186 pr_info("info:: wrote %08x to %p\n", value, hsotg->regs + offset); in dwc2_writel()
1190 static inline void dwc2_readl_rep(struct dwc2_hsotg *hsotg, u32 offset, in dwc2_readl_rep() argument
1197 u32 x = dwc2_readl(hsotg, offset); in dwc2_readl_rep()
1203 static inline void dwc2_writel_rep(struct dwc2_hsotg *hsotg, u32 offset, in dwc2_writel_rep() argument
1210 dwc2_writel(hsotg, *buf++, offset); in dwc2_writel_rep()
1234 static inline bool dwc2_is_iot(struct dwc2_hsotg *hsotg) in dwc2_is_iot() argument
1236 return (hsotg->hw_params.snpsid & 0xfff00000) == 0x55300000; in dwc2_is_iot()
1239 static inline bool dwc2_is_fs_iot(struct dwc2_hsotg *hsotg) in dwc2_is_fs_iot() argument
1241 return (hsotg->hw_params.snpsid & 0xffff0000) == 0x55310000; in dwc2_is_fs_iot()
1244 static inline bool dwc2_is_hs_iot(struct dwc2_hsotg *hsotg) in dwc2_is_hs_iot() argument
1246 return (hsotg->hw_params.snpsid & 0xffff0000) == 0x55320000; in dwc2_is_hs_iot()
1253 int dwc2_core_reset(struct dwc2_hsotg *hsotg, bool skip_wait);
1254 int dwc2_enter_partial_power_down(struct dwc2_hsotg *hsotg);
1255 int dwc2_exit_partial_power_down(struct dwc2_hsotg *hsotg, bool restore);
1256 int dwc2_enter_hibernation(struct dwc2_hsotg *hsotg, int is_host);
1257 int dwc2_exit_hibernation(struct dwc2_hsotg *hsotg, int rem_wakeup,
1260 void dwc2_force_mode(struct dwc2_hsotg *hsotg, bool host);
1261 void dwc2_force_dr_mode(struct dwc2_hsotg *hsotg);
1263 bool dwc2_is_controller_alive(struct dwc2_hsotg *hsotg);
1270 void dwc2_read_packet(struct dwc2_hsotg *hsotg, u8 *dest, u16 bytes);
1271 void dwc2_flush_tx_fifo(struct dwc2_hsotg *hsotg, const int num);
1272 void dwc2_flush_rx_fifo(struct dwc2_hsotg *hsotg);
1277 void dwc2_hib_restore_common(struct dwc2_hsotg *hsotg, int rem_wakeup,
1279 int dwc2_backup_global_registers(struct dwc2_hsotg *hsotg);
1280 int dwc2_restore_global_registers(struct dwc2_hsotg *hsotg);
1282 void dwc2_enable_acg(struct dwc2_hsotg *hsotg);
1290 int dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg);
1291 int dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg);
1299 int dwc2_get_hwparams(struct dwc2_hsotg *hsotg);
1300 int dwc2_init_params(struct dwc2_hsotg *hsotg);
1310 unsigned int dwc2_op_mode(struct dwc2_hsotg *hsotg);
1311 bool dwc2_hw_is_otg(struct dwc2_hsotg *hsotg);
1312 bool dwc2_hw_is_host(struct dwc2_hsotg *hsotg);
1313 bool dwc2_hw_is_device(struct dwc2_hsotg *hsotg);
1318 static inline int dwc2_is_host_mode(struct dwc2_hsotg *hsotg) in dwc2_is_host_mode() argument
1320 return (dwc2_readl(hsotg, GINTSTS) & GINTSTS_CURMODE_HOST) != 0; in dwc2_is_host_mode()
1323 static inline int dwc2_is_device_mode(struct dwc2_hsotg *hsotg) in dwc2_is_device_mode() argument
1325 return (dwc2_readl(hsotg, GINTSTS) & GINTSTS_CURMODE_HOST) == 0; in dwc2_is_device_mode()
1331 void dwc2_dump_dev_registers(struct dwc2_hsotg *hsotg);
1332 void dwc2_dump_host_registers(struct dwc2_hsotg *hsotg);
1333 void dwc2_dump_global_registers(struct dwc2_hsotg *hsotg);
1338 int dwc2_hsotg_remove(struct dwc2_hsotg *hsotg);
1341 int dwc2_gadget_init(struct dwc2_hsotg *hsotg);
1344 void dwc2_hsotg_core_connect(struct dwc2_hsotg *hsotg);
1346 int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg, int testmode);
1347 #define dwc2_is_device_connected(hsotg) (hsotg->connected) argument
1348 int dwc2_backup_device_registers(struct dwc2_hsotg *hsotg);
1349 int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg, int remote_wakeup);
1350 int dwc2_gadget_enter_hibernation(struct dwc2_hsotg *hsotg);
1351 int dwc2_gadget_exit_hibernation(struct dwc2_hsotg *hsotg,
1353 int dwc2_hsotg_tx_fifo_count(struct dwc2_hsotg *hsotg);
1354 int dwc2_hsotg_tx_fifo_total_depth(struct dwc2_hsotg *hsotg);
1355 int dwc2_hsotg_tx_fifo_average_depth(struct dwc2_hsotg *hsotg);
1356 void dwc2_gadget_init_lpm(struct dwc2_hsotg *hsotg);
1364 static inline int dwc2_gadget_init(struct dwc2_hsotg *hsotg) in dwc2_gadget_init() argument
1368 static inline void dwc2_hsotg_core_connect(struct dwc2_hsotg *hsotg) {} in dwc2_hsotg_core_connect() argument
1370 static inline int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg, in dwc2_hsotg_set_test_mode() argument
1373 #define dwc2_is_device_connected(hsotg) (0) argument
1374 static inline int dwc2_backup_device_registers(struct dwc2_hsotg *hsotg) in dwc2_backup_device_registers() argument
1376 static inline int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg, in dwc2_restore_device_registers() argument
1379 static inline int dwc2_gadget_enter_hibernation(struct dwc2_hsotg *hsotg) in dwc2_gadget_enter_hibernation() argument
1381 static inline int dwc2_gadget_exit_hibernation(struct dwc2_hsotg *hsotg, in dwc2_gadget_exit_hibernation() argument
1384 static inline int dwc2_hsotg_tx_fifo_count(struct dwc2_hsotg *hsotg) in dwc2_hsotg_tx_fifo_count() argument
1386 static inline int dwc2_hsotg_tx_fifo_total_depth(struct dwc2_hsotg *hsotg) in dwc2_hsotg_tx_fifo_total_depth() argument
1388 static inline int dwc2_hsotg_tx_fifo_average_depth(struct dwc2_hsotg *hsotg) in dwc2_hsotg_tx_fifo_average_depth() argument
1390 static inline void dwc2_gadget_init_lpm(struct dwc2_hsotg *hsotg) {} in dwc2_gadget_init_lpm() argument
1394 int dwc2_hcd_get_frame_number(struct dwc2_hsotg *hsotg);
1395 int dwc2_hcd_get_future_frame_number(struct dwc2_hsotg *hsotg, int us);
1396 void dwc2_hcd_connect(struct dwc2_hsotg *hsotg);
1397 void dwc2_hcd_disconnect(struct dwc2_hsotg *hsotg, bool force);
1398 void dwc2_hcd_start(struct dwc2_hsotg *hsotg);
1399 int dwc2_core_init(struct dwc2_hsotg *hsotg, bool initial_setup);
1400 int dwc2_backup_host_registers(struct dwc2_hsotg *hsotg);
1401 int dwc2_restore_host_registers(struct dwc2_hsotg *hsotg);
1402 int dwc2_host_enter_hibernation(struct dwc2_hsotg *hsotg);
1403 int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg,
1406 static inline int dwc2_hcd_get_frame_number(struct dwc2_hsotg *hsotg) in dwc2_hcd_get_frame_number() argument
1408 static inline int dwc2_hcd_get_future_frame_number(struct dwc2_hsotg *hsotg, in dwc2_hcd_get_future_frame_number() argument
1411 static inline void dwc2_hcd_connect(struct dwc2_hsotg *hsotg) {} in dwc2_hcd_connect() argument
1412 static inline void dwc2_hcd_disconnect(struct dwc2_hsotg *hsotg, bool force) {} in dwc2_hcd_disconnect() argument
1413 static inline void dwc2_hcd_start(struct dwc2_hsotg *hsotg) {} in dwc2_hcd_start() argument
1414 static inline void dwc2_hcd_remove(struct dwc2_hsotg *hsotg) {} in dwc2_hcd_remove() argument
1415 static inline int dwc2_core_init(struct dwc2_hsotg *hsotg, bool initial_setup) in dwc2_core_init() argument
1417 static inline int dwc2_hcd_init(struct dwc2_hsotg *hsotg) in dwc2_hcd_init() argument
1419 static inline int dwc2_backup_host_registers(struct dwc2_hsotg *hsotg) in dwc2_backup_host_registers() argument
1421 static inline int dwc2_restore_host_registers(struct dwc2_hsotg *hsotg) in dwc2_restore_host_registers() argument
1423 static inline int dwc2_host_enter_hibernation(struct dwc2_hsotg *hsotg) in dwc2_host_enter_hibernation() argument
1425 static inline int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg, in dwc2_host_exit_hibernation() argument