Lines Matching +full:fast +full:- +full:clk

1 // SPDX-License-Identifier: GPL-2.0+
3 * Hisilicon Fast Ethernet MDIO Bus Driver
8 #include <linux/clk.h>
24 struct clk *clk; member
32 return readl_poll_timeout(data->membase + MDIO_RWCTRL, in hisi_femac_mdio_wait_ready()
38 struct hisi_femac_mdio_data *data = bus->priv; in hisi_femac_mdio_read()
46 data->membase + MDIO_RWCTRL); in hisi_femac_mdio_read()
52 return readl(data->membase + MDIO_RO_DATA) & 0xFFFF; in hisi_femac_mdio_read()
58 struct hisi_femac_mdio_data *data = bus->priv; in hisi_femac_mdio_write()
67 data->membase + MDIO_RWCTRL); in hisi_femac_mdio_write()
74 struct device_node *np = pdev->dev.of_node; in hisi_femac_mdio_probe()
81 return -ENOMEM; in hisi_femac_mdio_probe()
83 bus->name = "hisi_femac_mii_bus"; in hisi_femac_mdio_probe()
84 bus->read = &hisi_femac_mdio_read; in hisi_femac_mdio_probe()
85 bus->write = &hisi_femac_mdio_write; in hisi_femac_mdio_probe()
86 snprintf(bus->id, MII_BUS_ID_SIZE, "%s", pdev->name); in hisi_femac_mdio_probe()
87 bus->parent = &pdev->dev; in hisi_femac_mdio_probe()
89 data = bus->priv; in hisi_femac_mdio_probe()
90 data->membase = devm_platform_ioremap_resource(pdev, 0); in hisi_femac_mdio_probe()
91 if (IS_ERR(data->membase)) { in hisi_femac_mdio_probe()
92 ret = PTR_ERR(data->membase); in hisi_femac_mdio_probe()
96 data->clk = devm_clk_get(&pdev->dev, NULL); in hisi_femac_mdio_probe()
97 if (IS_ERR(data->clk)) { in hisi_femac_mdio_probe()
98 ret = PTR_ERR(data->clk); in hisi_femac_mdio_probe()
102 ret = clk_prepare_enable(data->clk); in hisi_femac_mdio_probe()
115 clk_disable_unprepare(data->clk); in hisi_femac_mdio_probe()
124 struct hisi_femac_mdio_data *data = bus->priv; in hisi_femac_mdio_remove()
127 clk_disable_unprepare(data->clk); in hisi_femac_mdio_remove()
132 { .compatible = "hisilicon,hisi-femac-mdio" },
141 .name = "hisi-femac-mdio",
148 MODULE_DESCRIPTION("Hisilicon Fast Ethernet MAC MDIO interface driver");