Sean Anderson | 65cd44e | 2020-06-24 06:41:10 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Copyright (C) 2020 Sean Anderson <seanga2@gmail.com> |
| 4 | */ |
| 5 | #ifndef K210_BYPASS_H |
| 6 | #define K210_BYPASS_H |
| 7 | |
Simon Glass | 4303396 | 2020-07-19 10:15:56 -0600 | [diff] [blame] | 8 | struct clk; |
Sean Anderson | 65cd44e | 2020-06-24 06:41:10 -0400 | [diff] [blame] | 9 | |
| 10 | struct k210_bypass { |
| 11 | struct clk clk; |
| 12 | struct clk **children; /* Clocks to reparent */ |
| 13 | struct clk **saved_parents; /* Parents saved over en-/dis-able */ |
| 14 | struct clk *bypassee; /* Clock to bypass */ |
| 15 | const struct clk_ops *bypassee_ops; /* Ops of the bypass clock */ |
| 16 | struct clk *alt; /* Clock to set children to when bypassing */ |
| 17 | size_t child_count; |
| 18 | }; |
| 19 | |
| 20 | #define to_k210_bypass(_clk) container_of(_clk, struct k210_bypass, clk) |
| 21 | |
| 22 | int k210_bypass_set_children(struct clk *clk, struct clk **children, |
| 23 | size_t child_count); |
| 24 | struct clk *k210_register_bypass_struct(const char *name, |
| 25 | const char *parent_name, |
| 26 | struct k210_bypass *bypass); |
| 27 | struct clk *k210_register_bypass(const char *name, const char *parent_name, |
| 28 | struct clk *bypassee, |
| 29 | const struct clk_ops *bypassee_ops, |
| 30 | struct clk *alt); |
| 31 | #endif /* K210_BYPASS_H */ |