21 #include <linux/slab.h>
22 #include <linux/device.h>
23 #include <linux/module.h>
57 dev_dbg(®->
dev,
"%s: calculated val %d\n", __func__, val);
84 .set_voltage_sel = anatop_regmap_set_voltage_sel,
85 .get_voltage_sel = anatop_regmap_get_voltage_sel,
109 rdesc = &sreg->
rdesc;
110 memset(rdesc, 0,
sizeof(*rdesc));
112 rdesc->
ops = &anatop_rops;
120 of_node_put(anatop_np);
122 return PTR_ERR(sreg->
anatop);
124 ret = of_property_read_u32(np,
"anatop-reg-offset",
127 dev_err(dev,
"no anatop-reg-offset property set\n");
128 goto anatop_probe_end;
130 ret = of_property_read_u32(np,
"anatop-vol-bit-width",
133 dev_err(dev,
"no anatop-vol-bit-width property set\n");
134 goto anatop_probe_end;
136 ret = of_property_read_u32(np,
"anatop-vol-bit-shift",
139 dev_err(dev,
"no anatop-vol-bit-shift property set\n");
140 goto anatop_probe_end;
142 ret = of_property_read_u32(np,
"anatop-min-bit-val",
145 dev_err(dev,
"no anatop-min-bit-val property set\n");
146 goto anatop_probe_end;
148 ret = of_property_read_u32(np,
"anatop-min-voltage",
151 dev_err(dev,
"no anatop-min-voltage property set\n");
152 goto anatop_probe_end;
154 ret = of_property_read_u32(np,
"anatop-max-voltage",
157 dev_err(dev,
"no anatop-max-voltage property set\n");
158 goto anatop_probe_end;
174 dev_err(dev,
"failed to register %s\n",
177 goto anatop_probe_end;
180 platform_set_drvdata(pdev, rdev);
202 { .compatible =
"fsl,anatop-regulator", },
208 .name =
"anatop_regulator",
210 .of_match_table = of_anatop_regulator_match_tbl,
212 .probe = anatop_regulator_probe,
216 static int __init anatop_regulator_init(
void)
222 static void __exit anatop_regulator_exit(
void)