xref: /freebsd/sys/dev/gpio/dwgpio/dwgpio_if.m (revision 031beb4e239bfce798af17f5fe8dba8bcaf13d99)
1*564e8256SRuslan Bukin#-
2*564e8256SRuslan Bukin# Copyright (c) 2019 Ruslan Bukin <br@bsdpad.com>
3*564e8256SRuslan Bukin#
4*564e8256SRuslan Bukin# This software was developed by SRI International and the University of
5*564e8256SRuslan Bukin# Cambridge Computer Laboratory (Department of Computer Science and
6*564e8256SRuslan Bukin# Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the
7*564e8256SRuslan Bukin# DARPA SSITH research programme.
8*564e8256SRuslan Bukin#
9*564e8256SRuslan Bukin# Redistribution and use in source and binary forms, with or without
10*564e8256SRuslan Bukin# modification, are permitted provided that the following conditions
11*564e8256SRuslan Bukin# are met:
12*564e8256SRuslan Bukin# 1. Redistributions of source code must retain the above copyright
13*564e8256SRuslan Bukin#    notice, this list of conditions and the following disclaimer.
14*564e8256SRuslan Bukin# 2. Redistributions in binary form must reproduce the above copyright
15*564e8256SRuslan Bukin#    notice, this list of conditions and the following disclaimer in the
16*564e8256SRuslan Bukin#    documentation and/or other materials provided with the distribution.
17*564e8256SRuslan Bukin#
18*564e8256SRuslan Bukin# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19*564e8256SRuslan Bukin# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20*564e8256SRuslan Bukin# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21*564e8256SRuslan Bukin# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22*564e8256SRuslan Bukin# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23*564e8256SRuslan Bukin# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24*564e8256SRuslan Bukin# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25*564e8256SRuslan Bukin# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26*564e8256SRuslan Bukin# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27*564e8256SRuslan Bukin# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28*564e8256SRuslan Bukin# SUCH DAMAGE.
29*564e8256SRuslan Bukin#
30*564e8256SRuslan Bukin#
31*564e8256SRuslan Bukin
32*564e8256SRuslan Bukin#include <machine/bus.h>
33*564e8256SRuslan Bukin
34*564e8256SRuslan BukinINTERFACE dwgpio;
35*564e8256SRuslan Bukin
36*564e8256SRuslan Bukin#
37*564e8256SRuslan Bukin# GPIO write
38*564e8256SRuslan Bukin#
39*564e8256SRuslan BukinMETHOD int write {
40*564e8256SRuslan Bukin	device_t		dev;
41*564e8256SRuslan Bukin	bus_size_t		offset;
42*564e8256SRuslan Bukin	int			val;
43*564e8256SRuslan Bukin};
44*564e8256SRuslan Bukin
45*564e8256SRuslan Bukin#
46*564e8256SRuslan Bukin# GPIO read
47*564e8256SRuslan Bukin#
48*564e8256SRuslan BukinMETHOD int read {
49*564e8256SRuslan Bukin	device_t		dev;
50*564e8256SRuslan Bukin	bus_size_t		offset;
51*564e8256SRuslan Bukin};
52