From patchwork Thu Mar 10 13:43:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 491 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:43:06 -0000 Delivered-To: patches@linaro.org Received: by 10.224.67.207 with SMTP id s15cs19834qai; Thu, 10 Mar 2011 05:44:10 -0800 (PST) Received: by 10.216.171.68 with SMTP id q46mr2464236wel.98.1299764649905; Thu, 10 Mar 2011 05:44:09 -0800 (PST) Received: from eu1sys200aog119.obsmtp.com (eu1sys200aog119.obsmtp.com [207.126.144.147]) by mx.google.com with SMTP id t5si5583597wes.109.2011.03.10.05.44.04 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 10 Mar 2011 05:44:09 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.147 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.147; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.147 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from source ([138.198.100.35]) (using TLSv1) by eu1sys200aob119.postini.com ([207.126.147.11]) with SMTP ID DSNKTXjVow7GLRy1Iq/ioj2b6Thu1sF6V1Qb@postini.com; Thu, 10 Mar 2011 13:44:09 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id E18261C7; Thu, 10 Mar 2011 13:43:46 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 9289075F; Thu, 10 Mar 2011 13:43:46 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 63E5124C2E7; Thu, 10 Mar 2011 14:43:39 +0100 (CET) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.2.254.0; Thu, 10 Mar 2011 14:43:45 +0100 From: Linus Walleij To: Liam Girdwood , Mark Brown , Cc: Lee Jones , Bengt Jonsson , Linus Walleij Subject: [PATCH 2/4] regulator: add ab8500 per-regulator startup delay Date: Thu, 10 Mar 2011 14:43:41 +0100 Message-ID: <1299764621-2532-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.3.2 MIME-Version: 1.0 From: Bengt Jonsson Since some regulators can take some time to come online, we define a per-regulator millisecond delay value and assign to the slow TV-out regulator. Signed-off-by: Bengt Jonsson Signed-off-by: Linus Walleij --- drivers/regulator/ab8500.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index 5a77630..4e11980 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -38,6 +39,7 @@ * @voltage_mask: mask to control regulator voltage * @voltages: supported voltage table * @voltages_len: number of supported voltages for the regulator + * @delay: startup delay in ms */ struct ab8500_regulator_info { struct device *dev; @@ -55,6 +57,7 @@ struct ab8500_regulator_info { u8 voltage_mask; int const *voltages; int voltages_len; + unsigned int delay; }; /* voltage tables for the vauxn/vintcore supplies */ @@ -115,6 +118,8 @@ static int ab8500_regulator_enable(struct regulator_dev *rdev) dev_err(rdev_get_dev(rdev), "couldn't set enable bits for regulator\n"); + msleep(info->delay); + dev_vdbg(rdev_get_dev(rdev), "%s-enable (bank, reg, mask, value): 0x%x, 0x%x, 0x%x, 0x%x\n", info->desc.name, info->update_bank, info->update_reg, @@ -140,6 +145,8 @@ static int ab8500_regulator_disable(struct regulator_dev *rdev) dev_err(rdev_get_dev(rdev), "couldn't set disable bits for regulator\n"); + msleep(info->delay); + dev_vdbg(rdev_get_dev(rdev), "%s-disable (bank, reg, mask, value): 0x%x, 0x%x, 0x%x, 0x%x\n", info->desc.name, info->update_bank, info->update_reg, @@ -281,6 +288,8 @@ static int ab8500_regulator_set_voltage(struct regulator_dev *rdev, dev_err(rdev_get_dev(rdev), "couldn't set voltage reg for regulator\n"); + msleep(info->delay); + dev_vdbg(rdev_get_dev(rdev), "%s-set_voltage (bank, reg, mask, value): 0x%x, 0x%x, 0x%x," " 0x%x\n", @@ -426,6 +435,7 @@ static struct ab8500_regulator_info .owner = THIS_MODULE, .n_voltages = 1, }, + .delay = 10, .fixed_uV = 2000000, .update_bank = 0x03, .update_reg = 0x80,