Lines Matching refs:dwc3_data
115 static int st_dwc3_drd_init(struct st_dwc3 *dwc3_data) in st_dwc3_drd_init() argument
120 err = regmap_read(dwc3_data->regmap, dwc3_data->syscfg_reg_off, &val); in st_dwc3_drd_init()
126 switch (dwc3_data->dr_mode) { in st_dwc3_drd_init()
161 dev_err(dwc3_data->dev, "Unsupported mode of operation %d\n", in st_dwc3_drd_init()
162 dwc3_data->dr_mode); in st_dwc3_drd_init()
166 return regmap_write(dwc3_data->regmap, dwc3_data->syscfg_reg_off, val); in st_dwc3_drd_init()
173 static void st_dwc3_init(struct st_dwc3 *dwc3_data) in st_dwc3_init() argument
175 u32 reg = st_dwc3_readl(dwc3_data->glue_base, CLKRST_CTRL); in st_dwc3_init()
179 st_dwc3_writel(dwc3_data->glue_base, CLKRST_CTRL, reg); in st_dwc3_init()
182 reg = st_dwc3_readl(dwc3_data->glue_base, USB2_VBUS_MNGMNT_SEL1); in st_dwc3_init()
188 st_dwc3_writel(dwc3_data->glue_base, USB2_VBUS_MNGMNT_SEL1, reg); in st_dwc3_init()
190 reg = st_dwc3_readl(dwc3_data->glue_base, CLKRST_CTRL); in st_dwc3_init()
192 st_dwc3_writel(dwc3_data->glue_base, CLKRST_CTRL, reg); in st_dwc3_init()
197 struct st_dwc3 *dwc3_data; in st_dwc3_probe() local
205 dwc3_data = devm_kzalloc(dev, sizeof(*dwc3_data), GFP_KERNEL); in st_dwc3_probe()
206 if (!dwc3_data) in st_dwc3_probe()
209 dwc3_data->glue_base = in st_dwc3_probe()
211 if (IS_ERR(dwc3_data->glue_base)) in st_dwc3_probe()
212 return PTR_ERR(dwc3_data->glue_base); in st_dwc3_probe()
218 dwc3_data->dev = dev; in st_dwc3_probe()
219 dwc3_data->regmap = regmap; in st_dwc3_probe()
227 dwc3_data->syscfg_reg_off = res->start; in st_dwc3_probe()
230 dwc3_data->glue_base, dwc3_data->syscfg_reg_off); in st_dwc3_probe()
232 dwc3_data->rstc_pwrdn = in st_dwc3_probe()
234 if (IS_ERR(dwc3_data->rstc_pwrdn)) { in st_dwc3_probe()
236 ret = PTR_ERR(dwc3_data->rstc_pwrdn); in st_dwc3_probe()
241 reset_control_deassert(dwc3_data->rstc_pwrdn); in st_dwc3_probe()
243 dwc3_data->rstc_rst = in st_dwc3_probe()
245 if (IS_ERR(dwc3_data->rstc_rst)) { in st_dwc3_probe()
247 ret = PTR_ERR(dwc3_data->rstc_rst); in st_dwc3_probe()
252 reset_control_deassert(dwc3_data->rstc_rst); in st_dwc3_probe()
275 dwc3_data->dr_mode = usb_get_dr_mode(&child_pdev->dev); in st_dwc3_probe()
285 ret = st_dwc3_drd_init(dwc3_data); in st_dwc3_probe()
292 st_dwc3_init(dwc3_data); in st_dwc3_probe()
294 platform_set_drvdata(pdev, dwc3_data); in st_dwc3_probe()
300 reset_control_assert(dwc3_data->rstc_rst); in st_dwc3_probe()
302 reset_control_assert(dwc3_data->rstc_pwrdn); in st_dwc3_probe()
310 struct st_dwc3 *dwc3_data = platform_get_drvdata(pdev); in st_dwc3_remove() local
314 reset_control_assert(dwc3_data->rstc_pwrdn); in st_dwc3_remove()
315 reset_control_assert(dwc3_data->rstc_rst); in st_dwc3_remove()
323 struct st_dwc3 *dwc3_data = dev_get_drvdata(dev); in st_dwc3_suspend() local
325 reset_control_assert(dwc3_data->rstc_pwrdn); in st_dwc3_suspend()
326 reset_control_assert(dwc3_data->rstc_rst); in st_dwc3_suspend()
335 struct st_dwc3 *dwc3_data = dev_get_drvdata(dev); in st_dwc3_resume() local
340 reset_control_deassert(dwc3_data->rstc_pwrdn); in st_dwc3_resume()
341 reset_control_deassert(dwc3_data->rstc_rst); in st_dwc3_resume()
343 ret = st_dwc3_drd_init(dwc3_data); in st_dwc3_resume()
350 st_dwc3_init(dwc3_data); in st_dwc3_resume()