From patchwork Thu Mar 21 15:59:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 2314851 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 4826B400E6 for ; Thu, 21 Mar 2013 16:23:54 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UIiEH-0003Qw-VB; Thu, 21 Mar 2013 16:20:38 +0000 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UIhvE-0001Ih-8p for linux-arm-kernel@lists.infradead.org; Thu, 21 Mar 2013 16:01:00 +0000 Received: by mail-wi0-f181.google.com with SMTP id hm6so3274701wib.14 for ; Thu, 21 Mar 2013 09:00:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=x70laH41iJORdSZ6UfL/8e5sGZ6DZnLcMBBwXKC3he8=; b=WrAUbcrNCRdaRKu4LNyt2CEUKzdFtNGaJoTY4xgDbIn8uwBLw0/qk925+SN7lZVI+M g2T8ov016fSziDWyXezliBMTh14I1o817I8lJttHNjyMpizouLRBfdZ668E8eMWXrhHu P9xb5A/eaWOj0xlPL8P5nM+D87LkOJzNQXDsXde3gLIj+xNTIVwmj/JqZhd6+MMDtb8m AfDz3E+XuJ8+LHemOUahp3EuFbJh01C2EX/yd5MRS6aYjPQStoZqTE0spSZfKUJqF3V0 Q/GeyJTWpqY9FT1zx1exr5bUtnHDAtZaO0TSRMz/+0UKfnyl0CK3cTKeD+fbAmN7gCCw 0XHA== X-Received: by 10.180.185.239 with SMTP id ff15mr5996607wic.2.1363881652244; Thu, 21 Mar 2013 09:00:52 -0700 (PDT) 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 h10sm6110847wic.8.2013.03.21.09.00.50 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Mar 2013 09:00:51 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, broonie@opensource.wolfsonmicro.com Subject: [PATCH 25/46] regulator: ab8500-ext: Add support for AB9540 regulators Date: Thu, 21 Mar 2013 15:59:22 +0000 Message-Id: <1363881583-15234-26-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1363881583-15234-1-git-send-email-lee.jones@linaro.org> References: <1363881583-15234-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQlopks9AESpkujSUBoWpaiH54HdfWkaU9LY0wT6Hyta1VYPptyhAdseSw0XWP5Wok9YZMS/ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130321_120057_009603_7A9AFE32 X-CRM114-Status: GOOD ( 11.80 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Lee Jones , Michel JAOUEN , linus.walleij@stericsson.com, arnd@arndb.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Michel JAOUEN Add the support for ab9540 external regulators. Signed-off-by: Michel JAOUEN Signed-off-by: Lee Jones Reviewed-by: Jonas ABERG --- drivers/regulator/ab8500-ext.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/regulator/ab8500-ext.c b/drivers/regulator/ab8500-ext.c index f3ec867..e5e6453 100644 --- a/drivers/regulator/ab8500-ext.c +++ b/drivers/regulator/ab8500-ext.c @@ -298,6 +298,16 @@ static struct regulator_ops ab8500_ext_regulator_ops = { .list_voltage = ab8500_ext_list_voltage, }; +static struct regulator_ops ab9540_ext_regulator_ops = { + .enable = ab8500_ext_regulator_enable, + .disable = ab8500_ext_regulator_disable, + .is_enabled = ab8500_ext_regulator_is_enabled, + .set_mode = ab8500_ext_regulator_set_mode, + .get_mode = ab8500_ext_regulator_get_mode, + .get_voltage = ab8500_ext_fixed_get_voltage, + .list_voltage = ab8500_ext_list_voltage, +}; + static struct ab8500_ext_regulator_info ab8500_ext_regulator_info[AB8500_NUM_EXT_REGULATORS] = { [AB8500_EXT_SUPPLY1] = { @@ -406,6 +416,20 @@ int ab8500_ext_regulator_init(struct platform_device *pdev) info->cfg = (struct ab8500_ext_regulator_cfg *) pdata->ext_regulator[i].driver_data; + if (is_ab9540(ab8500)) { + if (info->desc.id == AB8500_EXT_SUPPLY1) { + info->desc.ops = &ab9540_ext_regulator_ops; + info->fixed_uV = 4500000; + } + if (info->desc.id == AB8500_EXT_SUPPLY2) + info->desc.ops = &ab9540_ext_regulator_ops; + + if (info->desc.id == AB8500_EXT_SUPPLY3) { + info->desc.ops = &ab9540_ext_regulator_ops; + info->fixed_uV = 3300000; + } + } + /* register regulator with framework */ info->rdev = regulator_register(&info->desc, &pdev->dev, &pdata->ext_regulator[i], info, NULL);