diff options
author | Tony Lindgren <tony@atomide.com> | 2012-11-30 08:40:31 -0800 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-11-30 08:40:31 -0800 |
commit | 2589d056122f6dcb405d411eae872aac8cf9da1b (patch) | |
tree | 8b2fb3a9f8205c110842c59ed42987a6f2b17e1a /drivers | |
parent | 42a1cc9c0ec2a00b53b4f02849dc4377b09b3b05 (diff) | |
parent | 8b9c1ac2e11a9fb3a5a8860fb7570ff7633aa7f7 (diff) |
Merge tag 'tags/omap-for-v3.8/devel-prcm-signed' into omap-for-v3.8/cleanup-headers-prepare-multiplatform-v3
omap prcm changes via Paul Walmsley <paul@pwsan.com>:
Some miscellaneous OMAP hwmod changes for 3.8, along with a PRM
change needed for one of the hwmod patches to function.
Basic test logs for this branch on top of Tony's
omap-for-v3.8/clock branch at commit
558a0780b0a04862a678f7823215424b4e5501f9 are here:
http://www.pwsan.com/omap/testlogs/hwmod_devel_a_3.8/20121121161522/
However, omap-for-v3.8/clock at 558a0780 does not include some fixes
that are needed for a successful test. With several reverts,
fixes, and workarounds applied, the following test logs were
obtained:
http://www.pwsan.com/omap/testlogs/TEST_hwmod_devel_a_3.8/20121121162719/
which indicate that the series tests cleanly.
Conflicts:
arch/arm/mach-omap2/cm33xx.c
arch/arm/mach-omap2/io.c
arch/arm/mach-omap2/prm_common.c
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/power/avs/smartreflex.c | 54 | ||||
-rw-r--r-- | drivers/watchdog/omap_wdt.c | 26 |
2 files changed, 29 insertions, 51 deletions
diff --git a/drivers/power/avs/smartreflex.c b/drivers/power/avs/smartreflex.c index 24768a27e1d..4c4519e59be 100644 --- a/drivers/power/avs/smartreflex.c +++ b/drivers/power/avs/smartreflex.c @@ -130,24 +130,21 @@ static irqreturn_t sr_interrupt(int irq, void *data) static void sr_set_clk_length(struct omap_sr *sr) { - struct clk *sys_ck; - u32 sys_clk_speed; + struct clk *fck; + u32 fclk_speed; - if (cpu_is_omap34xx()) - sys_ck = clk_get(NULL, "sys_ck"); - else - sys_ck = clk_get(NULL, "sys_clkin_ck"); + fck = clk_get(&sr->pdev->dev, "fck"); - if (IS_ERR(sys_ck)) { - dev_err(&sr->pdev->dev, "%s: unable to get sys clk\n", - __func__); + if (IS_ERR(fck)) { + dev_err(&sr->pdev->dev, "%s: unable to get fck for device %s\n", + __func__, dev_name(&sr->pdev->dev)); return; } - sys_clk_speed = clk_get_rate(sys_ck); - clk_put(sys_ck); + fclk_speed = clk_get_rate(fck); + clk_put(fck); - switch (sys_clk_speed) { + switch (fclk_speed) { case 12000000: sr->clk_length = SRCLKLENGTH_12MHZ_SYSCLK; break; @@ -164,34 +161,12 @@ static void sr_set_clk_length(struct omap_sr *sr) sr->clk_length = SRCLKLENGTH_38MHZ_SYSCLK; break; default: - dev_err(&sr->pdev->dev, "%s: Invalid sysclk value: %d\n", - __func__, sys_clk_speed); + dev_err(&sr->pdev->dev, "%s: Invalid fclk rate: %d\n", + __func__, fclk_speed); break; } } -static void sr_set_regfields(struct omap_sr *sr) -{ - /* - * For time being these values are defined in smartreflex.h - * and populated during init. May be they can be moved to board - * file or pmic specific data structure. In that case these structure - * fields will have to be populated using the pdata or pmic structure. - */ - if (cpu_is_omap34xx() || cpu_is_omap44xx()) { - sr->err_weight = OMAP3430_SR_ERRWEIGHT; - sr->err_maxlimit = OMAP3430_SR_ERRMAXLIMIT; - sr->accum_data = OMAP3430_SR_ACCUMDATA; - if (!(strcmp(sr->name, "smartreflex_mpu_iva"))) { - sr->senn_avgweight = OMAP3430_SR1_SENNAVGWEIGHT; - sr->senp_avgweight = OMAP3430_SR1_SENPAVGWEIGHT; - } else { - sr->senn_avgweight = OMAP3430_SR2_SENNAVGWEIGHT; - sr->senp_avgweight = OMAP3430_SR2_SENPAVGWEIGHT; - } - } -} - static void sr_start_vddautocomp(struct omap_sr *sr) { if (!sr_class || !(sr_class->enable) || !(sr_class->configure)) { @@ -924,8 +899,14 @@ static int __init omap_sr_probe(struct platform_device *pdev) sr_info->nvalue_count = pdata->nvalue_count; sr_info->senn_mod = pdata->senn_mod; sr_info->senp_mod = pdata->senp_mod; + sr_info->err_weight = pdata->err_weight; + sr_info->err_maxlimit = pdata->err_maxlimit; + sr_info->accum_data = pdata->accum_data; + sr_info->senn_avgweight = pdata->senn_avgweight; + sr_info->senp_avgweight = pdata->senp_avgweight; sr_info->autocomp_active = false; sr_info->ip_type = pdata->ip_type; + sr_info->base = ioremap(mem->start, resource_size(mem)); if (!sr_info->base) { dev_err(&pdev->dev, "%s: ioremap fail\n", __func__); @@ -937,7 +918,6 @@ static int __init omap_sr_probe(struct platform_device *pdev) sr_info->irq = irq->start; sr_set_clk_length(sr_info); - sr_set_regfields(sr_info); list_add(&sr_info->node, &sr_list); diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index f5db18dbc0f..477a1d47a64 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c @@ -46,8 +46,8 @@ #include <linux/slab.h> #include <linux/pm_runtime.h> #include <mach/hardware.h> -#include <plat/cpu.h> -#include <plat/prcm.h> + +#include <linux/platform_data/omap-wd-timer.h> #include "omap_wdt.h" @@ -202,8 +202,10 @@ static ssize_t omap_wdt_write(struct file *file, const char __user *data, static long omap_wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { + struct omap_wd_timer_platform_data *pdata; struct omap_wdt_dev *wdev; - int new_margin; + u32 rs; + int new_margin, bs; static const struct watchdog_info ident = { .identity = "OMAP Watchdog", .options = WDIOF_SETTIMEOUT, @@ -211,6 +213,7 @@ static long omap_wdt_ioctl(struct file *file, unsigned int cmd, }; wdev = file->private_data; + pdata = wdev->dev->platform_data; switch (cmd) { case WDIOC_GETSUPPORT: @@ -219,17 +222,12 @@ static long omap_wdt_ioctl(struct file *file, unsigned int cmd, case WDIOC_GETSTATUS: return put_user(0, (int __user *)arg); case WDIOC_GETBOOTSTATUS: -#ifdef CONFIG_ARCH_OMAP1 - if (cpu_is_omap16xx()) - return put_user(__raw_readw(ARM_SYSST), - (int __user *)arg); -#endif -#ifdef CONFIG_ARCH_OMAP2PLUS - if (cpu_is_omap24xx()) - return put_user(omap_prcm_get_reset_sources(), - (int __user *)arg); -#endif - return put_user(0, (int __user *)arg); + if (!pdata || !pdata->read_reset_sources) + return put_user(0, (int __user *)arg); + rs = pdata->read_reset_sources(); + bs = (rs & (1 << OMAP_MPU_WD_RST_SRC_ID_SHIFT)) ? + WDIOF_CARDRESET : 0; + return put_user(bs, (int __user *)arg); case WDIOC_KEEPALIVE: spin_lock(&wdt_lock); omap_wdt_ping(wdev); |