From patchwork Mon Feb 4 11:53:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14488 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 E120C23F96 for ; Mon, 4 Feb 2013 11:57:04 +0000 (UTC) Received: from mail-vb0-f43.google.com (mail-vb0-f43.google.com [209.85.212.43]) by fiordland.canonical.com (Postfix) with ESMTP id 9D3C9A1877A for ; Mon, 4 Feb 2013 11:57:04 +0000 (UTC) Received: by mail-vb0-f43.google.com with SMTP id fs19so797380vbb.30 for ; Mon, 04 Feb 2013 03:57:04 -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=Ilug0ln97k2s63cVi/xl3Cz/GaQyzU2gqLAcwerEGBvJWeAnZAgsV+UW/ShYAotEQm loVQEeMQFNlRt5o56JfZVE9t66EXA4wFGyu6WjbJ/vtzjXOvY7B+dQ0otaG9G7F1G/5e qyNxJ24JKuyit3jUGSkbuFKlxcTCFguEpmKY3+w6pouNb8Dr59z6Didos29/cnlALz41 1nULj0bsS7WTPbM+HcdGt6DMgueaGmYbRpSRs1UXguc5oKrT9yZolZ7wMuDDOgJiCYjK +LOEmghbY7L4ZsUuiP6IwqNb3h13AtSdjqV1g9MOJeFjVsKAnFm4SFsKjfaRhogJC15c VI6Q== X-Received: by 10.52.24.98 with SMTP id t2mr15771515vdf.69.1359979023877; Mon, 04 Feb 2013 03:57:03 -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 zo8csp83083vec; Mon, 4 Feb 2013 03:57:03 -0800 (PST) X-Received: by 10.180.82.41 with SMTP id f9mr9872093wiy.25.1359979022918; Mon, 04 Feb 2013 03:57:02 -0800 (PST) Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by mx.google.com with ESMTPS id g18si3478455wiw.13.2013.02.04.03.57.02 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 03:57:02 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.171 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.171; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.171 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-f171.google.com with SMTP id hn17so1493226wib.4 for ; Mon, 04 Feb 2013 03:57:02 -0800 (PST) X-Received: by 10.180.85.226 with SMTP id k2mr9911909wiz.34.1359979022502; Mon, 04 Feb 2013 03:57:02 -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 j9sm12937128wia.5.2013.02.04.03.56.59 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 03:57:01 -0800 (PST) From: Lee Jones To: linux-kernel@vger.kernel.org, broonie@opensource.wolfsonmicro.com Cc: Michel JAOUEN , Lee Jones Subject: [PATCH 39/73] regulator: ab8500-ext: Add support for AB9540 regulators Date: Mon, 4 Feb 2013 11:53:54 +0000 Message-Id: <1359978868-28736-40-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1359978868-28736-1-git-send-email-lee.jones@linaro.org> References: <1359978868-28736-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQmME3nxU5UulgBWzucYw2ffG9UmCi7HZMMCMq4uZoXZlvsr2D7wy7hit0sGfCYAD/P4Je1l 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);