xref: /freebsd/sys/dev/gpio/dwgpio/dwgpio_if.m (revision 031beb4e)
1564e8256SRuslan Bukin#-
2564e8256SRuslan Bukin# Copyright (c) 2019 Ruslan Bukin <br@bsdpad.com>
3564e8256SRuslan Bukin#
4564e8256SRuslan Bukin# This software was developed by SRI International and the University of
5564e8256SRuslan Bukin# Cambridge Computer Laboratory (Department of Computer Science and
6564e8256SRuslan Bukin# Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the
7564e8256SRuslan Bukin# DARPA SSITH research programme.
8564e8256SRuslan Bukin#
9564e8256SRuslan Bukin# Redistribution and use in source and binary forms, with or without
10564e8256SRuslan Bukin# modification, are permitted provided that the following conditions
11564e8256SRuslan Bukin# are met:
12564e8256SRuslan Bukin# 1. Redistributions of source code must retain the above copyright
13564e8256SRuslan Bukin#    notice, this list of conditions and the following disclaimer.
14564e8256SRuslan Bukin# 2. Redistributions in binary form must reproduce the above copyright
15564e8256SRuslan Bukin#    notice, this list of conditions and the following disclaimer in the
16564e8256SRuslan Bukin#    documentation and/or other materials provided with the distribution.
17564e8256SRuslan Bukin#
18564e8256SRuslan Bukin# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19564e8256SRuslan Bukin# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20564e8256SRuslan Bukin# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21564e8256SRuslan Bukin# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22564e8256SRuslan Bukin# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23564e8256SRuslan Bukin# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24564e8256SRuslan Bukin# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25564e8256SRuslan Bukin# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26564e8256SRuslan Bukin# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27564e8256SRuslan Bukin# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28564e8256SRuslan Bukin# SUCH DAMAGE.
29564e8256SRuslan Bukin#
30564e8256SRuslan Bukin#
31564e8256SRuslan Bukin
32564e8256SRuslan Bukin#include <machine/bus.h>
33564e8256SRuslan Bukin
34564e8256SRuslan BukinINTERFACE dwgpio;
35564e8256SRuslan Bukin
36564e8256SRuslan Bukin#
37564e8256SRuslan Bukin# GPIO write
38564e8256SRuslan Bukin#
39564e8256SRuslan BukinMETHOD int write {
40564e8256SRuslan Bukin	device_t		dev;
41564e8256SRuslan Bukin	bus_size_t		offset;
42564e8256SRuslan Bukin	int			val;
43564e8256SRuslan Bukin};
44564e8256SRuslan Bukin
45564e8256SRuslan Bukin#
46564e8256SRuslan Bukin# GPIO read
47564e8256SRuslan Bukin#
48564e8256SRuslan BukinMETHOD int read {
49564e8256SRuslan Bukin	device_t		dev;
50564e8256SRuslan Bukin	bus_size_t		offset;
51564e8256SRuslan Bukin};
52