diff options
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 88 |
1 files changed, 5 insertions, 83 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 61d220c5d48..bfbd34142b3 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -592,6 +592,11 @@ static void _sysc_enable(struct omap_hwmod *oh) | |||
592 | 592 | ||
593 | /* XXX OCP ENAWAKEUP bit? */ | 593 | /* XXX OCP ENAWAKEUP bit? */ |
594 | 594 | ||
595 | /* | ||
596 | * XXX The clock framework should handle this, by | ||
597 | * calling into this code. But this must wait until the | ||
598 | * clock structures are tagged with omap_hwmod entries | ||
599 | */ | ||
595 | if (oh->flags & HWMOD_SET_DEFAULT_CLOCKACT && | 600 | if (oh->flags & HWMOD_SET_DEFAULT_CLOCKACT && |
596 | oh->sysconfig->sysc_flags & SYSC_HAS_CLOCKACTIVITY) | 601 | oh->sysconfig->sysc_flags & SYSC_HAS_CLOCKACTIVITY) |
597 | _set_clockactivity(oh, oh->sysconfig->clockact, &v); | 602 | _set_clockactivity(oh, oh->sysconfig->clockact, &v); |
@@ -914,33 +919,6 @@ static int _shutdown(struct omap_hwmod *oh) | |||
914 | } | 919 | } |
915 | 920 | ||
916 | /** | 921 | /** |
917 | * _write_clockact_lock - set the module's clockactivity bits | ||
918 | * @oh: struct omap_hwmod * | ||
919 | * @clockact: CLOCKACTIVITY field bits | ||
920 | * | ||
921 | * Writes the CLOCKACTIVITY bits @clockact to the hwmod @oh | ||
922 | * OCP_SYSCONFIG register. Returns -EINVAL if the hwmod is in the | ||
923 | * wrong state or returns 0. | ||
924 | */ | ||
925 | static int _write_clockact_lock(struct omap_hwmod *oh, u8 clockact) | ||
926 | { | ||
927 | u32 v; | ||
928 | |||
929 | if (!oh->sysconfig || | ||
930 | !(oh->sysconfig->sysc_flags & SYSC_HAS_CLOCKACTIVITY)) | ||
931 | return -EINVAL; | ||
932 | |||
933 | mutex_lock(&omap_hwmod_mutex); | ||
934 | v = oh->_sysc_cache; | ||
935 | _set_clockactivity(oh, clockact, &v); | ||
936 | _write_sysconfig(v, oh); | ||
937 | mutex_unlock(&omap_hwmod_mutex); | ||
938 | |||
939 | return 0; | ||
940 | } | ||
941 | |||
942 | |||
943 | /** | ||
944 | * _setup - do initial configuration of omap_hwmod | 922 | * _setup - do initial configuration of omap_hwmod |
945 | * @oh: struct omap_hwmod * | 923 | * @oh: struct omap_hwmod * |
946 | * | 924 | * |
@@ -1493,62 +1471,6 @@ int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh, | |||
1493 | } | 1471 | } |
1494 | 1472 | ||
1495 | /** | 1473 | /** |
1496 | * omap_hwmod_set_clockact_none - set clockactivity test to BOTH | ||
1497 | * @oh: struct omap_hwmod * | ||
1498 | * | ||
1499 | * On some modules, this function can affect the wakeup latency vs. | ||
1500 | * power consumption balance. Intended to be called by the | ||
1501 | * omap_device layer. Passes along the return value from | ||
1502 | * _write_clockact_lock(). | ||
1503 | */ | ||
1504 | int omap_hwmod_set_clockact_both(struct omap_hwmod *oh) | ||
1505 | { | ||
1506 | return _write_clockact_lock(oh, CLOCKACT_TEST_BOTH); | ||
1507 | } | ||
1508 | |||
1509 | /** | ||
1510 | * omap_hwmod_set_clockact_none - set clockactivity test to MAIN | ||
1511 | * @oh: struct omap_hwmod * | ||
1512 | * | ||
1513 | * On some modules, this function can affect the wakeup latency vs. | ||
1514 | * power consumption balance. Intended to be called by the | ||
1515 | * omap_device layer. Passes along the return value from | ||
1516 | * _write_clockact_lock(). | ||
1517 | */ | ||
1518 | int omap_hwmod_set_clockact_main(struct omap_hwmod *oh) | ||
1519 | { | ||
1520 | return _write_clockact_lock(oh, CLOCKACT_TEST_MAIN); | ||
1521 | } | ||
1522 | |||
1523 | /** | ||
1524 | * omap_hwmod_set_clockact_none - set clockactivity test to ICLK | ||
1525 | * @oh: struct omap_hwmod * | ||
1526 | * | ||
1527 | * On some modules, this function can affect the wakeup latency vs. | ||
1528 | * power consumption balance. Intended to be called by the | ||
1529 | * omap_device layer. Passes along the return value from | ||
1530 | * _write_clockact_lock(). | ||
1531 | */ | ||
1532 | int omap_hwmod_set_clockact_iclk(struct omap_hwmod *oh) | ||
1533 | { | ||
1534 | return _write_clockact_lock(oh, CLOCKACT_TEST_ICLK); | ||
1535 | } | ||
1536 | |||
1537 | /** | ||
1538 | * omap_hwmod_set_clockact_none - set clockactivity test to NONE | ||
1539 | * @oh: struct omap_hwmod * | ||
1540 | * | ||
1541 | * On some modules, this function can affect the wakeup latency vs. | ||
1542 | * power consumption balance. Intended to be called by the | ||
1543 | * omap_device layer. Passes along the return value from | ||
1544 | * _write_clockact_lock(). | ||
1545 | */ | ||
1546 | int omap_hwmod_set_clockact_none(struct omap_hwmod *oh) | ||
1547 | { | ||
1548 | return _write_clockact_lock(oh, CLOCKACT_TEST_NONE); | ||
1549 | } | ||
1550 | |||
1551 | /** | ||
1552 | * omap_hwmod_enable_wakeup - allow device to wake up the system | 1474 | * omap_hwmod_enable_wakeup - allow device to wake up the system |
1553 | * @oh: struct omap_hwmod * | 1475 | * @oh: struct omap_hwmod * |
1554 | * | 1476 | * |