xref: /freebsd/sys/dev/iicbus/ofw_iicbus_if.m (revision 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
11bd3e8baSMichal Meloun#-
2*4d846d26SWarner Losh# SPDX-License-Identifier: BSD-2-Clause
31bd3e8baSMichal Meloun#
41bd3e8baSMichal Meloun# Copyright 2020 Michal Meloun <mmel@FreeBSD.org>
51bd3e8baSMichal Meloun#
61bd3e8baSMichal Meloun# Redistribution and use in source and binary forms, with or without
71bd3e8baSMichal Meloun# modification, are permitted provided that the following conditions
81bd3e8baSMichal Meloun# are met:
91bd3e8baSMichal Meloun# 1. Redistributions of source code must retain the above copyright
101bd3e8baSMichal Meloun#    notice, this list of conditions and the following disclaimer.
111bd3e8baSMichal Meloun# 2. Redistributions in binary form must reproduce the above copyright
121bd3e8baSMichal Meloun#    notice, this list of conditions and the following disclaimer in the
131bd3e8baSMichal Meloun#    documentation and/or other materials provided with the distribution.
141bd3e8baSMichal Meloun#
151bd3e8baSMichal Meloun# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
161bd3e8baSMichal Meloun# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
171bd3e8baSMichal Meloun# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
181bd3e8baSMichal Meloun# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
191bd3e8baSMichal Meloun# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
201bd3e8baSMichal Meloun# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
211bd3e8baSMichal Meloun# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
221bd3e8baSMichal Meloun# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
231bd3e8baSMichal Meloun# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
241bd3e8baSMichal Meloun# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
251bd3e8baSMichal Meloun# SUCH DAMAGE.
261bd3e8baSMichal Meloun#
271bd3e8baSMichal Meloun
281bd3e8baSMichal Meloun#include <sys/bus.h>
291bd3e8baSMichal Meloun#include <dev/ofw/openfirm.h>
301bd3e8baSMichal Meloun
311bd3e8baSMichal MelounINTERFACE ofw_iicbus;
321bd3e8baSMichal Meloun
331bd3e8baSMichal Meloun#
341bd3e8baSMichal Meloun# Interpret interrupt
351bd3e8baSMichal Meloun#
361bd3e8baSMichal MelounMETHOD int set_devinfo {
371bd3e8baSMichal Meloun	device_t bus;
381bd3e8baSMichal Meloun	device_t dev;
391bd3e8baSMichal Meloun	phandle_t ofw_node;
401bd3e8baSMichal Meloun	char *ofw_name;
411bd3e8baSMichal Meloun	char *ofw_compat;
427504f32cSMichal Meloun	uint32_t i2c_addr;
431bd3e8baSMichal Meloun};
44