fdt_clock.h revision 270957
11590Srgrimes/*- 21590Srgrimes * Copyright (c) 2014 Ian Lepore <ian@freebsd.org> 31590Srgrimes * All rights reserved. 41590Srgrimes * 51590Srgrimes * Redistribution and use in source and binary forms, with or without 61590Srgrimes * modification, are permitted provided that the following conditions 71590Srgrimes * are met: 81590Srgrimes * 1. Redistributions of source code must retain the above copyright 91590Srgrimes * notice, this list of conditions and the following disclaimer. 101590Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 111590Srgrimes * notice, this list of conditions and the following disclaimer in the 121590Srgrimes * documentation and/or other materials provided with the distribution. 131590Srgrimes * 141590Srgrimes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 151590Srgrimes * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 161590Srgrimes * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 171590Srgrimes * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 181590Srgrimes * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 191590Srgrimes * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 201590Srgrimes * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 211590Srgrimes * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 221590Srgrimes * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 231590Srgrimes * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 241590Srgrimes * 251590Srgrimes * $FreeBSD: head/sys/dev/fdt/fdt_clock.h 270957 2014-09-02 03:23:05Z ian $ 261590Srgrimes */ 271590Srgrimes 281590Srgrimes#ifndef DEV_FDT_CLOCK_H 291590Srgrimes#define DEV_FDT_CLOCK_H 301590Srgrimes 311590Srgrimes#include "fdt_clock_if.h" 321590Srgrimes 331590Srgrimes/* 341590Srgrimes * Get info about the Nth clock listed in consumer's "clocks" property. 351590Srgrimes * 361590Srgrimes * Returns 0 on success, ENXIO if clock #n not found. 3787628Sdwmalone */ 3887628Sdwmaloneint fdt_clock_get_info(device_t consumer, int n, struct fdt_clock_info *info); 3987628Sdwmalone 4087628Sdwmalone/* 4187628Sdwmalone * Look up "clocks" property in consumer's fdt data and enable or disable all 4287628Sdwmalone * configured clocks. 4387229Smarkm */ 4487229Smarkmint fdt_clock_enable_all(device_t consumer); 4587229Smarkmint fdt_clock_disable_all(device_t consumer); 461590Srgrimes 4723693Speter/* 4874586Sache * [Un]register the given device instance as a driver that implements the 491590Srgrimes * fdt_clock interface. 501590Srgrimes */ 511590Srgrimesvoid fdt_clock_register_provider(device_t provider); 5272109Scharniervoid fdt_clock_unregister_provider(device_t provider); 5372109Scharnier 541590Srgrimes#endif /* DEV_FDT_CLOCK_H */ 551590Srgrimes 561590Srgrimes