Lines Matching refs:usb31misc
131 struct regmap *usb31misc; member
141 static int hi3670_phy_cr_clk(struct regmap *usb31misc) in hi3670_phy_cr_clk() argument
146 ret = regmap_update_bits(usb31misc, USB_MISC_CFG54, in hi3670_phy_cr_clk()
152 return regmap_update_bits(usb31misc, USB_MISC_CFG54, in hi3670_phy_cr_clk()
156 static int hi3670_phy_cr_set_sel(struct regmap *usb31misc) in hi3670_phy_cr_set_sel() argument
158 return regmap_update_bits(usb31misc, USB_MISC_CFG54, in hi3670_phy_cr_set_sel()
162 static int hi3670_phy_cr_start(struct regmap *usb31misc, int direction) in hi3670_phy_cr_start() argument
171 ret = regmap_update_bits(usb31misc, USB_MISC_CFG54, reg, reg); in hi3670_phy_cr_start()
176 ret = hi3670_phy_cr_clk(usb31misc); in hi3670_phy_cr_start()
180 return regmap_update_bits(usb31misc, USB_MISC_CFG54, in hi3670_phy_cr_start()
184 static int hi3670_phy_cr_wait_ack(struct regmap *usb31misc) in hi3670_phy_cr_wait_ack() argument
191 ret = regmap_read(usb31misc, USB_MISC_CFG54, ®); in hi3670_phy_cr_wait_ack()
197 ret = hi3670_phy_cr_clk(usb31misc); in hi3670_phy_cr_wait_ack()
207 static int hi3670_phy_cr_set_addr(struct regmap *usb31misc, u32 addr) in hi3670_phy_cr_set_addr() argument
212 ret = regmap_read(usb31misc, USB_MISC_CFG54, ®); in hi3670_phy_cr_set_addr()
218 return regmap_update_bits(usb31misc, USB_MISC_CFG54, in hi3670_phy_cr_set_addr()
222 static int hi3670_phy_cr_read(struct regmap *usb31misc, u32 addr, u32 *val) in hi3670_phy_cr_read() argument
227 ret = hi3670_phy_cr_clk(usb31misc); in hi3670_phy_cr_read()
232 ret = hi3670_phy_cr_set_sel(usb31misc); in hi3670_phy_cr_read()
236 ret = hi3670_phy_cr_set_addr(usb31misc, addr); in hi3670_phy_cr_read()
240 ret = hi3670_phy_cr_start(usb31misc, 0); in hi3670_phy_cr_read()
244 ret = hi3670_phy_cr_wait_ack(usb31misc); in hi3670_phy_cr_read()
248 ret = regmap_read(usb31misc, USB_MISC_CFG58, ®); in hi3670_phy_cr_read()
257 static int hi3670_phy_cr_write(struct regmap *usb31misc, u32 addr, u32 val) in hi3670_phy_cr_write() argument
263 ret = hi3670_phy_cr_clk(usb31misc); in hi3670_phy_cr_write()
268 ret = hi3670_phy_cr_set_sel(usb31misc); in hi3670_phy_cr_write()
272 ret = hi3670_phy_cr_set_addr(usb31misc, addr); in hi3670_phy_cr_write()
276 ret = regmap_write(usb31misc, USB_MISC_CFG58, in hi3670_phy_cr_write()
281 ret = hi3670_phy_cr_start(usb31misc, 1); in hi3670_phy_cr_write()
285 return hi3670_phy_cr_wait_ack(usb31misc); in hi3670_phy_cr_write()
294 ret = regmap_write(priv->usb31misc, USB3OTG_CTRL4, in hi3670_phy_set_params()
302 ret = hi3670_phy_cr_read(priv->usb31misc, in hi3670_phy_set_params()
316 ret = hi3670_phy_cr_write(priv->usb31misc, TX_VBOOST_LVL_REG, reg); in hi3670_phy_set_params()
367 ret = regmap_update_bits(priv->usb31misc, USB_MISC_CFGA0, in hi3670_config_phy_clock()
372 ret = regmap_read(priv->usb31misc, USB3OTG_CTRL7, &val); in hi3670_config_phy_clock()
377 ret = regmap_write(priv->usb31misc, USB3OTG_CTRL7, val); in hi3670_config_phy_clock()
384 ret = regmap_update_bits(priv->usb31misc, USB_MISC_CFG54, in hi3670_config_phy_clock()
390 ret = regmap_update_bits(priv->usb31misc, USB_MISC_CFGA0, in hi3670_config_phy_clock()
396 ret = regmap_read(priv->usb31misc, USB3OTG_CTRL7, &val); in hi3670_config_phy_clock()
401 ret = regmap_write(priv->usb31misc, USB3OTG_CTRL7, val); in hi3670_config_phy_clock()
421 ret = regmap_write(priv->usb31misc, TCA_INTR_STS, 0xffff); in hi3670_config_tca()
425 ret = regmap_write(priv->usb31misc, TCA_INTR_EN, in hi3670_config_tca()
431 ret = regmap_update_bits(priv->usb31misc, TCA_CLK_RST, mask, 0); in hi3670_config_tca()
435 ret = regmap_update_bits(priv->usb31misc, TCA_GCFG, in hi3670_config_tca()
441 ret = regmap_update_bits(priv->usb31misc, TCA_SYSMODE_CFG, in hi3670_config_tca()
446 ret = regmap_read(priv->usb31misc, TCA_TCPC, &val); in hi3670_config_tca()
451 ret = regmap_write(priv->usb31misc, TCA_TCPC, val); in hi3670_config_tca()
455 ret = regmap_write(priv->usb31misc, TCA_VBUS_CTRL, in hi3670_config_tca()
475 ret = regmap_update_bits(priv->usb31misc, USB_MISC_CFGA0, val, 0); in hi3670_phy_init()
484 ret = regmap_update_bits(priv->usb31misc, USB3OTG_CTRL5, in hi3670_phy_init()
490 ret = regmap_update_bits(priv->usb31misc, USB_MISC_CFG50, in hi3670_phy_init()
497 ret = regmap_update_bits(priv->usb31misc, USB_MISC_CFGA0, val, val); in hi3670_phy_init()
506 ret = regmap_update_bits(priv->usb31misc, USB_MISC_CFG54, in hi3670_phy_init()
516 ret = regmap_update_bits(priv->usb31misc, USB_MISC_CFG5C, in hi3670_phy_init()
524 ret = regmap_update_bits(priv->usb31misc, USB_MISC_CFGA0, val, val); in hi3670_phy_init()
532 ret = regmap_update_bits(priv->usb31misc, USB3OTG_CTRL0, val, val); in hi3670_phy_init()
537 ret = regmap_update_bits(priv->usb31misc, USB3OTG_CTRL3, val, val); in hi3670_phy_init()
561 ret = regmap_update_bits(priv->usb31misc, USB_MISC_CFGA0, mask, 0); in hi3670_phy_exit()
622 priv->usb31misc = syscon_node_to_regmap(dev->parent->of_node); in hi3670_phy_probe()
623 if (IS_ERR(priv->usb31misc)) { in hi3670_phy_probe()
625 return PTR_ERR(priv->usb31misc); in hi3670_phy_probe()