Lines Matching refs:dwmac

55 	int (*setup)(struct oxnas_dwmac *dwmac);
65 static int oxnas_dwmac_setup_ox810se(struct oxnas_dwmac *dwmac) in oxnas_dwmac_setup_ox810se() argument
70 ret = regmap_read(dwmac->regmap, OXNAS_DWMAC_CTRL_REGOFFSET, &value); in oxnas_dwmac_setup_ox810se()
79 regmap_write(dwmac->regmap, OXNAS_DWMAC_CTRL_REGOFFSET, value); in oxnas_dwmac_setup_ox810se()
84 static int oxnas_dwmac_setup_ox820(struct oxnas_dwmac *dwmac) in oxnas_dwmac_setup_ox820() argument
89 ret = regmap_read(dwmac->regmap, OXNAS_DWMAC_CTRL_REGOFFSET, &value); in oxnas_dwmac_setup_ox820()
106 regmap_write(dwmac->regmap, OXNAS_DWMAC_CTRL_REGOFFSET, value); in oxnas_dwmac_setup_ox820()
113 regmap_write(dwmac->regmap, OXNAS_DWMAC_DELAY_REGOFFSET, value); in oxnas_dwmac_setup_ox820()
120 struct oxnas_dwmac *dwmac = priv; in oxnas_dwmac_init() local
124 ret = device_reset(dwmac->dev); in oxnas_dwmac_init()
128 ret = clk_prepare_enable(dwmac->clk); in oxnas_dwmac_init()
132 ret = dwmac->data->setup(dwmac); in oxnas_dwmac_init()
134 clk_disable_unprepare(dwmac->clk); in oxnas_dwmac_init()
141 struct oxnas_dwmac *dwmac = priv; in oxnas_dwmac_exit() local
143 clk_disable_unprepare(dwmac->clk); in oxnas_dwmac_exit()
150 struct oxnas_dwmac *dwmac; in oxnas_dwmac_probe() local
161 dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL); in oxnas_dwmac_probe()
162 if (!dwmac) { in oxnas_dwmac_probe()
167 dwmac->data = (const struct oxnas_dwmac_data *)of_device_get_match_data(&pdev->dev); in oxnas_dwmac_probe()
168 if (!dwmac->data) { in oxnas_dwmac_probe()
173 dwmac->dev = &pdev->dev; in oxnas_dwmac_probe()
174 plat_dat->bsp_priv = dwmac; in oxnas_dwmac_probe()
178 dwmac->regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, in oxnas_dwmac_probe()
180 if (IS_ERR(dwmac->regmap)) { in oxnas_dwmac_probe()
182 ret = PTR_ERR(dwmac->regmap); in oxnas_dwmac_probe()
186 dwmac->clk = devm_clk_get(&pdev->dev, "gmac"); in oxnas_dwmac_probe()
187 if (IS_ERR(dwmac->clk)) { in oxnas_dwmac_probe()
188 ret = PTR_ERR(dwmac->clk); in oxnas_dwmac_probe()