xref: /freebsd/sys/dev/qcom_tlmm/qcom_tlmm_pin.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
14abe6533SAdrian Chadd /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
34abe6533SAdrian Chadd  *
44abe6533SAdrian Chadd  * Copyright (c) 2021 Adrian Chadd <adrian@FreeBSD.org>.
54abe6533SAdrian Chadd  *
64abe6533SAdrian Chadd  * Redistribution and use in source and binary forms, with or without
74abe6533SAdrian Chadd  * modification, are permitted provided that the following conditions
84abe6533SAdrian Chadd  * are met:
94abe6533SAdrian Chadd  * 1. Redistributions of source code must retain the above copyright
104abe6533SAdrian Chadd  *    notice unmodified, this list of conditions, and the following
114abe6533SAdrian Chadd  *    disclaimer.
124abe6533SAdrian Chadd  * 2. Redistributions in binary form must reproduce the above copyright
134abe6533SAdrian Chadd  *    notice, this list of conditions and the following disclaimer in the
144abe6533SAdrian Chadd  *    documentation and/or other materials provided with the distribution.
154abe6533SAdrian Chadd  *
164abe6533SAdrian Chadd  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
174abe6533SAdrian Chadd  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
184abe6533SAdrian Chadd  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
194abe6533SAdrian Chadd  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
204abe6533SAdrian Chadd  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
214abe6533SAdrian Chadd  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
224abe6533SAdrian Chadd  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
234abe6533SAdrian Chadd  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
244abe6533SAdrian Chadd  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
254abe6533SAdrian Chadd  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
264abe6533SAdrian Chadd  * SUCH DAMAGE.
274abe6533SAdrian Chadd  *
284abe6533SAdrian Chadd  */
294abe6533SAdrian Chadd 
304abe6533SAdrian Chadd #ifndef	__QCOM_TLMM_PIN_H__
314abe6533SAdrian Chadd #define	__QCOM_TLMM_PIN_H__
324abe6533SAdrian Chadd 
334abe6533SAdrian Chadd extern	device_t qcom_tlmm_get_bus(device_t dev);
344abe6533SAdrian Chadd extern	int qcom_tlmm_pin_max(device_t dev, int *maxpin);
354abe6533SAdrian Chadd extern	int qcom_tlmm_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps);
364abe6533SAdrian Chadd extern	int qcom_tlmm_pin_getflags(device_t dev, uint32_t pin,
374abe6533SAdrian Chadd 	    uint32_t *flags);
384abe6533SAdrian Chadd extern	int qcom_tlmm_pin_getname(device_t dev, uint32_t pin, char *name);
394abe6533SAdrian Chadd extern	int qcom_tlmm_pin_setflags(device_t dev, uint32_t pin,
404abe6533SAdrian Chadd 	    uint32_t flags);
414abe6533SAdrian Chadd extern	int qcom_tlmm_pin_set(device_t dev, uint32_t pin, unsigned int value);
424abe6533SAdrian Chadd extern	int qcom_tlmm_pin_get(device_t dev, uint32_t pin, unsigned int *val);
434abe6533SAdrian Chadd extern	int qcom_tlmm_pin_toggle(device_t dev, uint32_t pin);
444abe6533SAdrian Chadd extern	int qcom_tlmm_filter(void *arg);
454abe6533SAdrian Chadd extern	void qcom_tlmm_intr(void *arg);
464abe6533SAdrian Chadd extern	phandle_t qcom_tlmm_pin_get_node(device_t dev, device_t bus);
474abe6533SAdrian Chadd 
484abe6533SAdrian Chadd #endif	/* __QCOM_TLMM_PIN_H__ */
49