From patchwork Tue Mar 21 14:45:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 9636711 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 44F65602D6 for ; Tue, 21 Mar 2017 14:45:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3896B262F2 for ; Tue, 21 Mar 2017 14:45:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D8E02833B; Tue, 21 Mar 2017 14:45:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57965262F2 for ; Tue, 21 Mar 2017 14:45:54 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 7FFB0267345; Tue, 21 Mar 2017 15:44:48 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6B029267341; Tue, 21 Mar 2017 15:44:47 +0100 (CET) Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by alsa0.perex.cz (Postfix) with ESMTP id F38D426733D for ; Tue, 21 Mar 2017 15:44:44 +0100 (CET) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2LEiY4d021748; Tue, 21 Mar 2017 09:44:44 -0500 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.wolfsonmicro.com Received: from mail3.cirrus.com ([87.246.76.56]) by mx0b-001ae601.pphosted.com with ESMTP id 2991ahxnnu-1; Tue, 21 Mar 2017 09:44:43 -0500 Received: from EX17.ad.cirrus.com (ex17.ad.cirrus.com [172.20.9.81]) by mail3.cirrus.com (Postfix) with ESMTP id 8ED28611CE7C; Tue, 21 Mar 2017 09:46:13 -0500 (CDT) Received: from imbe.wolfsonmicro.main (198.61.95.81) by EX17.ad.cirrus.com (172.20.9.81) with Microsoft SMTP Server id 14.3.301.0; Tue, 21 Mar 2017 14:44:42 +0000 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.223.36]) by imbe.wolfsonmicro.main (8.14.4/8.14.4) with ESMTP id v2LEi2pb024866; Tue, 21 Mar 2017 14:44:03 GMT From: Charles Keepax To: Date: Tue, 21 Mar 2017 14:45:38 +0000 Message-ID: <1490107539-23995-5-git-send-email-ckeepax@opensource.wolfsonmicro.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1490107539-23995-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> References: <1490107539-23995-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> MIME-Version: 1.0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703210129 Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, lgirdwood@gmail.com, robh+dt@kernel.org, lee.jones@linaro.org Subject: [alsa-devel] [PATCH 5/6] mfd: arizona: Add support for new micbias regulators X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Add mfd_cell's for each of the new micbias regulators, provide the appropriate supply mapping for these, and remove the old code that configured the micbiases now that the regulator driver does so. Signed-off-by: Charles Keepax --- drivers/mfd/arizona-core.c | 56 ++++++++++++++++++---------------------------- 1 file changed, 22 insertions(+), 34 deletions(-) diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c index b6d4bc6..e7eba5d 100644 --- a/drivers/mfd/arizona-core.c +++ b/drivers/mfd/arizona-core.c @@ -936,10 +936,16 @@ static const char * const wm5102_supplies[] = { "CPVDD", "SPKVDDL", "SPKVDDR", + "MICBIAS1", + "MICBIAS2", + "MICBIAS3", }; static const struct mfd_cell wm5102_devs[] = { { .name = "arizona-micsupp" }, + { .name = "arizona-micbias", .id = 1 }, + { .name = "arizona-micbias", .id = 2 }, + { .name = "arizona-micbias", .id = 3 }, { .name = "arizona-gpio" }, { .name = "arizona-extcon", @@ -957,6 +963,9 @@ static const struct mfd_cell wm5102_devs[] = { static const struct mfd_cell wm5110_devs[] = { { .name = "arizona-micsupp" }, + { .name = "arizona-micbias", .id = 1 }, + { .name = "arizona-micbias", .id = 2 }, + { .name = "arizona-micbias", .id = 3 }, { .name = "arizona-gpio" }, { .name = "arizona-extcon", @@ -976,9 +985,13 @@ static const char * const cs47l24_supplies[] = { "MICVDD", "CPVDD", "SPKVDD", + "MICBIAS1", + "MICBIAS2", }; static const struct mfd_cell cs47l24_devs[] = { + { .name = "arizona-micbias", .id = 1 }, + { .name = "arizona-micbias", .id = 2 }, { .name = "arizona-gpio" }, { .name = "arizona-haptics" }, { .name = "arizona-pwm" }, @@ -994,10 +1007,16 @@ static const char * const wm8997_supplies[] = { "DBVDD2", "CPVDD", "SPKVDD", + "MICBIAS1", + "MICBIAS2", + "MICBIAS3", }; static const struct mfd_cell wm8997_devs[] = { { .name = "arizona-micsupp" }, + { .name = "arizona-micbias", .id = 1 }, + { .name = "arizona-micbias", .id = 2 }, + { .name = "arizona-micbias", .id = 3 }, { .name = "arizona-gpio" }, { .name = "arizona-extcon", @@ -1015,6 +1034,9 @@ static const struct mfd_cell wm8997_devs[] = { static const struct mfd_cell wm8998_devs[] = { { .name = "arizona-micsupp" }, + { .name = "arizona-micbias", .id = 1 }, + { .name = "arizona-micbias", .id = 2 }, + { .name = "arizona-micbias", .id = 3 }, { .name = "arizona-gpio" }, { .name = "arizona-extcon", @@ -1404,40 +1426,6 @@ int arizona_dev_init(struct arizona *arizona) goto err_reset; } - for (i = 0; i < ARIZONA_MAX_MICBIAS; i++) { - if (!arizona->pdata.micbias[i].mV && - !arizona->pdata.micbias[i].bypass) - continue; - - /* Apply default for bypass mode */ - if (!arizona->pdata.micbias[i].mV) - arizona->pdata.micbias[i].mV = 2800; - - val = (arizona->pdata.micbias[i].mV - 1500) / 100; - - val <<= ARIZONA_MICB1_LVL_SHIFT; - - if (arizona->pdata.micbias[i].ext_cap) - val |= ARIZONA_MICB1_EXT_CAP; - - if (arizona->pdata.micbias[i].discharge) - val |= ARIZONA_MICB1_DISCH; - - if (arizona->pdata.micbias[i].soft_start) - val |= ARIZONA_MICB1_RATE; - - if (arizona->pdata.micbias[i].bypass) - val |= ARIZONA_MICB1_BYPASS; - - regmap_update_bits(arizona->regmap, - ARIZONA_MIC_BIAS_CTRL_1 + i, - ARIZONA_MICB1_LVL_MASK | - ARIZONA_MICB1_EXT_CAP | - ARIZONA_MICB1_DISCH | - ARIZONA_MICB1_BYPASS | - ARIZONA_MICB1_RATE, val); - } - for (i = 0; i < ARIZONA_MAX_INPUT; i++) { /* Default for both is 0 so noop with defaults */ val = arizona->pdata.dmic_ref[i]