mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-25 06:46:00 +00:00
timer: cadence: Add bind function to driver
When DT node has pwm-cells property it shouldn't be bind as timer driver but as PWM driver. That's why make sure that this property is checked. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org> Link: https://lore.kernel.org/r/434ef195fbedea9f83672a12d1ace0da16e8832e.1634303847.git.michal.simek@xilinx.com
This commit is contained in:
parent
035d56f238
commit
dcbdd24259
1 changed files with 12 additions and 0 deletions
|
@ -97,6 +97,17 @@ static int cadence_ttc_of_to_plat(struct udevice *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int cadence_ttc_bind(struct udevice *dev)
|
||||||
|
{
|
||||||
|
const char *cells;
|
||||||
|
|
||||||
|
cells = dev_read_prop(dev, "#pwm-cells", NULL);
|
||||||
|
if (cells)
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct timer_ops cadence_ttc_ops = {
|
static const struct timer_ops cadence_ttc_ops = {
|
||||||
.get_count = cadence_ttc_get_count,
|
.get_count = cadence_ttc_get_count,
|
||||||
};
|
};
|
||||||
|
@ -114,4 +125,5 @@ U_BOOT_DRIVER(cadence_ttc) = {
|
||||||
.priv_auto = sizeof(struct cadence_ttc_priv),
|
.priv_auto = sizeof(struct cadence_ttc_priv),
|
||||||
.probe = cadence_ttc_probe,
|
.probe = cadence_ttc_probe,
|
||||||
.ops = &cadence_ttc_ops,
|
.ops = &cadence_ttc_ops,
|
||||||
|
.bind = cadence_ttc_bind,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue