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: 15499 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 9360D23E14 for ; Thu, 21 Mar 2013 16:00:54 +0000 (UTC) Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com [209.85.212.46]) by fiordland.canonical.com (Postfix) with ESMTP id 5BA28A19E83 for ; Thu, 21 Mar 2013 16:00:54 +0000 (UTC) Received: by mail-vb0-f46.google.com with SMTP id b13so2001776vby.5 for ; Thu, 21 Mar 2013 09:00:53 -0700 (PDT) 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=x70laH41iJORdSZ6UfL/8e5sGZ6DZnLcMBBwXKC3he8=; b=GHhb3KNBRShgh21n8sxA8HhjQ/mB4iDshQbsk1Uxm5cGkRrc+rJUHNZJindQtJ554W ThEI75aph/lCtEek+WvrhYKCrrIadpuV6XiC7vyWrrHgezB68GunC5rlGYXl9N5ZVHV6 iTxwa6WEXJl0dZr6SdXZYfoZ8O22ZzxhKlUGv3YhiStmx2EGPjG/+raVLCesXJMoMul5 8ltyPO+Gwt5Nu+MM2Nva84nvI1/BzxzS9BMwpkW2AvbF5GniOL/x9ImnpmD162rQAYHN y8mYmpjxaLsbVS3YawDHCQqYPIE2kiKWiWn9rTvtyd4VZWYInEvDIkPI1L3jg4PSEHuq wbeg== X-Received: by 10.52.31.103 with SMTP id z7mr12001127vdh.56.1363881653841; Thu, 21 Mar 2013 09:00:53 -0700 (PDT) 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.58.233.198 with SMTP id ty6csp66798vec; Thu, 21 Mar 2013 09:00:53 -0700 (PDT) X-Received: by 10.194.91.211 with SMTP id cg19mr18266268wjb.43.1363881652757; Thu, 21 Mar 2013 09:00:52 -0700 (PDT) Received: from mail-we0-x235.google.com ([2a00:1450:400c:c03::235]) by mx.google.com with ESMTPS id f4si1436768wiw.99.2013.03.21.09.00.52 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Mar 2013 09:00:52 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::235 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c03::235; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c03::235 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-we0-f181.google.com with SMTP id p43so2441515wea.26 for ; Thu, 21 Mar 2013 09:00:52 -0700 (PDT) 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 Cc: arnd@arndb.de, linus.walleij@stericsson.com, Michel JAOUEN , Lee Jones 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: ALoCoQmzcGurlB+StLwVvqgkDyfok+2Ua0rFTfzky911mZ5IkvFBLtYAHe7uwihRCiJV/Pft1w7n 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);