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