blob: dfda9a3f2cb2885a6a4664577ee6036e7f360ffd [file] [log] [blame]
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001/*
2 * clock2430.c - OMAP2430-specific clock integration code
3 *
4 * Copyright (C) 2005-2008 Texas Instruments, Inc.
5 * Copyright (C) 2004-2010 Nokia Corporation
6 *
7 * Contacts:
8 * Richard Woodruff <r-woodruff2@ti.com>
9 * Paul Walmsley
10 *
11 * Based on earlier work by Tuukka Tikkanen, Tony Lindgren,
12 * Gordon McNutt and RidgeRun, Inc.
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17 */
18#undef DEBUG
19
20#include <linux/kernel.h>
21#include <linux/clk.h>
22#include <linux/io.h>
23
Tony Lindgren2c799ce2012-02-24 10:34:35 -080024#include <plat/hardware.h>
Paul Walmsley81b34fb2010-02-22 22:09:22 -070025#include <plat/clock.h>
26
Tony Lindgrenee0839c2012-02-24 10:34:35 -080027#include "iomap.h"
Paul Walmsley81b34fb2010-02-22 22:09:22 -070028#include "clock.h"
29#include "clock2xxx.h"
Paul Walmsley59fb6592010-12-21 15:30:55 -070030#include "cm2xxx_3xxx.h"
Paul Walmsley81b34fb2010-02-22 22:09:22 -070031#include "cm-regbits-24xx.h"
32
33/**
34 * omap2430_clk_i2chs_find_idlest - return CM_IDLEST info for 2430 I2CHS
35 * @clk: struct clk * being enabled
36 * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into
37 * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into
38 * @idlest_val: pointer to a u8 to store the CM_IDLEST indicator
39 *
40 * OMAP2430 I2CHS CM_IDLEST bits are in CM_IDLEST1_CORE, but the
41 * CM_*CLKEN bits are in CM_{I,F}CLKEN2_CORE. This custom function
42 * passes back the correct CM_IDLEST register address for I2CHS
43 * modules. No return value.
44 */
45static void omap2430_clk_i2chs_find_idlest(struct clk *clk,
46 void __iomem **idlest_reg,
47 u8 *idlest_bit,
48 u8 *idlest_val)
49{
50 *idlest_reg = OMAP2430_CM_REGADDR(CORE_MOD, CM_IDLEST);
51 *idlest_bit = clk->enable_bit;
52 *idlest_val = OMAP24XX_CM_IDLEST_VAL;
53}
54
55/* 2430 I2CHS has non-standard IDLEST register */
56const struct clkops clkops_omap2430_i2chs_wait = {
57 .enable = omap2_dflt_clk_enable,
58 .disable = omap2_dflt_clk_disable,
59 .find_idlest = omap2430_clk_i2chs_find_idlest,
60 .find_companion = omap2_clk_dflt_find_companion,
61};