xref: /freebsd/sys/arm64/rockchip/rk_tsadc_if.m (revision 031beb4e239bfce798af17f5fe8dba8bcaf13d99)
16903d375SMichal Meloun#-
2*4d846d26SWarner Losh# SPDX-License-Identifier: BSD-2-Clause
36903d375SMichal Meloun#
46903d375SMichal Meloun# Copyright (c) 2019 Michal Meloun <mmel@FreeBSD.org>
56903d375SMichal Meloun#
66903d375SMichal Meloun# Redistribution and use in source and binary forms, with or without
76903d375SMichal Meloun# modification, are permitted provided that the following conditions
86903d375SMichal Meloun# are met:
96903d375SMichal Meloun# 1. Redistributions of source code must retain the above copyright
106903d375SMichal Meloun#    notice, this list of conditions and the following disclaimer.
116903d375SMichal Meloun# 2. Redistributions in binary form must reproduce the above copyright
126903d375SMichal Meloun#    notice, this list of conditions and the following disclaimer in the
136903d375SMichal Meloun#    documentation and/or other materials provided with the distribution.
146903d375SMichal Meloun#
156903d375SMichal Meloun# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
166903d375SMichal Meloun# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
176903d375SMichal Meloun# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
186903d375SMichal Meloun# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
196903d375SMichal Meloun# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
206903d375SMichal Meloun# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
216903d375SMichal Meloun# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
226903d375SMichal Meloun# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
236903d375SMichal Meloun# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
246903d375SMichal Meloun# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
256903d375SMichal Meloun# SUCH DAMAGE.
266903d375SMichal Meloun#
276903d375SMichal Meloun#
286903d375SMichal Meloun
296903d375SMichal Meloun#include <machine/bus.h>
306903d375SMichal Meloun
316903d375SMichal MelounINTERFACE rk_tsadc;
326903d375SMichal Meloun
336903d375SMichal Meloun
346903d375SMichal Meloun/**
356903d375SMichal Meloun * Read temperature
366903d375SMichal Meloun */
376903d375SMichal MelounMETHOD int get_temperature{
386903d375SMichal Meloun	device_t	dev;
396903d375SMichal Meloun	device_t	consumer;
406903d375SMichal Meloun	uintptr_t	id;
416903d375SMichal Meloun	int 		*val;
426903d375SMichal Meloun};
43