xref: /OK3568_Linux_fs/kernel/include/linux/mux/consumer.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * mux/consumer.h - definitions for the multiplexer consumer interface
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Copyright (C) 2017 Axentia Technologies AB
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  * Author: Peter Rosin <peda@axentia.se>
8*4882a593Smuzhiyun  */
9*4882a593Smuzhiyun 
10*4882a593Smuzhiyun #ifndef _LINUX_MUX_CONSUMER_H
11*4882a593Smuzhiyun #define _LINUX_MUX_CONSUMER_H
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun #include <linux/compiler.h>
14*4882a593Smuzhiyun 
15*4882a593Smuzhiyun struct device;
16*4882a593Smuzhiyun struct mux_control;
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun unsigned int mux_control_states(struct mux_control *mux);
19*4882a593Smuzhiyun int __must_check mux_control_select(struct mux_control *mux,
20*4882a593Smuzhiyun 				    unsigned int state);
21*4882a593Smuzhiyun int __must_check mux_control_try_select(struct mux_control *mux,
22*4882a593Smuzhiyun 					unsigned int state);
23*4882a593Smuzhiyun int mux_control_deselect(struct mux_control *mux);
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun struct mux_control *mux_control_get(struct device *dev, const char *mux_name);
26*4882a593Smuzhiyun void mux_control_put(struct mux_control *mux);
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun struct mux_control *devm_mux_control_get(struct device *dev,
29*4882a593Smuzhiyun 					 const char *mux_name);
30*4882a593Smuzhiyun 
31*4882a593Smuzhiyun #endif /* _LINUX_MUX_CONSUMER_H */
32