From patchwork Wed Feb 6 10:54:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14621 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 5116D2423C for ; Wed, 6 Feb 2013 10:56:09 +0000 (UTC) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by fiordland.canonical.com (Postfix) with ESMTP id F3DF5A187B7 for ; Wed, 6 Feb 2013 10:56:08 +0000 (UTC) Received: by mail-vc0-f170.google.com with SMTP id p16so748374vcq.15 for ; Wed, 06 Feb 2013 02:56:08 -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=CLsOxjJZaJJYLJ55N3ezIKsIZOuh3r+N8L8bokaOKH4=; b=TW8hgm7qlIZaa4Z4ZRp3ZK7ill7KaHSOp8UMHF230Cwf1Y7ARGq9r66ukYq4LDPa2+ qKMh2FCxHsp8+l+t+ABVV7uQv6Cf8/JUC8E2qyBJ2ZPJJ3SnFafEdVv1Og+tvtFUQlcA HljSQWndN4uNyVlBdWZ1u6zADiBnjx077U4RmKJXFkI8qhzIGkuTsoPKFE+JhpTvWV6W Jg3+9nBySTqAK7tBKkg1L8AGBYs1R0NZ7P9OGThGPx1btJsp+2vVd0hc6BhgLvYcrZ4I 8ePl5qxxsC4n4NbqilM+Ofx3kj9YYQDIZce53FmzVdFWqdccovIduoVRVe8eg9cyq11e 5drQ== X-Received: by 10.52.24.98 with SMTP id t2mr24791594vdf.69.1360148168530; Wed, 06 Feb 2013 02:56:08 -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 zo8csp13016vec; Wed, 6 Feb 2013 02:56:08 -0800 (PST) X-Received: by 10.194.20.231 with SMTP id q7mr48808789wje.44.1360148118818; Wed, 06 Feb 2013 02:55:18 -0800 (PST) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by mx.google.com with ESMTPS id bf3si517051wib.11.2013.02.06.02.55.18 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Feb 2013 02:55:18 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.177 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.177; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.177 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-f177.google.com with SMTP id hm14so1419935wib.4 for ; Wed, 06 Feb 2013 02:55:18 -0800 (PST) X-Received: by 10.194.235.6 with SMTP id ui6mr48927792wjc.12.1360148118429; Wed, 06 Feb 2013 02:55:18 -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.17 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Feb 2013 02:55:18 -0800 (PST) From: Lee Jones To: linux-kernel@vger.kernel.org Cc: broonie@opensource.wolfsonmicro.com, linus.walleij@linaro.org, Lee Jones Subject: [PATCH 42/49] regulator: ab8500: Update vdmic, vamic[1|2] parameters for AB8540 Date: Wed, 6 Feb 2013 10:54:04 +0000 Message-Id: <1360148051-7560-43-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: ALoCoQnD5NcmXEPaqKbMAsCRU1ya6afGFPBy6z4tfQMZ3OyBzokM1IDJtgAZF/eEhq0va9niKzCM 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 653c298..490d5ec 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c @@ -214,9 +214,18 @@ static const int ldo_vaudio_voltages[] = { 2600000, /* Duplicated in Vaudio and IsoUicc Control register. */ }; +static const 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) { @@ -1131,7 +1140,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, @@ -1613,44 +1622,62 @@ 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, }, + .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, }, + .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), }, /* @@ -1704,6 +1731,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;