xref: /dflybsd-src/sys/dev/drm/include/linux/pwm.h (revision fb572d17facb99509210208b5c7e0aa2120d7079)
1d385edc4SFrançois Tigeot /*
2d385edc4SFrançois Tigeot  * Copyright (c) 2016 François Tigeot
3d385edc4SFrançois Tigeot  * All rights reserved.
4d385edc4SFrançois Tigeot  *
5d385edc4SFrançois Tigeot  * Redistribution and use in source and binary forms, with or without
6d385edc4SFrançois Tigeot  * modification, are permitted provided that the following conditions
7d385edc4SFrançois Tigeot  * are met:
8d385edc4SFrançois Tigeot  * 1. Redistributions of source code must retain the above copyright
9d385edc4SFrançois Tigeot  *    notice unmodified, this list of conditions, and the following
10d385edc4SFrançois Tigeot  *    disclaimer.
11d385edc4SFrançois Tigeot  * 2. Redistributions in binary form must reproduce the above copyright
12d385edc4SFrançois Tigeot  *    notice, this list of conditions and the following disclaimer in the
13d385edc4SFrançois Tigeot  *    documentation and/or other materials provided with the distribution.
14d385edc4SFrançois Tigeot  *
15d385edc4SFrançois Tigeot  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16d385edc4SFrançois Tigeot  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17d385edc4SFrançois Tigeot  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18d385edc4SFrançois Tigeot  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19d385edc4SFrançois Tigeot  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20d385edc4SFrançois Tigeot  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21d385edc4SFrançois Tigeot  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22d385edc4SFrançois Tigeot  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23d385edc4SFrançois Tigeot  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24d385edc4SFrançois Tigeot  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25d385edc4SFrançois Tigeot  */
26d385edc4SFrançois Tigeot 
27d385edc4SFrançois Tigeot #ifndef _LINUX_PWM_H_
28d385edc4SFrançois Tigeot #define _LINUX_PWM_H_
29d385edc4SFrançois Tigeot 
30*fb572d17SFrançois Tigeot #include <linux/device.h>
31d385edc4SFrançois Tigeot 
32d385edc4SFrançois Tigeot struct pwm_device;
33d385edc4SFrançois Tigeot 
34d385edc4SFrançois Tigeot static inline int
pwm_config(struct pwm_device * pwm,int duty_ns,int period_ns)35d385edc4SFrançois Tigeot pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
36d385edc4SFrançois Tigeot {
37d385edc4SFrançois Tigeot 	kprintf("Stub: %s\n", __FUNCTION__);
38d385edc4SFrançois Tigeot 	return -EINVAL;
39d385edc4SFrançois Tigeot }
40d385edc4SFrançois Tigeot 
41d385edc4SFrançois Tigeot static inline unsigned int
pwm_get_duty_cycle(const struct pwm_device * pwm)42d385edc4SFrançois Tigeot pwm_get_duty_cycle(const struct pwm_device *pwm)
43d385edc4SFrançois Tigeot {
44d385edc4SFrançois Tigeot 	kprintf("Stub: %s\n", __FUNCTION__);
45d385edc4SFrançois Tigeot 	return 0;
46d385edc4SFrançois Tigeot }
47d385edc4SFrançois Tigeot 
48d385edc4SFrançois Tigeot static inline void
pwm_set_duty_cycle(struct pwm_device * pwm,unsigned int duty)49d385edc4SFrançois Tigeot pwm_set_duty_cycle(struct pwm_device *pwm, unsigned int duty)
50d385edc4SFrançois Tigeot {
51d385edc4SFrançois Tigeot 	kprintf("Stub: %s\n", __FUNCTION__);
52d385edc4SFrançois Tigeot }
53d385edc4SFrançois Tigeot 
54d385edc4SFrançois Tigeot static inline int
pwm_enable(struct pwm_device * pwm)55d385edc4SFrançois Tigeot pwm_enable(struct pwm_device *pwm)
56d385edc4SFrançois Tigeot {
57d385edc4SFrançois Tigeot 	kprintf("Stub: %s\n", __FUNCTION__);
58d385edc4SFrançois Tigeot 	return -EINVAL;
59d385edc4SFrançois Tigeot }
60d385edc4SFrançois Tigeot 
61d385edc4SFrançois Tigeot static inline void
pwm_disable(struct pwm_device * pwm)62d385edc4SFrançois Tigeot pwm_disable(struct pwm_device *pwm)
63d385edc4SFrançois Tigeot {
64d385edc4SFrançois Tigeot 	kprintf("Stub: %s\n", __FUNCTION__);
65d385edc4SFrançois Tigeot }
66d385edc4SFrançois Tigeot 
67d385edc4SFrançois Tigeot static inline struct pwm_device *
pwm_get(struct device * dev,const char * consumer)68d385edc4SFrançois Tigeot pwm_get(struct device *dev, const char *consumer)
69d385edc4SFrançois Tigeot {
70d385edc4SFrançois Tigeot 	kprintf("Stub: %s\n", __FUNCTION__);
71d385edc4SFrançois Tigeot 	return NULL;
72d385edc4SFrançois Tigeot }
73d385edc4SFrançois Tigeot 
74d385edc4SFrançois Tigeot static inline void
pwm_put(struct pwm_device * pwm)75d385edc4SFrançois Tigeot pwm_put(struct pwm_device *pwm)
76d385edc4SFrançois Tigeot {
77d385edc4SFrançois Tigeot 	kprintf("Stub: %s\n", __FUNCTION__);
78d385edc4SFrançois Tigeot }
79d385edc4SFrançois Tigeot 
80d385edc4SFrançois Tigeot #endif	/* _LINUX_PWM_H_ */
81