0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include <linux/kernel.h>
0013 #include <linux/init.h>
0014 #include <linux/err.h>
0015 #include <linux/platform_device.h>
0016
0017 #include "soc.h"
0018 #include "omap_hwmod.h"
0019 #include "omap_device.h"
0020 #include "hdq1w.h"
0021
0022 #include "prm.h"
0023 #include "common.h"
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 int omap_hdq1w_reset(struct omap_hwmod *oh)
0038 {
0039 u32 v;
0040 int c = 0;
0041
0042
0043 omap_hwmod_softreset(oh);
0044
0045
0046 v = omap_hwmod_read(oh, HDQ_CTRL_STATUS_OFFSET);
0047 v |= 1 << HDQ_CTRL_STATUS_CLOCKENABLE_SHIFT;
0048 omap_hwmod_write(v, oh, HDQ_CTRL_STATUS_OFFSET);
0049
0050
0051 omap_test_timeout((omap_hwmod_read(oh,
0052 oh->class->sysc->syss_offs)
0053 & SYSS_RESETDONE_MASK),
0054 MAX_MODULE_SOFTRESET_WAIT, c);
0055
0056 if (c == MAX_MODULE_SOFTRESET_WAIT)
0057 pr_warn("%s: %s: softreset failed (waited %d usec)\n",
0058 __func__, oh->name, MAX_MODULE_SOFTRESET_WAIT);
0059 else
0060 pr_debug("%s: %s: softreset in %d usec\n", __func__,
0061 oh->name, c);
0062
0063 return 0;
0064 }