From patchwork Thu Mar 28 16:11:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 15746 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 C451B23E10 for ; Thu, 28 Mar 2013 16:12:52 +0000 (UTC) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by fiordland.canonical.com (Postfix) with ESMTP id 5E5DEA18890 for ; Thu, 28 Mar 2013 16:12:52 +0000 (UTC) Received: by mail-ve0-f176.google.com with SMTP id ox1so3634774veb.7 for ; Thu, 28 Mar 2013 09:12:51 -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=vfmsduqVHgzh1bo6Oxg3qa1+S81qx+7IYEgO2yH2shI=; b=MGGYeH/SWDoRvc7yW/kUDi7Kz8MbDB08ERFF0Niqo41OqXYhSwpiY/C4+NIqNUgp/Y T7MKcUv4zoxa4XMSG2E8QrEZbK4Z1LH5uOkCjxHBRe9d1vPrktpC6lfxlIYdmfoYTGNA KlyiDk26/2mtdhKa8VCoapktzOr+CSp55m6ip7pc81GUiaDcokS3OLKrRRf+M3Bhv1sX dZg2JBt7GGg3h7BmgQ8tAfkm1IK1Q4Lxs0tdXSbFYWEbgdfVtiLZNKe/Xo6M11dTnfL8 2vUJ5a2C72wbisiXRMjUfkR3xBLuaQt2XKgbKZIDxgOXYG0/bsYh/jM3ZzQefk2c7Lkz u9Bg== X-Received: by 10.52.76.103 with SMTP id j7mr23989045vdw.90.1364487171913; Thu, 28 Mar 2013 09:12:51 -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 cg12csp22442ved; Thu, 28 Mar 2013 09:12:50 -0700 (PDT) X-Received: by 10.194.81.40 with SMTP id w8mr39228102wjx.14.1364487164560; Thu, 28 Mar 2013 09:12:44 -0700 (PDT) Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) by mx.google.com with ESMTPS id hl1si10110411wjb.105.2013.03.28.09.12.44 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Mar 2013 09:12:44 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.47 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.47; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.47 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-wg0-f47.google.com with SMTP id y10so1642825wgg.26 for ; Thu, 28 Mar 2013 09:12:44 -0700 (PDT) X-Received: by 10.180.189.17 with SMTP id ge17mr17474185wic.17.1364487161754; Thu, 28 Mar 2013 09:12:41 -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.39 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Mar 2013 09:12:40 -0700 (PDT) From: Lee Jones To: linux-kernel@vger.kernel.org, broonie@opensource.wolfsonmicro.com Cc: Lee Jones Subject: [PATCH 25/33] regulator: ab8500: Update vdmic, vamic[1|2] parameters for AB8540 Date: Thu, 28 Mar 2013 16:11:25 +0000 Message-Id: <1364487093-19551-26-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: ALoCoQls9o3K4K2E2EYm1fOYi2hq/uUkpiJ5bUlxmtNnyizZhvxe/yg5a+K5Io83KBJgq96jtj8w 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 ac89439..ef12d3d 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c @@ -212,9 +212,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) { @@ -1140,7 +1149,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, @@ -1624,46 +1633,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), }, /* @@ -1718,6 +1745,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;