From patchwork Thu Mar 28 16:11:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 15735 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 72CEB23E10 for ; Thu, 28 Mar 2013 16:12:25 +0000 (UTC) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by fiordland.canonical.com (Postfix) with ESMTP id 22608A18899 for ; Thu, 28 Mar 2013 16:12:25 +0000 (UTC) Received: by mail-ve0-f177.google.com with SMTP id jw11so4096336veb.22 for ; Thu, 28 Mar 2013 09:12:24 -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=kUvlCgZD35fTjYI+U0abdvd2KUo/3eOVzAOz1Foo8Ig=; b=DIi7557RdNcA0ANbWesZupRH8DemSoFvnB0WGuoeBRR73u7ebZDW8t+SOIvOPRyGb8 MIgWbaYMtsAoGk/Wza6fBTOn5f67Gs6fYMkuJrjiiUNx2lShVobHID1LIBkSUriQC5tH PJfwxrk8z+yZipGOnhXJeZsPKNZfHBuWH2hA/TnodqAXebdvIhFpdLv5YOgnxR7Mi5eN +aAUaeLTqlHAp0RauxR1OmtSGSXDJz5qxPZfcCsr5NmfgWyYjMiUxqvt8yiW77vOcg/r lR2qJ/iaxBN41zY8hQHAo+uCGZbgUan/SX6eZ6FQxkkVsot4soNlxotMDCaUMglb8vsM v1OA== X-Received: by 10.52.31.103 with SMTP id z7mr23552893vdh.56.1364487144682; Thu, 28 Mar 2013 09:12:24 -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.59.4.204 with SMTP id cg12csp22413ved; Thu, 28 Mar 2013 09:12:23 -0700 (PDT) X-Received: by 10.194.5.4 with SMTP id o4mr39340791wjo.40.1364487142737; Thu, 28 Mar 2013 09:12:22 -0700 (PDT) Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]) by mx.google.com with ESMTPS id hi10si4328583wib.30.2013.03.28.09.12.22 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Mar 2013 09:12:22 -0700 (PDT) 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 c10so3563885wiw.0 for ; Thu, 28 Mar 2013 09:12:22 -0700 (PDT) X-Received: by 10.180.189.17 with SMTP id ge17mr17471819wic.17.1364487140660; Thu, 28 Mar 2013 09:12:20 -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 o5sm16765926wix.3.2013.03.28.09.12.18 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Mar 2013 09:12:19 -0700 (PDT) From: Lee Jones To: linux-kernel@vger.kernel.org, broonie@opensource.wolfsonmicro.com Cc: Lee Jones , Michel JAOUEN Subject: [PATCH 15/33] regulator: ab8500-ext: Add support for AB9540 regulators Date: Thu, 28 Mar 2013 16:11:15 +0000 Message-Id: <1364487093-19551-16-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1364487093-19551-1-git-send-email-lee.jones@linaro.org> References: <1364487093-19551-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQmuIYQBHhrAg5cpRFuwp2ykWzyU/FDKhltaajU9PuQ0iKsj73TACcvUwu8/koTl9baThoqj 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 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/regulator/ab8500-ext.c b/drivers/regulator/ab8500-ext.c index c73d544..993e9e4 100644 --- a/drivers/regulator/ab8500-ext.c +++ b/drivers/regulator/ab8500-ext.c @@ -299,6 +299,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] = { @@ -409,6 +419,12 @@ int ab8500_ext_regulator_init(struct platform_device *pdev) config.init_data = &pdata->ext_regulator[i]; config.driver_data = info; + if (is_ab9540(ab8500) && + ((info->desc.id == AB8500_EXT_SUPPLY1) || + (info->desc.id == AB8500_EXT_SUPPLY2) || + (info->desc.id == AB8500_EXT_SUPPLY3))) + info->desc.ops = &ab9540_ext_regulator_ops; + /* register regulator with framework */ info->rdev = regulator_register(&info->desc, &config);