1 // SPDX-License-Identifier: GPL-2.0+
4 * Dirk Eibach, Guntermann & Drunck GmbH, eibach@gdsys.de
7 * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
15 struct gdsys_rxaui_ctrl_regs {
24 #define rxaui_ctrl_set(map, member, val) \
25 regmap_set(map, struct gdsys_rxaui_ctrl_regs, member, val)
27 #define rxaui_ctrl_get(map, member, valp) \
28 regmap_get(map, struct gdsys_rxaui_ctrl_regs, member, valp)
30 struct gdsys_rxaui_ctrl_priv {
34 int gdsys_rxaui_set_polarity_inversion(struct udevice *dev, bool val)
36 struct gdsys_rxaui_ctrl_priv *priv = dev_get_priv(dev);
39 rxaui_ctrl_get(priv->map, ctrl_1, &state);
46 rxaui_ctrl_set(priv->map, ctrl_1, state);
51 static const struct misc_ops gdsys_rxaui_ctrl_ops = {
52 .set_enabled = gdsys_rxaui_set_polarity_inversion,
55 int gdsys_rxaui_ctrl_probe(struct udevice *dev)
57 struct gdsys_rxaui_ctrl_priv *priv = dev_get_priv(dev);
59 regmap_init_mem(dev, &priv->map);
64 static const struct udevice_id gdsys_rxaui_ctrl_ids[] = {
65 { .compatible = "gdsys,rxaui_ctrl" },
69 U_BOOT_DRIVER(gdsys_rxaui_ctrl) = {
70 .name = "gdsys_rxaui_ctrl",
72 .ops = &gdsys_rxaui_ctrl_ops,
73 .of_match = gdsys_rxaui_ctrl_ids,
74 .probe = gdsys_rxaui_ctrl_probe,
75 .priv_auto_alloc_size = sizeof(struct gdsys_rxaui_ctrl_priv),