From patchwork Fri Jun 29 15:09:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 140571 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp963082ljj; Fri, 29 Jun 2018 08:09:42 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLOCfgcpRsMenw5yt7/q4+IxseslHJ4xNFwmlLdLYjtonXvQs25XNFEiWZsJ+jDisSKDAwK X-Received: by 2002:a63:bd01:: with SMTP id a1-v6mr12878968pgf.319.1530284982634; Fri, 29 Jun 2018 08:09:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530284982; cv=none; d=google.com; s=arc-20160816; b=B7Y47fsGXeYm/wujj6Vpc9ZaUSj623ygn3zKBa8QGpzsQ8xv23RXt+F1sf4JpF/v9A le7t72/kwpi+UXcoHB1Kh2usgEorbMe96Z8WipZBeIhxcI69VpCTZxAAYYM61/Fu4dD4 sF7jj9fACzUGeD2y1xM6pHqHH1wG+c2AAtXQxXbH5gdA75s33QLmcTG5o2sLORsq8L3M OiUt0ltksl4x96TN7AzF9wux6FKgIBLNIhDgdFiKYuEP75NdeB6KPrpclp3LFHqQLzJK PbNLoNwKx3wPPhJAtuqCEc1OqvPzykP0xvE+085cwBtRTMSVwgJC7aVzWXibf4ds2jXl D8fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=+7/swUQZFAd6N8K1M3uYNqQl1RfsDNPOrQv57pLlcFk=; b=mqHZ08l71+4YGArpXg3Wdbi58kmO1VymuFLwBnFPk9rO/YeZDScdWN56YOkHPl9RJw RBfFRNOKt4jH9dnWbu2/mtJisJVghNRcP8qSQF1KqP9WHd+Q+Nm18WLWMQyga4VdfSXI lRI7/pbust173BvyYU5xzyktavSvlpOE9YXeFeaCsdbYHZ6c3aYSHqxmDWF5peXweqC4 DOfSYba3SG0/+lQrv+NnBYcQeAJ90F5/cIQHt2X3QhvuaIqRA5gooq7rVM3SYYH+164c vnFS202UtlBZAr20jKM1x2+YmHBcs4x/tgj4WKZ52vRwEegok4Qlt9BbEEXR/+YCX2K4 IBMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=tgCeev2q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o20-v6si8478354pgb.614.2018.06.29.08.09.42; Fri, 29 Jun 2018 08:09:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=tgCeev2q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934803AbeF2PJk (ORCPT + 31 others); Fri, 29 Jun 2018 11:09:40 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:41172 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755582AbeF2PJe (ORCPT ); Fri, 29 Jun 2018 11:09:34 -0400 Received: by mail-wr0-f196.google.com with SMTP id h10-v6so9167316wrq.8 for ; Fri, 29 Jun 2018 08:09:33 -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=+7/swUQZFAd6N8K1M3uYNqQl1RfsDNPOrQv57pLlcFk=; b=tgCeev2qSnSV0/t54V01gojrXOBywyhPId8cd0dKtXsyAmH/pRB5tSgl0pZm8e9ivL RM4mI0xB0MQgUCokUF8K6PuejeJZeg5Wa/SoYGhxYNmjBi9FjTFzm5VCsAtA3b+aKK8G D4DPPTVf/WeMsurLmKFbrr9+I1G4nqWE3o8OLjwIyNKom4fRE0FDLQ3ikF/vgVqS4Pqk ONt8CEZi/g73BJ+pB1LZNSmde+ibPzItO4KW0uYiT3QobvDwZJnaeeL+qlJrn+efkgoB tt7McBiBbDVtP0iR2kKgVwTtkL6F/ZUMo3IqKFcrPWRTmUDp+CaOV6aY/6pbB+lS3Hog Jozg== 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=+7/swUQZFAd6N8K1M3uYNqQl1RfsDNPOrQv57pLlcFk=; b=d6PyOLwSPT824Y6oYSx/hQ83xIAXBjFz0T03VErsirYSsUnbH7YaeAl6UOV2zdiknm oAExrakWf4Idw8XIJ4gybRoLC2H5EFNfdSEN1ADbbwdX2EnyW4C/rbyj/gwsxssysbFj jSPje0jj0DyWmVXBKOlnfYt9YqwOIm+NapqWFL6JMIwY4Dh6vomRc0Btvj6kL2ICwxgV 4jUSNZpl3ExLnCVnPVhm6ENnx9gFJa2PzIsiXX9sxn7I09CNLE30OoGWE+a4H0qAHJow dMGEI/D3KmxyGgNf1ObvAGmaXxmZgX9inPonpleHVRW+UavlmMi/lsQ/N3d0D2d3+h7E vrYA== X-Gm-Message-State: APt69E3DaBFs3mQ84cXKSF2A8P5/lhPiigjLnbRBFXvZIc0D4LpDTQ+D zkHMmGIsfH56+EC1WTkS5EDCtA== X-Received: by 2002:adf:d84a:: with SMTP id k10-v6mr12359926wrl.26.1530284972968; Fri, 29 Jun 2018 08:09:32 -0700 (PDT) Received: from localhost.localdomain (uluru.liltaz.com. [163.172.81.188]) by smtp.googlemail.com with ESMTPSA id b6-v6sm11944222wro.52.2018.06.29.08.09.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jun 2018 08:09:32 -0700 (PDT) From: Jerome Brunet To: Liam Girdwood , Mark Brown Cc: Jerome Brunet , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/5] ASoC: es7134: check if mclk rate is valid Date: Fri, 29 Jun 2018 17:09:21 +0200 Message-Id: <20180629150924.18197-3-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180629150924.18197-1-jbrunet@baylibre.com> References: <20180629150924.18197-1-jbrunet@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For each supported sample rate, the es7134 can work with several mclk / sample rate ratio. Check if ratio we get is actually OK. Signed-off-by: Jerome Brunet --- sound/soc/codecs/es7134.c | 119 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 117 insertions(+), 2 deletions(-) -- 2.14.4 diff --git a/sound/soc/codecs/es7134.c b/sound/soc/codecs/es7134.c index 2fbb49f5b278..698289dc3e22 100644 --- a/sound/soc/codecs/es7134.c +++ b/sound/soc/codecs/es7134.c @@ -17,6 +17,7 @@ * in the file called COPYING. */ +#include #include #include @@ -24,6 +25,77 @@ * The everest 7134 is a very simple DA converter with no register */ +struct es7134_clock_mode { + unsigned int rate_min; + unsigned int rate_max; + unsigned int *mclk_fs; + unsigned int mclk_fs_num; +}; + +struct es7134_chip { + const struct es7134_clock_mode *modes; + unsigned int mode_num; +}; + +struct es7134_data { + unsigned int mclk; + const struct es7134_chip *chip; +}; + +static int es7134_check_mclk(struct snd_soc_dai *dai, + struct es7134_data *priv, + unsigned int rate) +{ + unsigned int mfs = priv->mclk / rate; + int i, j; + + for (i = 0; i < priv->chip->mode_num; i++) { + const struct es7134_clock_mode *mode = &priv->chip->modes[i]; + + if (rate < mode->rate_min || rate > mode->rate_max) + continue; + + for (j = 0; j < mode->mclk_fs_num; j++) { + if (mode->mclk_fs[j] == mfs) + return 0; + } + + dev_err(dai->dev, "unsupported mclk_fs %u for rate %u\n", + mfs, rate); + return -EINVAL; + } + + /* should not happen */ + dev_err(dai->dev, "unsupported rate: %u\n", rate); + return -EINVAL; +} + +static int es7134_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params, + struct snd_soc_dai *dai) +{ + struct es7134_data *priv = snd_soc_dai_get_drvdata(dai); + + /* mclk has not been provided, assume it is OK */ + if (!priv->mclk) + return 0; + + return es7134_check_mclk(dai, priv, params_rate(params)); +} + +static int es7134_set_sysclk(struct snd_soc_dai *dai, int clk_id, + unsigned int freq, int dir) +{ + struct es7134_data *priv = snd_soc_dai_get_drvdata(dai); + + if (dir == SND_SOC_CLOCK_IN && clk_id == 0) { + priv->mclk = freq; + return 0; + } + + return -ENOTSUPP; +} + static int es7134_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) { fmt &= (SND_SOC_DAIFMT_FORMAT_MASK | SND_SOC_DAIFMT_INV_MASK | @@ -40,6 +112,8 @@ static int es7134_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) static const struct snd_soc_dai_ops es7134_dai_ops = { .set_fmt = es7134_set_fmt, + .hw_params = es7134_hw_params, + .set_sysclk = es7134_set_sysclk, }; static struct snd_soc_dai_driver es7134_dai = { @@ -62,6 +136,33 @@ static struct snd_soc_dai_driver es7134_dai = { .ops = &es7134_dai_ops, }; +static const struct es7134_clock_mode es7134_modes[] = { + { + /* Single speed mode */ + .rate_min = 8000, + .rate_max = 50000, + .mclk_fs = (unsigned int[]) { 256, 384, 512, 768, 1024 }, + .mclk_fs_num = 5, + }, { + /* Double speed mode */ + .rate_min = 84000, + .rate_max = 100000, + .mclk_fs = (unsigned int[]) { 128, 192, 256, 384, 512 }, + .mclk_fs_num = 5, + }, { + /* Quad speed mode */ + .rate_min = 167000, + .rate_max = 192000, + .mclk_fs = (unsigned int[]) { 128, 192, 256 }, + .mclk_fs_num = 3, + }, +}; + +static const struct es7134_chip es7134_chip = { + .modes = es7134_modes, + .mode_num = ARRAY_SIZE(es7134_modes), +}; + static const struct snd_soc_dapm_widget es7134_dapm_widgets[] = { SND_SOC_DAPM_OUTPUT("AOUTL"), SND_SOC_DAPM_OUTPUT("AOUTR"), @@ -86,6 +187,20 @@ static const struct snd_soc_component_driver es7134_component_driver = { static int es7134_probe(struct platform_device *pdev) { + struct device *dev = &pdev->dev; + struct es7134_data *priv; + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + platform_set_drvdata(pdev, priv); + + priv->chip = of_device_get_match_data(dev); + if (!priv->chip) { + dev_err(dev, "failed to match device\n"); + return -ENODEV; + } + return devm_snd_soc_register_component(&pdev->dev, &es7134_component_driver, &es7134_dai, 1); @@ -93,8 +208,8 @@ static int es7134_probe(struct platform_device *pdev) #ifdef CONFIG_OF static const struct of_device_id es7134_ids[] = { - { .compatible = "everest,es7134", }, - { .compatible = "everest,es7144", }, + { .compatible = "everest,es7134", .data = &es7134_chip }, + { .compatible = "everest,es7144", .data = &es7134_chip }, { } }; MODULE_DEVICE_TABLE(of, es7134_ids); From patchwork Fri Jun 29 15:09:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 140573 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp963290ljj; Fri, 29 Jun 2018 08:09:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfYLOs2RBKM0GHX7Ny+wYTYNUJQfmxhjWST25XCnxbml4li4cGM9wGJrOpPXGP2p8PlVrQl X-Received: by 2002:a17:902:24a5:: with SMTP id w34-v6mr2700253pla.52.1530284991825; Fri, 29 Jun 2018 08:09:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530284991; cv=none; d=google.com; s=arc-20160816; b=dT1ElicSub10g6LveiA3oJcYQIXTzdgdd1DyOhWNEVtTmndTqd/OT2bahb9Jn/9LRM LJlLrPm8mmrRnFRLUUWAWd5eN4GjjwoDTWC1c02tpEFH45fUMO3SMFnGg+n0pbKPL2Bv PAUD3Ja/9SEOR1cDsfvaAbrz4gwaFjL2h5mmfUAZqw6WTKwTTyvofEnY9JdSZ+0LZLp9 FtmvCybRe9nzZAn6ogBBF5XnteKEI8BfUTv4tDGz2l+20KsJtnLXvC7EB9wn4SN0pwn4 sUW5f0jAC7QA44cXmFNZ8uxoXGhjCVdQ/wcMrXSOP4lo5nLNsS4Ak5FBnts0JsX4iumf xIUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Ntrw9WA6YMJlZA1RVGO0rFX4H+AG+VQ/onfo0b5libQ=; b=TYFYpfBD22CVD3s/86HkUKJ5ZWd5qbV/4NL/L/6mM2GqvGhXg6yue0w+7nCNTUOhle f0tiZxkRAq6mwWVC8RanmBzOVpklmuA7I2uePQ0Zab8Q0Hfr1AcmiMxiAgBGSLWACc57 lSDABA/k0s0i2z/D8eYWkMEV3xUhq18G82M3mINplFg/jzOju51fGjSUJaLP+zAyONsg p6M6rLz/0ZEhb65YU+GMjm/7aDJSVsg3IRt8d/FhnaOZONSDzRzYandDbeJsr2c+2H3n 3EQTTtRZURLWZXWghCM+K80WdsOCTjST8NbiSQhFMLLYhl/WnDP7VdcZiIB9kygHW2ow Rcyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=1zHhuV94; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o20-v6si8478354pgb.614.2018.06.29.08.09.51; Fri, 29 Jun 2018 08:09:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=1zHhuV94; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934443AbeF2PJj (ORCPT + 31 others); Fri, 29 Jun 2018 11:09:39 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:34594 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755588AbeF2PJf (ORCPT ); Fri, 29 Jun 2018 11:09:35 -0400 Received: by mail-wr0-f194.google.com with SMTP id a12-v6so9188365wro.1 for ; Fri, 29 Jun 2018 08:09:34 -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=Ntrw9WA6YMJlZA1RVGO0rFX4H+AG+VQ/onfo0b5libQ=; b=1zHhuV94/Crjjli17d+fR24qe17PWdjtbksyJ8HZD/QaPP9NRE4Dz4dvyaDSKH3x9s NGB+8F1eb/4ONH5ITm7Tr0LOxwRVdSe9uqKh8LIszfvPzx91WnjZ6zjAaHMr/jhkGsV1 tw61DCyqgJ5gPBxWIq1X/vGVHRQvExwntp7Y89VVFBE0jOulYavZP7Kt5sRUzLekFpjy nizz3JuxSlYS6z6wDtTyJ/8ce5GcUzG/Zjyy7ea1zOXuhBkuYJ/djzOf9Gii9l4yjgV+ iqu1eGBj8YOCuDNa4sZlSq1XU8MZtDBqGozLaQJzU72O4ToupdxP9gjw8pCVL+Zpgsjq 1wjg== 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=Ntrw9WA6YMJlZA1RVGO0rFX4H+AG+VQ/onfo0b5libQ=; b=X71QivQgfV/sn/YLkRj/o/SDIFXub1Bdo7IZIcxF86tnzmWCJW/gqeyhmzYikfuhnk iIQdbDCYOp3TTULPvmen1u2mkD4nyZaxg64t0CiONKaTWe/p8g6g7rrPpcaUSUncoze8 WhKHO9iFiFk30ivdm4Lw22Xe7DLTqcwRkb5uKp+b/IUw3IffssqdUfYroRNQEGjW62Pt zSfZAOX2C3te/YCqwvzvJXRFbXpinKO0tQjJFiGvXLRLRpyUByEpDVdeVrYWq5s2ESQ/ jDKn3mxmStiNmyod5alzsa1wcPj88buJv9hdAiCcbJZFV7bgsy0/t+T7AIfjVbR0TFeP YEUQ== X-Gm-Message-State: APt69E1y9aAGxuHlCkkBzJT3K6xY/ZDHWuw151A5Z4EXRenrZO/6Il7V bAuQDW7JI00onM2vOmE3GQTEhA== X-Received: by 2002:adf:be8d:: with SMTP id i13-v6mr12339873wrh.86.1530284974059; Fri, 29 Jun 2018 08:09:34 -0700 (PDT) Received: from localhost.localdomain (uluru.liltaz.com. [163.172.81.188]) by smtp.googlemail.com with ESMTPSA id b6-v6sm11944222wro.52.2018.06.29.08.09.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jun 2018 08:09:33 -0700 (PDT) From: Jerome Brunet To: Liam Girdwood , Mark Brown Cc: Jerome Brunet , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/5] ASoC: es7134: update DT binding with new compatible and supplies Date: Fri, 29 Jun 2018 17:09:22 +0200 Message-Id: <20180629150924.18197-4-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180629150924.18197-1-jbrunet@baylibre.com> References: <20180629150924.18197-1-jbrunet@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Update the documentation to add support for the es7154 and optional power supplies phandles. Signed-off-by: Jerome Brunet --- Documentation/devicetree/bindings/sound/everest,es7134.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.14.4 diff --git a/Documentation/devicetree/bindings/sound/everest,es7134.txt b/Documentation/devicetree/bindings/sound/everest,es7134.txt index 5495a3cb8b7b..c6bcdc5bded8 100644 --- a/Documentation/devicetree/bindings/sound/everest,es7134.txt +++ b/Documentation/devicetree/bindings/sound/everest,es7134.txt @@ -1,7 +1,13 @@ ES7134 i2s DA converter Required properties: -- compatible : "everest,es7134" or "everest,es7144" +- compatible : "everest,es7134" or + "everest,es7144" or + "everest,es7154" + +Optional properties: +- VDD-supply: regulator phandle for the VDD supply +- AVDD-supply: regulator phandle for the AVDD supply Example: From patchwork Fri Jun 29 15:09:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 140575 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp963655ljj; Fri, 29 Jun 2018 08:10:07 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLQNWRh/VHpgBA11G+ldDPU/9bgMWokE7jyakJUlymqJO/o4XhJeBQE87H2DNk73twzDV95 X-Received: by 2002:a17:902:14b:: with SMTP id 69-v6mr15373625plb.184.1530285007035; Fri, 29 Jun 2018 08:10:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530285007; cv=none; d=google.com; s=arc-20160816; b=dopAYbnMgUy2Tudaz9eCWbtzMvnmeKnIfUyspwZ8Dvt0ECnUibNvHTjHcSBAYa3pMt LdcTBT+hVaaPb2VaZamWbqmHGfKR6QeotsglxjU9/UNN48lkZpWH5ly2tMoASDrpZLlf K6SDQA5WbuVuqZLBUhQXS0zvf1Idp/N9+cpAlOcvcFevCDmQ99lc2XQIJjUwWTSH5mUb ugB5NxBaVsGHXOe2leJWD8LlXREdPoH6wIF1PkMT1pfD+Y4MvMIpvdlW7Fr9FMcERxX0 xqA2WJrfJxDfxXTRiUdqnJADoSz0Tc64hG2djaWiyq90zm/TMN/coVxySPWijL4lIqFx iAjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=l/wtLKomE6HwHPNbFcDaRgybgHLqVBTbQpGq9S5EpfI=; b=QC3L5nzCEukLNjl2Swos6cMtiNxkVxwWgeiDQCzZjKfEnbJcf1Fy9a3Kl8/SiOguYN +iSXJDBbZrOLPQOAMSnDoP4kqm2+DZo4QUez10zoISABIzRs6EeD4WF38zScwc6WzVTT c/XWGXlfK8l+F351Iyxzc0btZfvd1u3TyIwzmBxBfhnlrSBwoairN+NpbqmOuaTnaqxB N1FVPg9aAPULv1xAzqL+90xaItMRHpTIADDwxSX3S8+8PZLQWpDrq8QufJwTkeDknlq1 eLkZsWXzKj/1fOPB1aUDzSKyckgjnXpSPSpyq6gEmv2+ENODtUKr8dHJ4jkut4xqLgUj zu9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=TiS0QXma; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o20-v6si8478354pgb.614.2018.06.29.08.10.06; Fri, 29 Jun 2018 08:10:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=TiS0QXma; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935776AbeF2PKE (ORCPT + 31 others); Fri, 29 Jun 2018 11:10:04 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:41175 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755591AbeF2PJg (ORCPT ); Fri, 29 Jun 2018 11:09:36 -0400 Received: by mail-wr0-f195.google.com with SMTP id h10-v6so9167425wrq.8 for ; Fri, 29 Jun 2018 08:09:35 -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=l/wtLKomE6HwHPNbFcDaRgybgHLqVBTbQpGq9S5EpfI=; b=TiS0QXmamIDs5z3ePns3W6o7g+lkxgPPhV3q/867tUKWv5VwfPPXxWZMfOyMmqqc2G li5zcBQBUM8b+bQ3TZGYqc8jC3gA8pyLZd7oA4Zhw5aKx2DwWLY4uACwJxZwmLDXGIAG vqXAQ53WtPgXVlJV9ar2WdhQBUKGV3ietXY9G/4SzL3IWQTNJeG3DoblN7X8KQNycXB1 o8nwmMVo0XiFpUF1zhEGEFrvA5tgTaJpKWH/Fd984Ku0qG8HGSKA7yTJ2ZGv1Vg8PsZ7 JPtMfW4WPiJHInXHhNdqPuNsrOyuD/yQRFgROJL4yvfa9mf1vkfzVu6h4LuMFWr5vx0X bq9w== 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=l/wtLKomE6HwHPNbFcDaRgybgHLqVBTbQpGq9S5EpfI=; b=EYat5Ta+1B8/ag/qRQtXWRz+f9fb6tzoCfQsa7lfWzmLHpPy2yn0XtWfYv75SIfZE9 UWR14gdhaq9Ve2PZGwWO917MgUzlJ8Vqjbnl9tsKzFlJGMrVb0sVONJcqgLzHuUOZp8B lvLR8U8ZtSHfLuwR4OStS9szaw3PRuReQTyvF/bV9uEjI8oZ587BicWN4z1TEj6gHxrj jso63EeDw16Mj6OAJiyWwcF7QVl6QfqmeyhNtkGVcFjiaKDU1V1ocZeCNVkZYb6qOq9K KX3A5bhEZBOYXONCWNCqbdSDBTA82isi3O+RE2Vev35Y66mC+EzcwE801/7OskuIAGhO bj5w== X-Gm-Message-State: APt69E3iRqY4Qj96M7/FGZ+Z/8Hve6TdYgNRnl1o5j7i8f4HyQEpvyAM 5fZJcT7QNUSOOsUb1m+4i6d5ng== X-Received: by 2002:adf:a0c2:: with SMTP id n2-v6mr12939121wrn.23.1530284975139; Fri, 29 Jun 2018 08:09:35 -0700 (PDT) Received: from localhost.localdomain (uluru.liltaz.com. [163.172.81.188]) by smtp.googlemail.com with ESMTPSA id b6-v6sm11944222wro.52.2018.06.29.08.09.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jun 2018 08:09:34 -0700 (PDT) From: Jerome Brunet To: Liam Girdwood , Mark Brown Cc: Jerome Brunet , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] ASoC: es7134: Add VDD and AVDD power supplies Date: Fri, 29 Jun 2018 17:09:23 +0200 Message-Id: <20180629150924.18197-5-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180629150924.18197-1-jbrunet@baylibre.com> References: <20180629150924.18197-1-jbrunet@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the VDD and AVDD power supplies to the DAPM graph as some board may need to enable a regulator to turn them on. Signed-off-by: Jerome Brunet --- sound/soc/codecs/es7134.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.14.4 diff --git a/sound/soc/codecs/es7134.c b/sound/soc/codecs/es7134.c index 698289dc3e22..5ad59c38fed1 100644 --- a/sound/soc/codecs/es7134.c +++ b/sound/soc/codecs/es7134.c @@ -167,11 +167,15 @@ static const struct snd_soc_dapm_widget es7134_dapm_widgets[] = { SND_SOC_DAPM_OUTPUT("AOUTL"), 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" }, }; static const struct snd_soc_component_driver es7134_component_driver = { From patchwork Fri Jun 29 15:09:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 140574 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp963605ljj; Fri, 29 Jun 2018 08:10:05 -0700 (PDT) X-Google-Smtp-Source: AAOMgpemMr8rD3umAWXLyyigB8DEvmJRowXyWz/O/IPotb8b/u3V/PCebylPOCRvVYztqBHrQb+E X-Received: by 2002:aa7:854e:: with SMTP id y14-v6mr14637843pfn.165.1530285005375; Fri, 29 Jun 2018 08:10:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530285005; cv=none; d=google.com; s=arc-20160816; b=HkrJCSLXNE2QG115RVBM2aEwX5+fzVtYpVWI2f5CV91mVN6+TMGWKZ+REdm4VNSg4u sWBf/kgrZ+kU1EJnuhuhQk4iI5S+19kYpmzIlAsUrzFlIUfyxwF++W4h5ff9YvewYohF cErwMJ8EskIXH37dIAQSO9ZTMux2iZG0kuUuP5NWpv59Mh1IzGB8cvIE/qd6Zj0bNdEQ F5Tq1yGSHcrHGLHqBtnbrDXGREvv/75qt81O05Bin7HXEd9c6cy4VE5byRxZyB8xTEJt OEDgI7ZqmPLXEZhl1IdDS7PAwikTQ6OBbl+2yukggo5GjGjPsdKwpMzUXDPrk59PkQWV TBQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=y3QIPNk+8o4XPNTxUwkKt4OvhsvkV40uuOIrtve2kJk=; b=oWfo5GVZgbk6JtLvc+GVnM6a2X9Xc9lKAtxDz6O73TeYr4IgDWtSivWrQtoDRP1+CO 81ISSidjV6fZyPBU9zahpCLnsegMhSlq/nx+eIxw7Bz0a5I/tnMrGYIQdreboKpV/QQ5 GXq9JhmToSHnWo7uf1paOHVObeUT0NkO10GmWmeWanpWHMy1C98FJ1jKlTiy0clxaDmq d7Pm2oyzE/VUjjBps/gnlrTCYy5U2NLm9EHbA9GRBW3tYd4TgNTxWBUcZgtKrRYcD7nV OUxN0ZbLTUaGfLBvKooFaiR4Ds+ExAyECkZ4HJWRGUJUxAEDUcZJFJZ2ESkSZ2C/544w iYrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=i50s7zXT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o20-v6si8478354pgb.614.2018.06.29.08.10.04; Fri, 29 Jun 2018 08:10:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=i50s7zXT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935647AbeF2PKD (ORCPT + 31 others); Fri, 29 Jun 2018 11:10:03 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:42085 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932238AbeF2PJh (ORCPT ); Fri, 29 Jun 2018 11:09:37 -0400 Received: by mail-wr0-f195.google.com with SMTP id p1-v6so9183410wrs.9 for ; Fri, 29 Jun 2018 08:09:37 -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=y3QIPNk+8o4XPNTxUwkKt4OvhsvkV40uuOIrtve2kJk=; b=i50s7zXTWPJyzh8SG7nuc6bx2kvkGL3Fi2T8Y2YP9bKl35QEoFC4n8meOQgolcXGle XwpQWWa5QzmFhFNle5qmWSt3g4l9hbS/PGGPXZ9PnFVlT/v+b5ymsU54OEJKKW8GSNDX 8kWo3IAoxZ8sa3HnigZb0IWZaPw6wTzzWadPfYaId3p3+IcAsA5GBy88Jx0biygjVt7E Hbgrz/wu18w787Q93w0R2VhNbds66FuaojIoNLAr3i32zmyyK87j6E+k9RCelvJSZWTX mUuijE3j1KD/gPSnsF9dgzSk9F/gvLEdwI5rTvQaJZYDQUEeKHoeDxvoXgR3CtB2GEg1 5Mhg== 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=y3QIPNk+8o4XPNTxUwkKt4OvhsvkV40uuOIrtve2kJk=; b=lJoCTqtcakIOOqBXuO8ENwrkJPhpUUolMaQKXZUs1IOVPnK9SP+dWjBEQDhEiRXOzt Wp2vAYcuIlNuqY002JNrAJ/FJ63TDupCczGbscsSLLtG6h2guqwWPuGrhyABPXBapWTc JbA3pIRpaDcvq8oQO//aEn87RZ5ppnaD4auAp8GS9Q/XcMmLf2Q41INN0gp8h9d46dsP Ii2Nit5LXELE9pS9pB4b2AM/Y5KtrqwZEWjFMccaRNLfKt6wDxr11k9grBDitGr0eQ8t D13BBmqNxGKOk/vA84pIcWx7uqwwTZjepepnhejYCiAb9q0ynwdVTUVyco9Yh22yB82D Z3BA== X-Gm-Message-State: APt69E05a+VbPQ5k9P6682DQKLzackjjqBAXwIPPwEXR5TZNuIIXQGfa acEZnXpIg750HWdlDugd0a5KvAGK X-Received: by 2002:adf:f246:: with SMTP id b6-v6mr12301865wrp.235.1530284976310; Fri, 29 Jun 2018 08:09:36 -0700 (PDT) Received: from localhost.localdomain (uluru.liltaz.com. [163.172.81.188]) by smtp.googlemail.com with ESMTPSA id b6-v6sm11944222wro.52.2018.06.29.08.09.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jun 2018 08:09:35 -0700 (PDT) From: Jerome Brunet To: Liam Girdwood , Mark Brown Cc: Jerome Brunet , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/5] ASoC: es7134: add support for the es7154 Date: Fri, 29 Jun 2018 17:09:24 +0200 Message-Id: <20180629150924.18197-6-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180629150924.18197-1-jbrunet@baylibre.com> References: <20180629150924.18197-1-jbrunet@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for the es7154 which is basically an es7134 with an embedded power amplifier and lower maximum sample rate Signed-off-by: Jerome Brunet --- sound/soc/codecs/es7134.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) -- 2.14.4 diff --git a/sound/soc/codecs/es7134.c b/sound/soc/codecs/es7134.c index 5ad59c38fed1..935bed820ba5 100644 --- a/sound/soc/codecs/es7134.c +++ b/sound/soc/codecs/es7134.c @@ -33,6 +33,7 @@ struct es7134_clock_mode { }; struct es7134_chip { + struct snd_soc_dai_driver *dai_drv; const struct es7134_clock_mode *modes; unsigned int mode_num; }; @@ -159,6 +160,7 @@ static const struct es7134_clock_mode es7134_modes[] = { }; static const struct es7134_chip es7134_chip = { + .dai_drv = &es7134_dai, .modes = es7134_modes, .mode_num = ARRAY_SIZE(es7134_modes), }; @@ -189,6 +191,48 @@ static const struct snd_soc_component_driver es7134_component_driver = { .non_legacy_dai_naming = 1, }; +static struct snd_soc_dai_driver es7154_dai = { + .name = "es7154-hifi", + .playback = { + .stream_name = "Playback", + .channels_min = 2, + .channels_max = 2, + .rates = (SNDRV_PCM_RATE_8000_48000 | + SNDRV_PCM_RATE_88200 | + SNDRV_PCM_RATE_96000), + .formats = (SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S18_3LE | + SNDRV_PCM_FMTBIT_S20_3LE | + SNDRV_PCM_FMTBIT_S24_3LE | + SNDRV_PCM_FMTBIT_S24_LE), + }, + .ops = &es7134_dai_ops, +}; + +static const struct es7134_clock_mode es7154_modes[] = { + { + /* Single speed mode */ + .rate_min = 8000, + .rate_max = 50000, + .mclk_fs = (unsigned int[]) { 32, 64, 128, 192, 256, + 384, 512, 768, 1024 }, + .mclk_fs_num = 9, + }, { + /* Double speed mode */ + .rate_min = 84000, + .rate_max = 100000, + .mclk_fs = (unsigned int[]) { 128, 192, 256, 384, 512, + 768, 1024}, + .mclk_fs_num = 7, + } +}; + +static const struct es7134_chip es7154_chip = { + .dai_drv = &es7154_dai, + .modes = es7154_modes, + .mode_num = ARRAY_SIZE(es7154_modes), +}; + static int es7134_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -207,13 +251,14 @@ static int es7134_probe(struct platform_device *pdev) return devm_snd_soc_register_component(&pdev->dev, &es7134_component_driver, - &es7134_dai, 1); + priv->chip->dai_drv, 1); } #ifdef CONFIG_OF static const struct of_device_id es7134_ids[] = { { .compatible = "everest,es7134", .data = &es7134_chip }, { .compatible = "everest,es7144", .data = &es7134_chip }, + { .compatible = "everest,es7154", .data = &es7154_chip }, { } }; MODULE_DEVICE_TABLE(of, es7134_ids);