clock2430.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  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. #include <linux/kernel.h>
  20. #include <linux/clk.h>
  21. #include <linux/io.h>
  22. #include "soc.h"
  23. #include "iomap.h"
  24. #include "clock.h"
  25. #include "clock2xxx.h"
  26. #include "cm2xxx.h"
  27. #include "cm-regbits-24xx.h"
  28. /**
  29. * omap2430_clk_i2chs_find_idlest - return CM_IDLEST info for 2430 I2CHS
  30. * @clk: struct clk * being enabled
  31. * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into
  32. * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into
  33. * @idlest_val: pointer to a u8 to store the CM_IDLEST indicator
  34. *
  35. * OMAP2430 I2CHS CM_IDLEST bits are in CM_IDLEST1_CORE, but the
  36. * CM_*CLKEN bits are in CM_{I,F}CLKEN2_CORE. This custom function
  37. * passes back the correct CM_IDLEST register address for I2CHS
  38. * modules. No return value.
  39. */
  40. static void omap2430_clk_i2chs_find_idlest(struct clk_hw_omap *clk,
  41. void __iomem **idlest_reg,
  42. u8 *idlest_bit,
  43. u8 *idlest_val)
  44. {
  45. *idlest_reg = OMAP2430_CM_REGADDR(CORE_MOD, CM_IDLEST);
  46. *idlest_bit = clk->enable_bit;
  47. *idlest_val = OMAP24XX_CM_IDLEST_VAL;
  48. }
  49. /* 2430 I2CHS has non-standard IDLEST register */
  50. const struct clk_hw_omap_ops clkhwops_omap2430_i2chs_wait = {
  51. .find_idlest = omap2430_clk_i2chs_find_idlest,
  52. .find_companion = omap2_clk_dflt_find_companion,
  53. };