blob: 95a85f26f23846bf92c23b2d9986a49abeac3f40 [file] [log] [blame]
Pratik Patele08204d2013-03-12 17:43:56 -07001/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
Pushkar Joshi0fc73462012-09-26 17:59:31 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
Pushkar Joshi0fc73462012-09-26 17:59:31 -070013#include <linux/kernel.h>
Pratik Patele08204d2013-03-12 17:43:56 -070014#include <linux/module.h>
Pushkar Joshi0fc73462012-09-26 17:59:31 -070015#include <mach/scm.h>
Pushkar Joshi0fc73462012-09-26 17:59:31 -070016
Pratik Patele08204d2013-03-12 17:43:56 -070017#define SCM_WDOG_DEBUG_BOOT_PART 0x9
18#define BOOT_PART_EN_VAL 0x5D1
Pushkar Joshi0fc73462012-09-26 17:59:31 -070019
20void msm_enable_wdog_debug(void)
21{
Pratik Patele08204d2013-03-12 17:43:56 -070022 int ret;
Pushkar Joshi0fc73462012-09-26 17:59:31 -070023
Pratik Patele08204d2013-03-12 17:43:56 -070024 ret = scm_call_atomic2(SCM_SVC_BOOT,
25 SCM_WDOG_DEBUG_BOOT_PART, 0, BOOT_PART_EN_VAL);
26 if (ret)
Syed Rameez Mustafa41bb9ee2013-04-12 14:45:13 -070027 pr_err("failed to enable wdog debug: %d\n", ret);
Pushkar Joshi0fc73462012-09-26 17:59:31 -070028}
29EXPORT_SYMBOL(msm_enable_wdog_debug);
30
Pratik Patele08204d2013-03-12 17:43:56 -070031void msm_disable_wdog_debug(void)
Pushkar Joshi0fc73462012-09-26 17:59:31 -070032{
33 int ret;
Pratik Patele08204d2013-03-12 17:43:56 -070034
35 ret = scm_call_atomic2(SCM_SVC_BOOT,
36 SCM_WDOG_DEBUG_BOOT_PART, 1, 0);
Pushkar Joshi0fc73462012-09-26 17:59:31 -070037 if (ret)
Syed Rameez Mustafa41bb9ee2013-04-12 14:45:13 -070038 pr_err("failed to disable wdog debug: %d\n", ret);
Pushkar Joshi0fc73462012-09-26 17:59:31 -070039}
Pratik Patele08204d2013-03-12 17:43:56 -070040EXPORT_SYMBOL(msm_disable_wdog_debug);