From patchwork Wed Feb 6 10:53:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14606 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 8A29A2423C for ; Wed, 6 Feb 2013 10:55:31 +0000 (UTC) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by fiordland.canonical.com (Postfix) with ESMTP id 30A4DA18BDC for ; Wed, 6 Feb 2013 10:55:31 +0000 (UTC) Received: by mail-vc0-f178.google.com with SMTP id m8so739611vcd.37 for ; Wed, 06 Feb 2013 02:55:30 -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=5SMnAE7bCrD+hr2ieNJuLGTDAVgZkFz+ssjS+FvkxOw=; b=Wwfmypqb/wbwgCriI+tlt8FhLBw10l4WDTd6TL6N34Ny82AZVCO3jXmgGt8/XjEO+k mT7DcDDlloBf2em1+QHKC6bgzu7Dwa1nT+FioJxyAj1qkrCQaeDq1MgjnE6APT4Pqjtn 7v7fYcH/1AzKQ3Je5kCBcgkmAFEXXE3Yd95/kIvQZQwiqY8a4gqMvGYLn9+0Fsv55sIN OuP7pk6Wxd64964LIAXg9ctrCILVnmnp+PBotFxCNIfOiIPAw0ncbwhD5/CDC4RaBkuT pAAFf8fHPEGEucqhpRfNZ0+5SS5mtjsNVTw3Ao2dmWC4Zex5o3vI+GZGJOK6KccNy+7N OAlg== X-Received: by 10.52.24.98 with SMTP id t2mr24789747vdf.69.1360148130719; Wed, 06 Feb 2013 02:55:30 -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.58.252.8 with SMTP id zo8csp12974vec; Wed, 6 Feb 2013 02:55:28 -0800 (PST) X-Received: by 10.194.108.229 with SMTP id hn5mr49052628wjb.8.1360148106598; Wed, 06 Feb 2013 02:55:06 -0800 (PST) Received: from mail-we0-x22b.google.com ([2a00:1450:400c:c03::22b]) by mx.google.com with ESMTPS id fz10si517986wib.4.2013.02.06.02.55.06 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Feb 2013 02:55:06 -0800 (PST) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::22b is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c03::22b; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c03::22b 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-f171.google.com with SMTP id u54so1023035wey.30 for ; Wed, 06 Feb 2013 02:55:06 -0800 (PST) X-Received: by 10.194.172.228 with SMTP id bf4mr49040371wjc.38.1360148106214; Wed, 06 Feb 2013 02:55:06 -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 be1sm2406649wib.10.2013.02.06.02.55.05 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Feb 2013 02:55:05 -0800 (PST) From: Lee Jones To: linux-kernel@vger.kernel.org Cc: broonie@opensource.wolfsonmicro.com, linus.walleij@linaro.org, Michel JAOUEN , Lee Jones Subject: [PATCH 29/49] regulator: ab8500-ext: Add support for AB9540 regulators Date: Wed, 6 Feb 2013 10:53:51 +0000 Message-Id: <1360148051-7560-30-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1360148051-7560-1-git-send-email-lee.jones@linaro.org> References: <1360148051-7560-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQlPfOKdhwnlpyYXbQANkDUJ+mf63SpZ97FymXOKPsrMVrpDaXn/eh/4kqnq710bqNZMlUOe 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);