From patchwork Tue Jul 3 15:05:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 10504273 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 87BE6601D3 for ; Tue, 3 Jul 2018 15:06:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 73F3628B5F for ; Tue, 3 Jul 2018 15:06:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 667FC28B63; Tue, 3 Jul 2018 15:06:21 +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=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=unavailable 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 AD5BA28B60 for ; Tue, 3 Jul 2018 15:06:20 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5F401267750; Tue, 3 Jul 2018 17:06:14 +0200 (CEST) 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 1A9D7267731; Tue, 3 Jul 2018 17:06:10 +0200 (CEST) Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by alsa0.perex.cz (Postfix) with ESMTP id 56A11267720 for ; Tue, 3 Jul 2018 17:06:08 +0200 (CEST) Received: by mail-wr0-f195.google.com with SMTP id f16-v6so2337238wrm.3 for ; Tue, 03 Jul 2018 08:06:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+/7wjwDfXPMTHStIdXMtbrV9zCpsB3mZqK/ZsgqQh3Q=; b=dJCXHP/Q+L3RPljhd1/dJ3VmKgVMBOSkVkeK5/XblRNxmsm7EDDk8FEGhZjmloj/EN PmM20WUPwEu/Zm4jJfCFPLq8cRMGc6NLre2JQSO3mXFDvalg5/tMImXQhCbp4J2kyTqc xp2nPgbx5PYttPCjhL3qCDLcVkWEp3V5M+bE2gF/x/bMPgvekIa0S2SAkg9nahudgqbm PiJ+k/+KZd6x2IsMwHLW5fctm798WGP6oQWHWGmTAha1ZJgQDZecLNpVx2y+530OkUs9 dx2aEOh65XB+VEY00gDvaj5RRoTZGj56U725z5W03Bk28Tuxv4s7llh/yc5vQxTOs+3p thZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+/7wjwDfXPMTHStIdXMtbrV9zCpsB3mZqK/ZsgqQh3Q=; b=q9irRf7zBOezlJYlEXX9qOYgDmYZyQp9ZR8X5ucitM3+dIWUULXnDj9iqZnMkn62d6 LPuvwMxolQu8QNDTG5x0r+OES8YrV0YaSQt2mX+I3dcDoMinmSnaGMsXrS5WjCNdG6Bp YpaBHEpVmAivHYbp14o6HZdP4Ch27FkEPt8aRJto5wjAT0YYMwO7RSyizdB/CB+5Mzmh 6kjpvcJhNMuV6UDycq0nCg6ujN1cQH9i3I/L5uSlvwu65Ts13f2grGJsV+/KIgrMwJ// 3aJB9uTrHGd6iUoymNsbVgGmKsFfZVTuVOYjQ1AEllj4JV8puMxWtP9+mlNzT3q5xrBh iW4g== X-Gm-Message-State: APt69E2tHljt2RzFrkRrlj+2d1pbnusX3GTjMwFt3QO349RijCK28dcL maPbYgTrhz29fAvkq33GVwbF0Q== X-Google-Smtp-Source: AAOMgpdWoRVnwz1pyunnMBX5L9RWLhij/Qsdhzv54ArpJmVR8pnIiuACwS6RCw6z6ynb38i4FGkhTA== X-Received: by 2002:adf:a285:: with SMTP id s5-v6mr22240974wra.114.1530630367915; Tue, 03 Jul 2018 08:06:07 -0700 (PDT) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id x16-v6sm2905842wme.12.2018.07.03.08.06.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Jul 2018 08:06:07 -0700 (PDT) From: Jerome Brunet To: Liam Girdwood , Mark Brown Date: Tue, 3 Jul 2018 17:05:59 +0200 Message-Id: <20180703150600.17697-3-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180703150600.17697-1-jbrunet@baylibre.com> References: <20180703150600.17697-1-jbrunet@baylibre.com> Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Jerome Brunet Subject: [alsa-devel] [PATCH v2 2/3] ASoC: es7134: correct required power supplies 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Drop AVDD in favor of PVDD to match the names used in the datasheet and only claim PVDD on the es7154. The es7134 and es7144 don't have a separate supply for the digital I/O. Signed-off-by: Jerome Brunet --- sound/soc/codecs/es7134.c | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/es7134.c b/sound/soc/codecs/es7134.c index 5ad59c38fed1..80f2936cefed 100644 --- a/sound/soc/codecs/es7134.c +++ b/sound/soc/codecs/es7134.c @@ -35,6 +35,10 @@ struct es7134_clock_mode { struct es7134_chip { const struct es7134_clock_mode *modes; unsigned int mode_num; + const struct snd_soc_dapm_widget *extra_widgets; + unsigned int extra_widget_num; + const struct snd_soc_dapm_route *extra_routes; + unsigned int extra_route_num; }; struct es7134_data { @@ -110,6 +114,34 @@ static int es7134_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) return 0; } +static int es7134_component_probe(struct snd_soc_component *c) +{ + struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(c); + struct es7134_data *priv = snd_soc_component_get_drvdata(c); + const struct es7134_chip *chip = priv->chip; + int ret; + + if (chip->extra_widget_num) { + ret = snd_soc_dapm_new_controls(dapm, chip->extra_widgets, + chip->extra_widget_num); + if (ret) { + dev_err(c->dev, "failed to add extra widgets\n"); + return ret; + } + } + + if (chip->extra_route_num) { + ret = snd_soc_dapm_add_routes(dapm, chip->extra_routes, + chip->extra_route_num); + if (ret) { + dev_err(c->dev, "failed to add extra routes\n"); + return ret; + } + } + + return 0; +} + static const struct snd_soc_dai_ops es7134_dai_ops = { .set_fmt = es7134_set_fmt, .hw_params = es7134_hw_params, @@ -158,9 +190,16 @@ static const struct es7134_clock_mode es7134_modes[] = { }, }; +/* Digital I/O are also supplied by VDD on the es7134 */ +static const struct snd_soc_dapm_route es7134_extra_routes[] = { + { "Playback", NULL, "VDD", } +}; + static const struct es7134_chip es7134_chip = { .modes = es7134_modes, .mode_num = ARRAY_SIZE(es7134_modes), + .extra_routes = es7134_extra_routes, + .extra_route_num = ARRAY_SIZE(es7134_extra_routes), }; static const struct snd_soc_dapm_widget es7134_dapm_widgets[] = { @@ -168,17 +207,16 @@ static const struct snd_soc_dapm_widget es7134_dapm_widgets[] = { SND_SOC_DAPM_OUTPUT("AOUTR"), SND_SOC_DAPM_DAC("DAC", "Playback", SND_SOC_NOPM, 0, 0), SND_SOC_DAPM_REGULATOR_SUPPLY("VDD", 0, 0), - SND_SOC_DAPM_REGULATOR_SUPPLY("AVDD", 0, 0), }; static const struct snd_soc_dapm_route es7134_dapm_routes[] = { { "AOUTL", NULL, "DAC" }, { "AOUTR", NULL, "DAC" }, - { "Playback", NULL, "VDD" }, - { "DAC", NULL, "AVDD" }, + { "DAC", NULL, "VDD" }, }; static const struct snd_soc_component_driver es7134_component_driver = { + .probe = es7134_component_probe, .dapm_widgets = es7134_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(es7134_dapm_widgets), .dapm_routes = es7134_dapm_routes,