~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/media/v4l2-clk.h

Version: ~ [ linux-5.13-rc5 ] ~ [ linux-5.12.9 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.42 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.124 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.193 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.235 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.271 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.271 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * V4L2 clock service
  3  *
  4  * Copyright (C) 2012-2013, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
  5  *
  6  * This program is free software; you can redistribute it and/or modify
  7  * it under the terms of the GNU General Public License version 2 as
  8  * published by the Free Software Foundation.
  9  *
 10  * ATTENTION: This is a temporary API and it shall be replaced by the generic
 11  * clock API, when the latter becomes widely available.
 12  */
 13 
 14 #ifndef MEDIA_V4L2_CLK_H
 15 #define MEDIA_V4L2_CLK_H
 16 
 17 #include <linux/atomic.h>
 18 #include <linux/export.h>
 19 #include <linux/list.h>
 20 #include <linux/mutex.h>
 21 
 22 struct module;
 23 struct device;
 24 
 25 struct clk;
 26 struct v4l2_clk {
 27         struct list_head list;
 28         const struct v4l2_clk_ops *ops;
 29         const char *dev_id;
 30         int enable;
 31         struct mutex lock; /* Protect the enable count */
 32         atomic_t use_count;
 33         struct clk *clk;
 34         void *priv;
 35 };
 36 
 37 struct v4l2_clk_ops {
 38         struct module   *owner;
 39         int             (*enable)(struct v4l2_clk *clk);
 40         void            (*disable)(struct v4l2_clk *clk);
 41         unsigned long   (*get_rate)(struct v4l2_clk *clk);
 42         int             (*set_rate)(struct v4l2_clk *clk, unsigned long);
 43 };
 44 
 45 struct v4l2_clk *v4l2_clk_register(const struct v4l2_clk_ops *ops,
 46                                    const char *dev_name,
 47                                    void *priv);
 48 void v4l2_clk_unregister(struct v4l2_clk *clk);
 49 struct v4l2_clk *v4l2_clk_get(struct device *dev, const char *id);
 50 void v4l2_clk_put(struct v4l2_clk *clk);
 51 int v4l2_clk_enable(struct v4l2_clk *clk);
 52 void v4l2_clk_disable(struct v4l2_clk *clk);
 53 unsigned long v4l2_clk_get_rate(struct v4l2_clk *clk);
 54 int v4l2_clk_set_rate(struct v4l2_clk *clk, unsigned long rate);
 55 
 56 struct module;
 57 
 58 struct v4l2_clk *__v4l2_clk_register_fixed(const char *dev_id,
 59                         unsigned long rate, struct module *owner);
 60 void v4l2_clk_unregister_fixed(struct v4l2_clk *clk);
 61 
 62 static inline struct v4l2_clk *v4l2_clk_register_fixed(const char *dev_id,
 63                                                         unsigned long rate)
 64 {
 65         return __v4l2_clk_register_fixed(dev_id, rate, THIS_MODULE);
 66 }
 67 
 68 #define V4L2_CLK_NAME_SIZE 64
 69 
 70 #define v4l2_clk_name_i2c(name, size, adap, client) snprintf(name, size, \
 71                           "%d-%04x", adap, client)
 72 
 73 #define v4l2_clk_name_of(name, size, node) snprintf(name, size, \
 74                           "of-%pOF", node)
 75 
 76 #endif
 77 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp