From patchwork Fri Feb 15 12:57:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14913 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 098AF23E01 for ; Fri, 15 Feb 2013 12:58:21 +0000 (UTC) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by fiordland.canonical.com (Postfix) with ESMTP id A0365A1870B for ; Fri, 15 Feb 2013 12:58:20 +0000 (UTC) Received: by mail-ve0-f182.google.com with SMTP id ox1so3019229veb.27 for ; Fri, 15 Feb 2013 04:58:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=Eq2mV1hoNSNubq5rSmGrqmntVMLjzPoxTu9dB5YZhXM=; b=RtLqDufgJfnK3ceyMPct4YRI9VrpuojjSKaV7bUoB9SmvUKAr1RVIX2t5McDkzYjVx fyHbJHwDze0bsC3/GXvQ5KBp3ZUV2raU+d+p/3nWwejsSP0Hv5f4zQZ9zNbO9uBcyFVx uGeRPMGcyRU1K7ZMymgJFURcMNF9RCYNuKplgFff78cQHS96MAuljknYaBiO7ENObo7T tVj9Ypo18lYTBZ7tOfoOZo0poQc+DsWHLuS3P8vYjA2RlY103Ejxjz6uh1XvMoO2bTaq xAMmIwCmM1pO2+c7e2fX4zRH+dtXdgtmOE9xyfHjzzCM+qOPKHM9Jg4nKuIPP8znCX0m FiBw== X-Received: by 10.52.69.74 with SMTP id c10mr2662449vdu.3.1360933100057; Fri, 15 Feb 2013 04:58:20 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.221.4.5 with SMTP id oa5csp11429vcb; Fri, 15 Feb 2013 04:58:19 -0800 (PST) X-Received: by 10.180.97.197 with SMTP id ec5mr5872277wib.1.1360933099091; Fri, 15 Feb 2013 04:58:19 -0800 (PST) Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]) by mx.google.com with ESMTPS id hz7si10066591wjb.58.2013.02.15.04.58.18 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:58:19 -0800 (PST) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::229 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::229; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c05::229 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-wi0-f169.google.com with SMTP id l13so1289735wie.4 for ; Fri, 15 Feb 2013 04:58:18 -0800 (PST) X-Received: by 10.194.9.166 with SMTP id a6mr4191622wjb.2.1360933098568; Fri, 15 Feb 2013 04:58:18 -0800 (PST) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPS id j4sm2852410wiz.10.2013.02.15.04.58.16 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:58:17 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, sameo@linux.intel.com Cc: arnd@arndb.de, linus.walleij@stericsson.com, Mattias Wallin , Lee Jones Subject: [PATCH 29/35] mfd: ab8500-core: Show turn on status at boot Date: Fri, 15 Feb 2013 12:57:00 +0000 Message-Id: <1360933026-30325-30-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360933026-30325-1-git-send-email-lee.jones@linaro.org> References: <1360933026-30325-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQlhrmCIXIOzjIPPJoUrOSuwJCsoJV1L6LlZYqUJO+tSADACPFH1Fj2JW2ymq+n8cY1Drahe From: Mattias Wallin Several states can be detected when a device is initially turned on. This patch displays these states in the log. If none of the states are true, then we report that too. Signed-off-by: Mattias Wallin Signed-off-by: Lee Jones Reviewed-by: Marcus COOPER Reviewed-by: Jonas ABERG --- drivers/mfd/ab8500-core.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index 17187c3..153e71e 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c @@ -1502,6 +1502,15 @@ static int ab8500_probe(struct platform_device *pdev) "Battery level lower than power on reset threshold", "Power on key 1 pressed longer than 10 seconds", "DB8500 thermal shutdown"}; + static char *turn_on_status[] = { + "Battery rising (Vbat)", + "Power On Key 1 dbF", + "Power On Key 2 dbF", + "RTC Alarm", + "Main Charger Detect", + "Vbus Detect (USB)", + "USB ID Detect", + "UART Factory Mode Detect"}; struct ab8500_platform_data *plat = dev_get_platdata(&pdev->dev); const struct platform_device_id *platid = platform_get_device_id(pdev); enum ab8500_version version = AB8500_VERSION_UNDEFINED; @@ -1615,9 +1624,26 @@ static int ab8500_probe(struct platform_device *pdev) } else { printk(KERN_CONT " None\n"); } + ret = get_register_interruptible(ab8500, AB8500_SYS_CTRL1_BLOCK, + AB8500_TURN_ON_STATUS, &value); + if (ret < 0) + return ret; + dev_info(ab8500->dev, "turn on reason(s) (%#x): ", value); + + if (value) { + for (i = 0; i < ARRAY_SIZE(turn_on_status); i++) { + if (value & 1) + printk("\"%s\" ", turn_on_status[i]); + value = value >> 1; + } + printk("\n"); + } else { + printk("None\n"); + } if (plat && plat->init) plat->init(ab8500); + if (is_ab9540(ab8500)) { ret = get_register_interruptible(ab8500, AB8500_CHARGER, AB8500_CH_USBCH_STAT1_REG, &value);