1270957Sian/*- 2270957Sian * Copyright (c) 2014 Ian Lepore <ian@freebsd.org> 3270957Sian * All rights reserved. 4270957Sian * 5270957Sian * Redistribution and use in source and binary forms, with or without 6270957Sian * modification, are permitted provided that the following conditions 7270957Sian * are met: 8270957Sian * 1. Redistributions of source code must retain the above copyright 9270957Sian * notice, this list of conditions and the following disclaimer. 10270957Sian * 2. Redistributions in binary form must reproduce the above copyright 11270957Sian * notice, this list of conditions and the following disclaimer in the 12270957Sian * documentation and/or other materials provided with the distribution. 13270957Sian * 14270957Sian * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15270957Sian * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16270957Sian * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17270957Sian * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18270957Sian * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19270957Sian * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20270957Sian * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21270957Sian * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22270957Sian * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23270957Sian * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24270957Sian * 25270957Sian * $FreeBSD: releng/11.0/sys/dev/fdt/fdt_clock.h 270957 2014-09-02 03:23:05Z ian $ 26270957Sian */ 27270957Sian 28270957Sian#ifndef DEV_FDT_CLOCK_H 29270957Sian#define DEV_FDT_CLOCK_H 30270957Sian 31270957Sian#include "fdt_clock_if.h" 32270957Sian 33270957Sian/* 34270957Sian * Get info about the Nth clock listed in consumer's "clocks" property. 35270957Sian * 36270957Sian * Returns 0 on success, ENXIO if clock #n not found. 37270957Sian */ 38270957Sianint fdt_clock_get_info(device_t consumer, int n, struct fdt_clock_info *info); 39270957Sian 40270957Sian/* 41270957Sian * Look up "clocks" property in consumer's fdt data and enable or disable all 42270957Sian * configured clocks. 43270957Sian */ 44270957Sianint fdt_clock_enable_all(device_t consumer); 45270957Sianint fdt_clock_disable_all(device_t consumer); 46270957Sian 47270957Sian/* 48270957Sian * [Un]register the given device instance as a driver that implements the 49270957Sian * fdt_clock interface. 50270957Sian */ 51270957Sianvoid fdt_clock_register_provider(device_t provider); 52270957Sianvoid fdt_clock_unregister_provider(device_t provider); 53270957Sian 54270957Sian#endif /* DEV_FDT_CLOCK_H */ 55270957Sian 56