1*70d99699Sbouyer /* $NetBSD: clk.h,v 1.3 2018/04/01 21:11:01 bouyer Exp $ */ 2bd0f8235Sjmcneill 3bd0f8235Sjmcneill /*- 4bd0f8235Sjmcneill * Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca> 5bd0f8235Sjmcneill * All rights reserved. 6bd0f8235Sjmcneill * 7bd0f8235Sjmcneill * Redistribution and use in source and binary forms, with or without 8bd0f8235Sjmcneill * modification, are permitted provided that the following conditions 9bd0f8235Sjmcneill * are met: 10bd0f8235Sjmcneill * 1. Redistributions of source code must retain the above copyright 11bd0f8235Sjmcneill * notice, this list of conditions and the following disclaimer. 12bd0f8235Sjmcneill * 2. Redistributions in binary form must reproduce the above copyright 13bd0f8235Sjmcneill * notice, this list of conditions and the following disclaimer in the 14bd0f8235Sjmcneill * documentation and/or other materials provided with the distribution. 15bd0f8235Sjmcneill * 16bd0f8235Sjmcneill * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17bd0f8235Sjmcneill * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18bd0f8235Sjmcneill * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19bd0f8235Sjmcneill * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20bd0f8235Sjmcneill * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21bd0f8235Sjmcneill * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22bd0f8235Sjmcneill * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 23bd0f8235Sjmcneill * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24bd0f8235Sjmcneill * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25bd0f8235Sjmcneill * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26bd0f8235Sjmcneill * SUCH DAMAGE. 27bd0f8235Sjmcneill */ 28bd0f8235Sjmcneill 29bd0f8235Sjmcneill #ifndef _DEV_CLK_CLK_H 30bd0f8235Sjmcneill #define _DEV_CLK_CLK_H 31bd0f8235Sjmcneill 32e69bfca1Sjmcneill struct clk_domain; 33bd0f8235Sjmcneill struct clk; 34bd0f8235Sjmcneill 35e69bfca1Sjmcneill struct clk * clk_get(struct clk_domain *, const char *); 36bd0f8235Sjmcneill void clk_put(struct clk *); 37bd0f8235Sjmcneill u_int clk_get_rate(struct clk *); 38bd0f8235Sjmcneill int clk_set_rate(struct clk *, u_int); 39*70d99699Sbouyer u_int clk_round_rate(struct clk *, u_int); 40bd0f8235Sjmcneill int clk_enable(struct clk *); 41bd0f8235Sjmcneill int clk_disable(struct clk *); 42bd0f8235Sjmcneill int clk_set_parent(struct clk *, struct clk *); 43bd0f8235Sjmcneill struct clk * clk_get_parent(struct clk *); 44bd0f8235Sjmcneill 45bd0f8235Sjmcneill #endif /* _DEV_CLK_CLK_H */ 46