xref: /freebsd/sys/dev/regulator/regulator_fixed.h (revision b2f0caf160993c30a0d0e3d52e8a2d03616908cd)
1*b2f0caf1SEmmanuel Vadot /*-
2*b2f0caf1SEmmanuel Vadot  * Copyright 2016 Michal Meloun <mmel@FreeBSD.org>
3*b2f0caf1SEmmanuel Vadot  * All rights reserved.
4*b2f0caf1SEmmanuel Vadot  *
5*b2f0caf1SEmmanuel Vadot  * Redistribution and use in source and binary forms, with or without
6*b2f0caf1SEmmanuel Vadot  * modification, are permitted provided that the following conditions
7*b2f0caf1SEmmanuel Vadot  * are met:
8*b2f0caf1SEmmanuel Vadot  * 1. Redistributions of source code must retain the above copyright
9*b2f0caf1SEmmanuel Vadot  *    notice, this list of conditions and the following disclaimer.
10*b2f0caf1SEmmanuel Vadot  * 2. Redistributions in binary form must reproduce the above copyright
11*b2f0caf1SEmmanuel Vadot  *    notice, this list of conditions and the following disclaimer in the
12*b2f0caf1SEmmanuel Vadot  *    documentation and/or other materials provided with the distribution.
13*b2f0caf1SEmmanuel Vadot  *
14*b2f0caf1SEmmanuel Vadot  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15*b2f0caf1SEmmanuel Vadot  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16*b2f0caf1SEmmanuel Vadot  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17*b2f0caf1SEmmanuel Vadot  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18*b2f0caf1SEmmanuel Vadot  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19*b2f0caf1SEmmanuel Vadot  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20*b2f0caf1SEmmanuel Vadot  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21*b2f0caf1SEmmanuel Vadot  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22*b2f0caf1SEmmanuel Vadot  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23*b2f0caf1SEmmanuel Vadot  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24*b2f0caf1SEmmanuel Vadot  * SUCH DAMAGE.
25*b2f0caf1SEmmanuel Vadot  */
26*b2f0caf1SEmmanuel Vadot 
27*b2f0caf1SEmmanuel Vadot #ifndef _DEV_REGULATOR_FIXED_H_
28*b2f0caf1SEmmanuel Vadot #define	_DEV_REGULATOR_FIXED_H_
29*b2f0caf1SEmmanuel Vadot 
30*b2f0caf1SEmmanuel Vadot #include <dev/gpio/gpiobusvar.h>
31*b2f0caf1SEmmanuel Vadot #include <dev/regulator/regulator.h>
32*b2f0caf1SEmmanuel Vadot 
33*b2f0caf1SEmmanuel Vadot struct regnode_fixed_init_def {
34*b2f0caf1SEmmanuel Vadot 	struct regnode_init_def	reg_init_def;
35*b2f0caf1SEmmanuel Vadot 	bool			gpio_open_drain;
36*b2f0caf1SEmmanuel Vadot 	struct gpiobus_pin	*gpio_pin;
37*b2f0caf1SEmmanuel Vadot };
38*b2f0caf1SEmmanuel Vadot 
39*b2f0caf1SEmmanuel Vadot int regnode_fixed_register(device_t dev,
40*b2f0caf1SEmmanuel Vadot     struct regnode_fixed_init_def *init_def);
41*b2f0caf1SEmmanuel Vadot 
42*b2f0caf1SEmmanuel Vadot #endif /*_DEV_REGULATOR_FIXED_H_*/
43