1b8ed20dbSIan Lepore#- 2b8ed20dbSIan Lepore# Copyright (c) 2014 Ian Lepore 3b8ed20dbSIan Lepore# All rights reserved. 4b8ed20dbSIan Lepore# 5b8ed20dbSIan Lepore# Redistribution and use in source and binary forms, with or without 6b8ed20dbSIan Lepore# modification, are permitted provided that the following conditions 7b8ed20dbSIan Lepore# are met: 8b8ed20dbSIan Lepore# 1. Redistributions of source code must retain the above copyright 9b8ed20dbSIan Lepore# notice, this list of conditions and the following disclaimer. 10b8ed20dbSIan Lepore# 2. Redistributions in binary form must reproduce the above copyright 11b8ed20dbSIan Lepore# notice, this list of conditions and the following disclaimer in the 12b8ed20dbSIan Lepore# documentation and/or other materials provided with the distribution. 13b8ed20dbSIan Lepore# 14b8ed20dbSIan Lepore# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15b8ed20dbSIan Lepore# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16b8ed20dbSIan Lepore# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17b8ed20dbSIan Lepore# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18b8ed20dbSIan Lepore# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19b8ed20dbSIan Lepore# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20b8ed20dbSIan Lepore# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21b8ed20dbSIan Lepore# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22b8ed20dbSIan Lepore# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23b8ed20dbSIan Lepore# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24b8ed20dbSIan Lepore# SUCH DAMAGE. 25b8ed20dbSIan Lepore# 26b8ed20dbSIan Lepore# $FreeBSD$ 27b8ed20dbSIan Lepore# 28b8ed20dbSIan Lepore 29b8ed20dbSIan Lepore#include <sys/types.h> 30*413d07eaSEmmanuel Vadot#include <sys/bus.h> 31b8ed20dbSIan Lepore#include <dev/ofw/openfirm.h> 32b8ed20dbSIan Lepore 33b8ed20dbSIan Lepore# 34b8ed20dbSIan Lepore# This is the interface that fdt_pinctrl drivers provide to other drivers. 35b8ed20dbSIan Lepore# 36b8ed20dbSIan Lepore 37b8ed20dbSIan LeporeINTERFACE fdt_pinctrl; 38b8ed20dbSIan Lepore 39*413d07eaSEmmanuel Vadot# Needed for timestamping device probe/attach calls 40*413d07eaSEmmanuel VadotHEADER { 41*413d07eaSEmmanuel Vadot #include <sys/tslog.h> 42*413d07eaSEmmanuel Vadot} 43*413d07eaSEmmanuel Vadot 44b8ed20dbSIan Lepore# 45b8ed20dbSIan Lepore# Set pins to the specified configuration. The cfgxref arg is an xref phandle 46b8ed20dbSIan Lepore# to a descendent node (child, grandchild, ...) of the pinctrl device node. 47b8ed20dbSIan Lepore# Returns 0 on success or a standard errno value. 48b8ed20dbSIan Lepore# 49*413d07eaSEmmanuel VadotPROLOG { 50*413d07eaSEmmanuel Vadot TSENTER2(device_get_name(pinctrl)); 51*413d07eaSEmmanuel Vadot} 52*413d07eaSEmmanuel VadotEPILOG { 53*413d07eaSEmmanuel Vadot TSEXIT2(device_get_name(pinctrl)); 54*413d07eaSEmmanuel Vadot} 55b8ed20dbSIan LeporeMETHOD int configure { 56b8ed20dbSIan Lepore device_t pinctrl; 57b8ed20dbSIan Lepore phandle_t cfgxref; 58b8ed20dbSIan Lepore}; 59b8ed20dbSIan Lepore 60