Lines Matching refs:fp
51 static void fixed_phy_update(struct fixed_phy *fp) in fixed_phy_update() argument
53 if (gpio_is_valid(fp->link_gpio)) in fixed_phy_update()
54 fp->status.link = !!gpio_get_value_cansleep(fp->link_gpio); in fixed_phy_update()
60 struct fixed_phy *fp; in fixed_mdio_read() local
62 list_for_each_entry(fp, &fmb->phys, node) { in fixed_mdio_read()
63 if (fp->addr == phy_addr) { in fixed_mdio_read()
68 s = read_seqcount_begin(&fp->seqcount); in fixed_mdio_read()
70 if (fp->link_update) { in fixed_mdio_read()
71 fp->link_update(fp->phydev->attached_dev, in fixed_mdio_read()
72 &fp->status); in fixed_mdio_read()
73 fixed_phy_update(fp); in fixed_mdio_read()
75 state = fp->status; in fixed_mdio_read()
76 } while (read_seqcount_retry(&fp->seqcount, s)); in fixed_mdio_read()
101 struct fixed_phy *fp; in fixed_phy_set_link_update() local
106 list_for_each_entry(fp, &fmb->phys, node) { in fixed_phy_set_link_update()
107 if (fp->addr == phydev->mdio.addr) { in fixed_phy_set_link_update()
108 fp->link_update = link_update; in fixed_phy_set_link_update()
109 fp->phydev = phydev; in fixed_phy_set_link_update()
123 struct fixed_phy *fp; in fixed_phy_update_state() local
128 list_for_each_entry(fp, &fmb->phys, node) { in fixed_phy_update_state()
129 if (fp->addr == phydev->mdio.addr) { in fixed_phy_update_state()
130 write_seqcount_begin(&fp->seqcount); in fixed_phy_update_state()
132 fp->status.x = status->x in fixed_phy_update_state()
139 fixed_phy_update(fp); in fixed_phy_update_state()
140 write_seqcount_end(&fp->seqcount); in fixed_phy_update_state()
155 struct fixed_phy *fp; in fixed_phy_add() local
161 fp = kzalloc(sizeof(*fp), GFP_KERNEL); in fixed_phy_add()
162 if (!fp) in fixed_phy_add()
165 seqcount_init(&fp->seqcount); in fixed_phy_add()
170 fp->addr = phy_addr; in fixed_phy_add()
171 fp->status = *status; in fixed_phy_add()
172 fp->link_gpio = link_gpio; in fixed_phy_add()
174 if (gpio_is_valid(fp->link_gpio)) { in fixed_phy_add()
175 ret = gpio_request_one(fp->link_gpio, GPIOF_DIR_IN, in fixed_phy_add()
181 fixed_phy_update(fp); in fixed_phy_add()
183 list_add_tail(&fp->node, &fmb->phys); in fixed_phy_add()
188 kfree(fp); in fixed_phy_add()
198 struct fixed_phy *fp, *tmp; in fixed_phy_del() local
200 list_for_each_entry_safe(fp, tmp, &fmb->phys, node) { in fixed_phy_del()
201 if (fp->addr == phy_addr) { in fixed_phy_del()
202 list_del(&fp->node); in fixed_phy_del()
203 if (gpio_is_valid(fp->link_gpio)) in fixed_phy_del()
204 gpio_free(fp->link_gpio); in fixed_phy_del()
205 kfree(fp); in fixed_phy_del()
329 struct fixed_phy *fp, *tmp; in fixed_mdio_bus_exit() local
335 list_for_each_entry_safe(fp, tmp, &fmb->phys, node) { in fixed_mdio_bus_exit()
336 list_del(&fp->node); in fixed_mdio_bus_exit()
337 kfree(fp); in fixed_mdio_bus_exit()