Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  *  include/linux/clkdev.h
0004  *
0005  *  Copyright (C) 2008 Russell King.
0006  *
0007  * Helper for the clk API to assist looking up a struct clk.
0008  */
0009 #ifndef __CLKDEV_H
0010 #define __CLKDEV_H
0011 
0012 #include <linux/slab.h>
0013 
0014 struct clk;
0015 struct clk_hw;
0016 struct device;
0017 
0018 struct clk_lookup {
0019     struct list_head    node;
0020     const char      *dev_id;
0021     const char      *con_id;
0022     struct clk      *clk;
0023     struct clk_hw       *clk_hw;
0024 };
0025 
0026 #define CLKDEV_INIT(d, n, c)    \
0027     {           \
0028         .dev_id = d,    \
0029         .con_id = n,    \
0030         .clk = c,   \
0031     }
0032 
0033 void clkdev_add(struct clk_lookup *cl);
0034 void clkdev_drop(struct clk_lookup *cl);
0035 
0036 struct clk_lookup *clkdev_create(struct clk *clk, const char *con_id,
0037     const char *dev_fmt, ...) __printf(3, 4);
0038 struct clk_lookup *clkdev_hw_create(struct clk_hw *hw, const char *con_id,
0039     const char *dev_fmt, ...) __printf(3, 4);
0040 
0041 void clkdev_add_table(struct clk_lookup *, size_t);
0042 int clk_add_alias(const char *, const char *, const char *, struct device *);
0043 
0044 int clk_register_clkdev(struct clk *, const char *, const char *);
0045 int clk_hw_register_clkdev(struct clk_hw *, const char *, const char *);
0046 
0047 int devm_clk_hw_register_clkdev(struct device *dev, struct clk_hw *hw,
0048                 const char *con_id, const char *dev_id);
0049 void devm_clk_release_clkdev(struct device *dev, const char *con_id,
0050                  const char *dev_id);
0051 #endif