Path: blob/master/arch/arm/mach-mxs/include/mach/clock.h
10820 views
/*1* Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.2* Copyright 2008 Juergen Beisert, [email protected]3*4* This program is free software; you can redistribute it and/or5* modify it under the terms of the GNU General Public License6* as published by the Free Software Foundation; either version 27* of the License, or (at your option) any later version.8* This program is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11* GNU General Public License for more details.12*13* You should have received a copy of the GNU General Public License14* along with this program; if not, write to the Free Software15* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,16* MA 02110-1301, USA.17*/1819#ifndef __MACH_MXS_CLOCK_H__20#define __MACH_MXS_CLOCK_H__2122#ifndef __ASSEMBLY__23#include <linux/list.h>2425struct module;2627struct clk {28int id;29/* Source clock this clk depends on */30struct clk *parent;31/* Reference count of clock enable/disable */32__s8 usecount;33/* Register bit position for clock's enable/disable control. */34u8 enable_shift;35/* Register address for clock's enable/disable control. */36void __iomem *enable_reg;37u32 flags;38/* get the current clock rate (always a fresh value) */39unsigned long (*get_rate) (struct clk *);40/* Function ptr to set the clock to a new rate. The rate must match a41supported rate returned from round_rate. Leave blank if clock is not42programmable */43int (*set_rate) (struct clk *, unsigned long);44/* Function ptr to round the requested clock rate to the nearest45supported rate that is less than or equal to the requested rate. */46unsigned long (*round_rate) (struct clk *, unsigned long);47/* Function ptr to enable the clock. Leave blank if clock can not48be gated. */49int (*enable) (struct clk *);50/* Function ptr to disable the clock. Leave blank if clock can not51be gated. */52void (*disable) (struct clk *);53/* Function ptr to set the parent clock of the clock. */54int (*set_parent) (struct clk *, struct clk *);55};5657int clk_register(struct clk *clk);58void clk_unregister(struct clk *clk);5960#endif /* __ASSEMBLY__ */61#endif /* __MACH_MXS_CLOCK_H__ */626364