From patchwork Thu Mar 21 15:59:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 15509 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 A040123E77 for ; Thu, 21 Mar 2013 16:01:17 +0000 (UTC) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by fiordland.canonical.com (Postfix) with ESMTP id 08EA9A19E77 for ; Thu, 21 Mar 2013 16:01:16 +0000 (UTC) Received: by mail-vb0-f44.google.com with SMTP id fr13so2020659vbb.17 for ; Thu, 21 Mar 2013 09:01:16 -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=A3QWDFA3iwmy5rAP8dMklPTb3a9ZaQBOb0Lh+GGpPno=; b=fMylUHjoZIycQ9IWnwtsTdw8sytrNTMHifArUueWmcWQjcZdX0objTX3VM5fLGHjOz HV3KBgyh/Gp82MWH/ccF1QXD8lLxfw80EckD7Kwnmdrw9wMtViBsUg9s/Jvj4gQrHAgB T3UIXb1BoR6NwlGCYcRciQzM4m2/rwtu/zHrTN5GiOfGqgpTHAR/qrABswi3HsV/79dH HBfhWx8S5c4AE+aYHFxT5kdp3KQevtGxV0DLJXi4BInEklNc+T1FXJ+h0djw1J5m7PTb 6GqyRBCVCd3h2gNlmNx4tqps7b01d5qOSCAyrWriPl4AWHM42y77gJ3WIN0XehD+BqD2 KijQ== X-Received: by 10.52.93.20 with SMTP id cq20mr12120044vdb.38.1363881676541; Thu, 21 Mar 2013 09:01:16 -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 ty6csp66822vec; Thu, 21 Mar 2013 09:01:16 -0700 (PDT) X-Received: by 10.194.83.105 with SMTP id p9mr18196883wjy.56.1363881675612; Thu, 21 Mar 2013 09:01:15 -0700 (PDT) Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]) by mx.google.com with ESMTPS id fq1si1436498wib.41.2013.03.21.09.01.15 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Mar 2013 09:01:15 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::22c is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::22c; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c05::22c 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-f172.google.com with SMTP id hj13so615573wib.11 for ; Thu, 21 Mar 2013 09:01:15 -0700 (PDT) X-Received: by 10.194.178.9 with SMTP id cu9mr18293985wjc.39.1363881674932; Thu, 21 Mar 2013 09:01:14 -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.01.12 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Mar 2013 09:01:13 -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, Lee Jones Subject: [PATCH 36/46] regulator: ab8500: Update vdmic, vamic[1|2] parameters for AB8540 Date: Thu, 21 Mar 2013 15:59:33 +0000 Message-Id: <1363881583-15234-37-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: ALoCoQk5Kh/pb0FgRI7TlatwatJtcA7GCGfe4kkZZx3Ng9aG0DM11kBvO/sIqdazLg5IUfgqpow6 Add voltage setting for vdmic; add LP mode setting for vamic1,2. Signed-off-by: Lee Jones --- drivers/regulator/ab8500.c | 45 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index 7265a24..200005e 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c @@ -214,9 +214,18 @@ static const unsigned int ldo_vaudio_voltages[] = { 2600000, /* Duplicated in Vaudio and IsoUicc Control register. */ }; +static const unsigned int ldo_vdmic_voltages[] = { + 1800000, + 1900000, + 2000000, + 2850000, +}; + static DEFINE_MUTEX(shared_mode_mutex); static struct ab8500_shared_mode ldo_anamic1_shared; static struct ab8500_shared_mode ldo_anamic2_shared; +static struct ab8500_shared_mode ab8540_ldo_anamic1_shared; +static struct ab8500_shared_mode ab8540_ldo_anamic2_shared; static int ab8500_regulator_enable(struct regulator_dev *rdev) { @@ -1132,7 +1141,7 @@ static struct ab8500_regulator_info .n_voltages = 1, .volt_table = fixed_2050000_voltage, }, - .shared_mode = &ldo_anamic1_shared, + .shared_mode = &ldo_anamic1_shared, .update_bank = 0x03, .update_reg = 0x83, .update_mask = 0x08, @@ -1616,46 +1625,64 @@ static struct ab8500_regulator_info [AB8540_LDO_ANAMIC1] = { .desc = { .name = "LDO-ANAMIC1", - .ops = &ab8500_regulator_ops, + .ops = &ab8500_regulator_anamic_mode_ops, .type = REGULATOR_VOLTAGE, .id = AB8540_LDO_ANAMIC1, .owner = THIS_MODULE, .n_voltages = 1, .volt_table = fixed_2050000_voltage, }, + .shared_mode = &ab8540_ldo_anamic1_shared, .update_bank = 0x03, .update_reg = 0x83, .update_mask = 0x08, .update_val = 0x08, + .mode_bank = 0x03, + .mode_reg = 0x83, + .mode_mask = 0x20, + .mode_val_idle = 0x20, + .mode_val_normal = 0x00, }, [AB8540_LDO_ANAMIC2] = { .desc = { .name = "LDO-ANAMIC2", - .ops = &ab8500_regulator_ops, + .ops = &ab8500_regulator_anamic_mode_ops, .type = REGULATOR_VOLTAGE, .id = AB8540_LDO_ANAMIC2, .owner = THIS_MODULE, .n_voltages = 1, .volt_table = fixed_2050000_voltage, }, + .shared_mode = &ab8540_ldo_anamic2_shared, .update_bank = 0x03, .update_reg = 0x83, .update_mask = 0x10, .update_val = 0x10, + .mode_bank = 0x03, + .mode_reg = 0x83, + .mode_mask = 0x20, + .mode_val_idle = 0x20, + .mode_val_normal = 0x00, }, [AB8540_LDO_DMIC] = { .desc = { .name = "LDO-DMIC", - .ops = &ab8500_regulator_ops, + .ops = &ab8500_regulator_volt_mode_ops, .type = REGULATOR_VOLTAGE, .id = AB8540_LDO_DMIC, .owner = THIS_MODULE, - .n_voltages = 1, + .n_voltages = ARRAY_SIZE(ldo_vdmic_voltages), }, + .load_lp_uA = 1000, .update_bank = 0x03, .update_reg = 0x83, .update_mask = 0x04, .update_val = 0x04, + .voltage_bank = 0x03, + .voltage_reg = 0x83, + .voltage_mask = 0xc0, + .voltages = ldo_vdmic_voltages, + .voltages_len = ARRAY_SIZE(ldo_vdmic_voltages), }, /* @@ -1710,6 +1737,14 @@ static struct ab8500_shared_mode ldo_anamic2_shared = { .shared_regulator = &ab8505_regulator_info[AB8505_LDO_ANAMIC1], }; +static struct ab8500_shared_mode ab8540_ldo_anamic1_shared = { + .shared_regulator = &ab8540_regulator_info[AB8540_LDO_ANAMIC2], +}; + +static struct ab8500_shared_mode ab8540_ldo_anamic2_shared = { + .shared_regulator = &ab8540_regulator_info[AB8540_LDO_ANAMIC1], +}; + struct ab8500_reg_init { u8 bank; u8 addr;