mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-11-29 22:51:49 +01:00
clk: meson: update driver for g12a-ao clocks
Update g12a-ao clk driver: - move clk->id check to .request function - remove unnecessary check (gate->reg == 0) Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in> Acked-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Link: https://lore.kernel.org/r/20220424082159.757622-4-adeep@lexina.in
This commit is contained in:
parent
4da0986562
commit
66a657b7c6
@ -28,14 +28,8 @@ static int meson_set_gate(struct clk *clk, bool on)
|
|||||||
struct meson_clk *priv = dev_get_priv(clk->dev);
|
struct meson_clk *priv = dev_get_priv(clk->dev);
|
||||||
struct meson_gate *gate;
|
struct meson_gate *gate;
|
||||||
|
|
||||||
if (clk->id >= ARRAY_SIZE(gates))
|
|
||||||
return -ENOENT;
|
|
||||||
|
|
||||||
gate = &gates[clk->id];
|
gate = &gates[clk->id];
|
||||||
|
|
||||||
if (gate->reg == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
regmap_update_bits(priv->map, gate->reg,
|
regmap_update_bits(priv->map, gate->reg,
|
||||||
BIT(gate->bit), on ? BIT(gate->bit) : 0);
|
BIT(gate->bit), on ? BIT(gate->bit) : 0);
|
||||||
|
|
||||||
@ -63,9 +57,18 @@ static int meson_clk_probe(struct udevice *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int meson_clk_request(struct clk *clk)
|
||||||
|
{
|
||||||
|
if (clk->id >= ARRAY_SIZE(gates))
|
||||||
|
return -ENOENT;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static struct clk_ops meson_clk_ops = {
|
static struct clk_ops meson_clk_ops = {
|
||||||
.disable = meson_clk_disable,
|
.disable = meson_clk_disable,
|
||||||
.enable = meson_clk_enable,
|
.enable = meson_clk_enable,
|
||||||
|
.request = meson_clk_request,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct udevice_id meson_clk_ids[] = {
|
static const struct udevice_id meson_clk_ids[] = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user