diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/clk-provider.h | 23 | ||||
-rw-r--r-- | include/linux/clk.h | 16 | ||||
-rw-r--r-- | include/linux/clk/tegra.h | 1 | ||||
-rw-r--r-- | include/linux/clk/ti.h | 2 |
4 files changed, 33 insertions, 9 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index f711be6e8c44..210a890008f9 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
@@ -399,6 +399,7 @@ struct clk_divider { | |||
399 | spinlock_t *lock; | 399 | spinlock_t *lock; |
400 | }; | 400 | }; |
401 | 401 | ||
402 | #define clk_div_mask(width) ((1 << (width)) - 1) | ||
402 | #define to_clk_divider(_hw) container_of(_hw, struct clk_divider, hw) | 403 | #define to_clk_divider(_hw) container_of(_hw, struct clk_divider, hw) |
403 | 404 | ||
404 | #define CLK_DIVIDER_ONE_BASED BIT(0) | 405 | #define CLK_DIVIDER_ONE_BASED BIT(0) |
@@ -419,6 +420,10 @@ long divider_round_rate_parent(struct clk_hw *hw, struct clk_hw *parent, | |||
419 | unsigned long rate, unsigned long *prate, | 420 | unsigned long rate, unsigned long *prate, |
420 | const struct clk_div_table *table, | 421 | const struct clk_div_table *table, |
421 | u8 width, unsigned long flags); | 422 | u8 width, unsigned long flags); |
423 | long divider_ro_round_rate_parent(struct clk_hw *hw, struct clk_hw *parent, | ||
424 | unsigned long rate, unsigned long *prate, | ||
425 | const struct clk_div_table *table, u8 width, | ||
426 | unsigned long flags, unsigned int val); | ||
422 | int divider_get_val(unsigned long rate, unsigned long parent_rate, | 427 | int divider_get_val(unsigned long rate, unsigned long parent_rate, |
423 | const struct clk_div_table *table, u8 width, | 428 | const struct clk_div_table *table, u8 width, |
424 | unsigned long flags); | 429 | unsigned long flags); |
@@ -449,8 +454,9 @@ void clk_hw_unregister_divider(struct clk_hw *hw); | |||
449 | * | 454 | * |
450 | * @hw: handle between common and hardware-specific interfaces | 455 | * @hw: handle between common and hardware-specific interfaces |
451 | * @reg: register controlling multiplexer | 456 | * @reg: register controlling multiplexer |
457 | * @table: array of register values corresponding to the parent index | ||
452 | * @shift: shift to multiplexer bit field | 458 | * @shift: shift to multiplexer bit field |
453 | * @width: width of mutliplexer bit field | 459 | * @mask: mask of mutliplexer bit field |
454 | * @flags: hardware-specific flags | 460 | * @flags: hardware-specific flags |
455 | * @lock: register lock | 461 | * @lock: register lock |
456 | * | 462 | * |
@@ -510,6 +516,10 @@ struct clk_hw *clk_hw_register_mux_table(struct device *dev, const char *name, | |||
510 | void __iomem *reg, u8 shift, u32 mask, | 516 | void __iomem *reg, u8 shift, u32 mask, |
511 | u8 clk_mux_flags, u32 *table, spinlock_t *lock); | 517 | u8 clk_mux_flags, u32 *table, spinlock_t *lock); |
512 | 518 | ||
519 | int clk_mux_val_to_index(struct clk_hw *hw, u32 *table, unsigned int flags, | ||
520 | unsigned int val); | ||
521 | unsigned int clk_mux_index_to_val(u32 *table, unsigned int flags, u8 index); | ||
522 | |||
513 | void clk_unregister_mux(struct clk *clk); | 523 | void clk_unregister_mux(struct clk *clk); |
514 | void clk_hw_unregister_mux(struct clk_hw *hw); | 524 | void clk_hw_unregister_mux(struct clk_hw *hw); |
515 | 525 | ||
@@ -774,6 +784,17 @@ static inline long divider_round_rate(struct clk_hw *hw, unsigned long rate, | |||
774 | rate, prate, table, width, flags); | 784 | rate, prate, table, width, flags); |
775 | } | 785 | } |
776 | 786 | ||
787 | static inline long divider_ro_round_rate(struct clk_hw *hw, unsigned long rate, | ||
788 | unsigned long *prate, | ||
789 | const struct clk_div_table *table, | ||
790 | u8 width, unsigned long flags, | ||
791 | unsigned int val) | ||
792 | { | ||
793 | return divider_ro_round_rate_parent(hw, clk_hw_get_parent(hw), | ||
794 | rate, prate, table, width, flags, | ||
795 | val); | ||
796 | } | ||
797 | |||
777 | /* | 798 | /* |
778 | * FIXME clock api without lock protection | 799 | * FIXME clock api without lock protection |
779 | */ | 800 | */ |
diff --git a/include/linux/clk.h b/include/linux/clk.h index 4c4ef9f34db3..0dbd0885b2c2 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h | |||
@@ -209,7 +209,7 @@ static inline int clk_prepare(struct clk *clk) | |||
209 | return 0; | 209 | return 0; |
210 | } | 210 | } |
211 | 211 | ||
212 | static inline int clk_bulk_prepare(int num_clks, struct clk_bulk_data *clks) | 212 | static inline int __must_check clk_bulk_prepare(int num_clks, struct clk_bulk_data *clks) |
213 | { | 213 | { |
214 | might_sleep(); | 214 | might_sleep(); |
215 | return 0; | 215 | return 0; |
@@ -603,8 +603,8 @@ static inline struct clk *clk_get(struct device *dev, const char *id) | |||
603 | return NULL; | 603 | return NULL; |
604 | } | 604 | } |
605 | 605 | ||
606 | static inline int clk_bulk_get(struct device *dev, int num_clks, | 606 | static inline int __must_check clk_bulk_get(struct device *dev, int num_clks, |
607 | struct clk_bulk_data *clks) | 607 | struct clk_bulk_data *clks) |
608 | { | 608 | { |
609 | return 0; | 609 | return 0; |
610 | } | 610 | } |
@@ -614,8 +614,8 @@ static inline struct clk *devm_clk_get(struct device *dev, const char *id) | |||
614 | return NULL; | 614 | return NULL; |
615 | } | 615 | } |
616 | 616 | ||
617 | static inline int devm_clk_bulk_get(struct device *dev, int num_clks, | 617 | static inline int __must_check devm_clk_bulk_get(struct device *dev, int num_clks, |
618 | struct clk_bulk_data *clks) | 618 | struct clk_bulk_data *clks) |
619 | { | 619 | { |
620 | return 0; | 620 | return 0; |
621 | } | 621 | } |
@@ -645,7 +645,7 @@ static inline int clk_enable(struct clk *clk) | |||
645 | return 0; | 645 | return 0; |
646 | } | 646 | } |
647 | 647 | ||
648 | static inline int clk_bulk_enable(int num_clks, struct clk_bulk_data *clks) | 648 | static inline int __must_check clk_bulk_enable(int num_clks, struct clk_bulk_data *clks) |
649 | { | 649 | { |
650 | return 0; | 650 | return 0; |
651 | } | 651 | } |
@@ -719,8 +719,8 @@ static inline void clk_disable_unprepare(struct clk *clk) | |||
719 | clk_unprepare(clk); | 719 | clk_unprepare(clk); |
720 | } | 720 | } |
721 | 721 | ||
722 | static inline int clk_bulk_prepare_enable(int num_clks, | 722 | static inline int __must_check clk_bulk_prepare_enable(int num_clks, |
723 | struct clk_bulk_data *clks) | 723 | struct clk_bulk_data *clks) |
724 | { | 724 | { |
725 | int ret; | 725 | int ret; |
726 | 726 | ||
diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h index d23c9cf26993..afb9edfa5d58 100644 --- a/include/linux/clk/tegra.h +++ b/include/linux/clk/tegra.h | |||
@@ -128,5 +128,6 @@ extern void tegra210_sata_pll_hw_sequence_start(void); | |||
128 | extern void tegra210_set_sata_pll_seq_sw(bool state); | 128 | extern void tegra210_set_sata_pll_seq_sw(bool state); |
129 | extern void tegra210_put_utmipll_in_iddq(void); | 129 | extern void tegra210_put_utmipll_in_iddq(void); |
130 | extern void tegra210_put_utmipll_out_iddq(void); | 130 | extern void tegra210_put_utmipll_out_iddq(void); |
131 | extern int tegra210_clk_handle_mbist_war(unsigned int id); | ||
131 | 132 | ||
132 | #endif /* __LINUX_CLK_TEGRA_H_ */ | 133 | #endif /* __LINUX_CLK_TEGRA_H_ */ |
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h index d18da839b810..9e8611470187 100644 --- a/include/linux/clk/ti.h +++ b/include/linux/clk/ti.h | |||
@@ -211,6 +211,7 @@ enum { | |||
211 | * struct ti_clk_ll_ops - low-level ops for clocks | 211 | * struct ti_clk_ll_ops - low-level ops for clocks |
212 | * @clk_readl: pointer to register read function | 212 | * @clk_readl: pointer to register read function |
213 | * @clk_writel: pointer to register write function | 213 | * @clk_writel: pointer to register write function |
214 | * @clk_rmw: pointer to register read-modify-write function | ||
214 | * @clkdm_clk_enable: pointer to clockdomain enable function | 215 | * @clkdm_clk_enable: pointer to clockdomain enable function |
215 | * @clkdm_clk_disable: pointer to clockdomain disable function | 216 | * @clkdm_clk_disable: pointer to clockdomain disable function |
216 | * @clkdm_lookup: pointer to clockdomain lookup function | 217 | * @clkdm_lookup: pointer to clockdomain lookup function |
@@ -226,6 +227,7 @@ enum { | |||
226 | struct ti_clk_ll_ops { | 227 | struct ti_clk_ll_ops { |
227 | u32 (*clk_readl)(const struct clk_omap_reg *reg); | 228 | u32 (*clk_readl)(const struct clk_omap_reg *reg); |
228 | void (*clk_writel)(u32 val, const struct clk_omap_reg *reg); | 229 | void (*clk_writel)(u32 val, const struct clk_omap_reg *reg); |
230 | void (*clk_rmw)(u32 val, u32 mask, const struct clk_omap_reg *reg); | ||
229 | int (*clkdm_clk_enable)(struct clockdomain *clkdm, struct clk *clk); | 231 | int (*clkdm_clk_enable)(struct clockdomain *clkdm, struct clk *clk); |
230 | int (*clkdm_clk_disable)(struct clockdomain *clkdm, | 232 | int (*clkdm_clk_disable)(struct clockdomain *clkdm, |
231 | struct clk *clk); | 233 | struct clk *clk); |