From patchwork Wed Oct 14 14:54:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 11837821 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D313C43457 for ; Wed, 14 Oct 2020 14:57:46 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B22A0212CC for ; Wed, 14 Oct 2020 14:57:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="QlhEi5Tw"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="gxZOPXc8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B22A0212CC Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D432A1701; Wed, 14 Oct 2020 16:56:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D432A1701 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1602687463; bh=jX2dI3DHKcqm2hTDQwa+PAO68+JbIJ4EJd1wCNKnmxI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=QlhEi5TwY7v37yzldbV0GrThs2oXSap0p9p582xLcZgOhmHN8Ce5YlxNtbekFth9+ aQfD0p+JnYvv1DgMgvAPjymGHHeqBMiZX/8JdcU3yFGgLkFtjEyHavvL0vc0IyJKqu s9TiZdfrsJeDNmVNxSrvyV8idxzKu8nmVHZ2reHA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6FC06F8027B; Wed, 14 Oct 2020 16:54:52 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7A6F6F80274; Wed, 14 Oct 2020 16:54:50 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AED5AF8012B for ; Wed, 14 Oct 2020 16:54:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AED5AF8012B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="gxZOPXc8" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 09EEpi80023902; Wed, 14 Oct 2020 09:54:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=bBy5LfwwfVhr4zvv5l4NPCrI6nTVQPaTkMub+rmgFxk=; b=gxZOPXc8QwDEzQqDTGtZbO5DfO6DSKg+wjfE1X9m3Bqe5hzADmst5JyK5K0XYS6fhCaU SmlanPYY1A7gJC5tKEzR5BUK3vZMf+f1njexcHG2YBsrOplWcxFaJDcditMVeEXIfZBg 6IjOTvyJ4agKeJjeLJyeSFI8nnkx1PCFtsetW9LZS9jnYmBQMCAClQu2eHBfIGmnMs5b 4+IBphedy5ZKDiPnnhWozco20jY7YdJKrJFmEMy4SsPD7pDGMGTdl9NgLp6ZLh8FvGK9 AmueFfVuC7HQj+hDMOTmCbrC4fjQd7AzBV2WGrLWMQOTFC0KGJkA75TzW/sDCbp90MPi Dg== Received: from ediex02.ad.cirrus.com ([87.246.76.36]) by mx0a-001ae601.pphosted.com with ESMTP id 343ac1wbwc-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 14 Oct 2020 09:54:35 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Wed, 14 Oct 2020 15:54:33 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Wed, 14 Oct 2020 15:54:33 +0100 Received: from AUSNPC0LSNW1-debian.ad.cirrus.com (ausnpc0lsnw1.ad.cirrus.com [198.61.64.143]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id A86102AA; Wed, 14 Oct 2020 14:54:32 +0000 (UTC) From: Richard Fitzgerald To: , , Subject: [PATCH 1/7] of: base: Add of_count_phandle_with_fixed_args() Date: Wed, 14 Oct 2020 15:54:12 +0100 Message-ID: <20201014145418.31838-2-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201014145418.31838-1-rf@opensource.cirrus.com> References: <20201014145418.31838-1-rf@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 impostorscore=0 mlxscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010140108 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, Richard Fitzgerald , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" Add an equivalent of of_count_phandle_with_args() for fixed argument sets, to pair with of_parse_phandle_with_fixed_args(). Signed-off-by: Richard Fitzgerald --- drivers/of/base.c | 42 ++++++++++++++++++++++++++++++++++++++++++ include/linux/of.h | 9 +++++++++ 2 files changed, 51 insertions(+) diff --git a/drivers/of/base.c b/drivers/of/base.c index ea44fea99813..45d8b0e65345 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1772,6 +1772,48 @@ int of_count_phandle_with_args(const struct device_node *np, const char *list_na } EXPORT_SYMBOL(of_count_phandle_with_args); +/** + * of_count_phandle_with_fixed_args() - Find the number of phandles references in a property + * @np: pointer to a device tree node containing a list + * @list_name: property name that contains a list + * @cell_count: number of argument cells following the phandle + * + * Returns the number of phandle + argument tuples within a property. It + * is a typical pattern to encode a list of phandle and variable + * arguments into a single property. + */ +int of_count_phandle_with_fixed_args(const struct device_node *np, + const char *list_name, + int cells_count) +{ + struct of_phandle_iterator it; + int rc, cur_index = 0; + + if (!cells_count) { + const __be32 *list; + int size; + + list = of_get_property(np, list_name, &size); + if (!list) + return -ENOENT; + + return size / sizeof(*list); + } + + rc = of_phandle_iterator_init(&it, np, list_name, NULL, cells_count); + if (rc) + return rc; + + while ((rc = of_phandle_iterator_next(&it)) == 0) + cur_index += 1; + + if (rc != -ENOENT) + return rc; + + return cur_index; +} +EXPORT_SYMBOL(of_count_phandle_with_fixed_args); + /** * __of_add_property - Add a property to a node without lock operations */ diff --git a/include/linux/of.h b/include/linux/of.h index 5cf7ae0465d1..9f315da4e9da 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -377,6 +377,8 @@ extern int of_parse_phandle_with_fixed_args(const struct device_node *np, struct of_phandle_args *out_args); extern int of_count_phandle_with_args(const struct device_node *np, const char *list_name, const char *cells_name); +extern int of_count_phandle_with_fixed_args(const struct device_node *np, + const char *list_name, int cells_count); /* phandle iterator functions */ extern int of_phandle_iterator_init(struct of_phandle_iterator *it, @@ -886,6 +888,13 @@ static inline int of_count_phandle_with_args(struct device_node *np, return -ENOSYS; } +static inline int of_count_phandle_with_fixed_args(const struct device_node *np, + const char *list_name, + int cells_count) +{ + return -ENOSYS; +} + static inline int of_phandle_iterator_init(struct of_phandle_iterator *it, const struct device_node *np, const char *list_name, From patchwork Wed Oct 14 14:54:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 11837817 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85F08C433E7 for ; Wed, 14 Oct 2020 14:57:00 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B83A422203 for ; Wed, 14 Oct 2020 14:56:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Kq2u+8Xw"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="eabBocoK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B83A422203 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C0226170F; Wed, 14 Oct 2020 16:56:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C0226170F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1602687416; bh=X6kvu6hIFvF4T6UIaZWyyUsUDClXVnGfSYO2/zrwt2c=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Kq2u+8XwbInsz+pWjDWTFW4uRAysU/MBb59ZiZXrkc6bccsKtGWODZx7Wi+rPwQto xsDjvgXSO+SVC9bo6ywDqs9Hf2YtfCRsCvU7d7UmcWqQXb9nIva7VGmggicViA8tXl Cmtou6CWO0Upe16hdi284uWMt+KnxbGZBWg+wxLM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 66732F800F6; Wed, 14 Oct 2020 16:54:50 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DD121F80274; Wed, 14 Oct 2020 16:54:48 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A6361F800F6 for ; Wed, 14 Oct 2020 16:54:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A6361F800F6 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="eabBocoK" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 09EEpi81023902; Wed, 14 Oct 2020 09:54:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=9XWilk56wxWCD+dN2HKKYxzBT3c3C3CzLDThlC0mYw4=; b=eabBocoKBbHpL8CBnl6EQsJ3xicnEwn4bHygmuM5SMyZaLd4gkz1FlRkjur/diDqQzPm xFvLPz4nSXxiyOAXV8704aG5rbXHkEng26U5nli7d3VNwgdd1OJVaNHw8OtlJNLM+dOT MzhYomqOEVKz4s5PBFaiKJOjxmr4qCPrAXtOVUeGybdaOvrV+lKNHNtEzyx7aMyamdkN o0ddqs0fwzY4drDsmgP08hyeTbgeZO0g3VvJ5yIps+fjaFNhHWk3rJJXgWOSNJBwU0ya bbzem/M9rAIk7K3IuIQIoEHnTlUmpX9C6pd7jkx6MBWO8G1Adeektg7hsfdwZpsh54nN JQ== Received: from ediex02.ad.cirrus.com ([87.246.76.36]) by mx0a-001ae601.pphosted.com with ESMTP id 343ac1wbwc-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 14 Oct 2020 09:54:35 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Wed, 14 Oct 2020 15:54:33 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Wed, 14 Oct 2020 15:54:33 +0100 Received: from AUSNPC0LSNW1-debian.ad.cirrus.com (ausnpc0lsnw1.ad.cirrus.com [198.61.64.143]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 2DC7A2C1; Wed, 14 Oct 2020 14:54:33 +0000 (UTC) From: Richard Fitzgerald To: , , Subject: [PATCH 2/7] ASoC: simple-card: Add plls and sysclks DT schema Date: Wed, 14 Oct 2020 15:54:13 +0100 Message-ID: <20201014145418.31838-3-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201014145418.31838-1-rf@opensource.cirrus.com> References: <20201014145418.31838-1-rf@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 impostorscore=0 mlxscore=0 spamscore=0 bulkscore=0 mlxlogscore=706 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010140108 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, Richard Fitzgerald , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" This adds the two new properties 'plls' and 'sysclks' to the dt bindings schema document. These add the ability to set values that will be passed to snd_soc_component_set_sysclk() and snd_soc_component_set_pll(). Signed-off-by: Richard Fitzgerald --- .../bindings/sound/simple-card.yaml | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/simple-card.yaml b/Documentation/devicetree/bindings/sound/simple-card.yaml index 35e669020296..48c9a4313d58 100644 --- a/Documentation/devicetree/bindings/sound/simple-card.yaml +++ b/Documentation/devicetree/bindings/sound/simple-card.yaml @@ -92,6 +92,25 @@ definitions: description: the widget names for which pin switches must be created. $ref: /schemas/types.yaml#/definitions/string-array + plls: + description: | + A list of component pll settings that will be applied with + snd_soc_component_set_pll. Each entry is a phandle to the node of the + codec or cpu component, followed by the four arguments id, source, + frequency_in, frequency_out. Multiple entries can have the same phandle + so that several plls can be set in the same component. + $ref: /schemas/types.yaml#/definitions/phandle-array + + sysclks: + description: | + A list of component sysclk settings that will be applied with + snd_soc_component_set_sysclk. Each entry is a phandle to the node of + the codec or cpu component, followed by the four arguments id, source, + frequency, direction. Direction is 0 if the clock is an input, 1 if it + is an output. Multiple entries can have the same phandle so that several + clocks can be set in the same component. + $ref: /schemas/types.yaml#/definitions/phandle-array + format: description: audio format. items: @@ -192,6 +211,10 @@ patternProperties: $ref: "#/definitions/prefix" "^simple-audio-card,pin-switches$": $ref: "#/definitions/pin-switches" + "^simple-audio-card,plls$": + $ref: "#/definitions/plls" + "^simple-audio-card,sysclks$": + $ref: "#/definitions/sysclks" "^simple-audio-card,hp-det-gpio$": maxItems: 1 "^simple-audio-card,mic-det-gpio$": @@ -489,3 +512,36 @@ examples: }; }; }; + +#-------------------- +# Codec with component PLL and SYSCLK settings +#-------------------- + - | + sound { + compatible = "simple-audio-card"; + + simple-audio-card,plls = < + &cs47l15 1 1 32768 98304000 + >; + + simple-audio-card,sysclks = < + &cs47l15 1 4 98304000 0 + &cs47l15 8 4 147456000 0 + >; + + simple-audio-card,format = "i2s"; + simple-audio-card,bitclock-master = <&cs47l15_codec_dai>; + simple-audio-card,frame-master = <&cs47l15_codec_dai>; + + simple-audio-card,cpu { + sound-dai = <&axi_i2s0 0>; + }; + + cs47l15_codec_dai: simple-audio-card,codec { + sound-dai = <&cs47l15 0>; + + /* Disable dai_set_sysclk() */ + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + }; From patchwork Wed Oct 14 14:54:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 11837805 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1CF2C433E7 for ; Wed, 14 Oct 2020 14:56:29 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9394122201 for ; Wed, 14 Oct 2020 14:56:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="qJAA3r3v"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="efVzKBfs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9394122201 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0A7FE1704; Wed, 14 Oct 2020 16:55:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0A7FE1704 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1602687386; bh=ZOGC66dD5XS7NfyU7caKHgexpElECZ8Tb4YjUI9rf/I=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qJAA3r3v77k3A9lCY/1oawGXdEdRdcU7dlEeqGHMSVm0NE5+HW+tJLh0iywS5PmFm sZh1g24/RTE0mHZcvI8qD+6kNXQUX8QWJgaH6mk4wMqn/OSNBWOribqVufQiGbPJiK e8O6K/QoN0HgpfzPutgGo0r1WLBp9sjWB/rjW3Tc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 32D1FF80217; Wed, 14 Oct 2020 16:54:47 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5A77AF8026C; Wed, 14 Oct 2020 16:54:45 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id ABFC3F80217 for ; Wed, 14 Oct 2020 16:54:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz ABFC3F80217 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="efVzKBfs" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 09EEpi83023902; Wed, 14 Oct 2020 09:54:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=fh+4rgHS0VmfLr4b6wdcLFhs1aYljIYED2WfDhiIjMQ=; b=efVzKBfsPYDai7Q3hc5q8+pxVQyK4DepbRAvhSii08BQBBmvfV8dwmj/DZ5BWeuleivp IIghH8/ZgjdGP9kIV1bD2bAqpksh7CSnmipgh3JXcWpEd+mbQrbsMWY3zjcFsttpMOaw AAZk/A0QSpahAP5Jkn/kump8LW7NWXHLLEVje0vfIFCcyzmNHaihCxRsJrw2eu4eWmbM Hsy1QEEI+JeMcmfCxwCO6t/lov5nhXAodkkAM+YrRuU26VUpaXvUqFJWj1+8VgRILi/b Ob+nX3m/XaYoNK2X/V6bTfOiufoS1UbbVif4P4ldGHZI+TwJipKsUHaNqC1Zt6S/GkfH 6Q== Received: from ediex02.ad.cirrus.com ([87.246.76.36]) by mx0a-001ae601.pphosted.com with ESMTP id 343ac1wbwc-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 14 Oct 2020 09:54:36 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Wed, 14 Oct 2020 15:54:34 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Wed, 14 Oct 2020 15:54:34 +0100 Received: from AUSNPC0LSNW1-debian.ad.cirrus.com (ausnpc0lsnw1.ad.cirrus.com [198.61.64.143]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id A46C22C6; Wed, 14 Oct 2020 14:54:33 +0000 (UTC) From: Richard Fitzgerald To: , , Subject: [PATCH 3/7] ASoC: simple-card: Support setting component plls and sysclks Date: Wed, 14 Oct 2020 15:54:14 +0100 Message-ID: <20201014145418.31838-4-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201014145418.31838-1-rf@opensource.cirrus.com> References: <20201014145418.31838-1-rf@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 impostorscore=0 mlxscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010140108 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, Richard Fitzgerald , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" Some codecs need plls and/or sysclks to be configured using the snd_soc_component_set_[sysclk|pll] functions. These drivers cannot necessarily be converted to use the clock framework. If the codec is on a I2C/SPI bus, a nested clk_get would be needed to enable the bus clock. But the clock framework does not support nested operations and this would deadlock. So it isn't possible to implement I2C/SPI connected pll/clock hardware through the clock framework. This patch adds new dt properties that list phandles of components with the pll/sysclk settings to be applied. Multiple settings can be given for the same phandle to allow for components with multiple clocks and plls. The plls and sysclks are enabled when the card bia level moves to STANDBY and disabled when it moved to OFF. As this is a _simple_ machine driver, the code does not attempt to handle specifying complex clock ordering interdependencies between components. The plls and sysclks are applied to a component as it is passed to the card set_bias_level/set_bias_level_post callbacks. It follows from this that the order components are configured is the order that they are passed to those callbacks. Signed-off-by: Richard Fitzgerald --- include/sound/simple_card_utils.h | 24 ++++ sound/soc/generic/simple-card-utils.c | 184 ++++++++++++++++++++++++++ sound/soc/generic/simple-card.c | 14 +- 3 files changed, 221 insertions(+), 1 deletion(-) diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index 86a1e956991e..67e9034ed807 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -38,6 +38,15 @@ struct asoc_simple_jack { struct snd_soc_jack_gpio gpio; }; +struct asoc_simple_sysclk_pll { + struct device_node *node; + int id; + int source; + unsigned int freq_in; + unsigned int freq_out; + int dir; +}; + struct asoc_simple_priv { struct snd_soc_card snd_card; struct simple_dai_props { @@ -56,6 +65,11 @@ struct asoc_simple_priv { struct asoc_simple_dai *dais; struct snd_soc_codec_conf *codec_conf; struct gpio_desc *pa_gpio; + + struct asoc_simple_sysclk_pll *sysclks; + int num_sysclks; + struct asoc_simple_sysclk_pll *plls; + int num_plls; }; #define simple_priv_to_card(priv) (&(priv)->snd_card) #define simple_priv_to_props(priv, i) ((priv)->dai_props + (i)) @@ -94,6 +108,14 @@ void asoc_simple_shutdown(struct snd_pcm_substream *substream); int asoc_simple_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params); int asoc_simple_dai_init(struct snd_soc_pcm_runtime *rtd); + +int asoc_simple_set_bias_level(struct snd_soc_card *card, + struct snd_soc_dapm_context *dapm, + enum snd_soc_bias_level level); +int asoc_simple_set_bias_level_post(struct snd_soc_card *card, + struct snd_soc_dapm_context *dapm, + enum snd_soc_bias_level level); + int asoc_simple_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params); @@ -128,6 +150,8 @@ int asoc_simple_parse_widgets(struct snd_soc_card *card, char *prefix); int asoc_simple_parse_pin_switches(struct snd_soc_card *card, char *prefix); +int asoc_simple_parse_sysclks(struct asoc_simple_priv *priv, char *prefix); +int asoc_simple_parse_plls(struct asoc_simple_priv *priv, char *prefix); int asoc_simple_init_jack(struct snd_soc_card *card, struct asoc_simple_jack *sjack, diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 6cada4c1e283..6c0675187285 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -399,6 +399,123 @@ int asoc_simple_dai_init(struct snd_soc_pcm_runtime *rtd) } EXPORT_SYMBOL_GPL(asoc_simple_dai_init); +static bool asoc_simple_node_is_component(struct snd_soc_component *component, + struct device_node *node) +{ + struct device_node *comp_node; + + comp_node = component->dev->of_node; + if (!comp_node && component->dev->parent) + comp_node = component->dev->parent->of_node; + + return (comp_node == node); +} + +int asoc_simple_set_bias_level(struct snd_soc_card *card, + struct snd_soc_dapm_context *dapm, + enum snd_soc_bias_level level) +{ + struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(card); + struct snd_soc_component *component = dapm->component; + int i, ret; + + if (!component) + return 0; + + switch (level) { + case SND_SOC_BIAS_STANDBY: + if (dapm->bias_level != SND_SOC_BIAS_OFF) + break; + + /* PLLs normally supply SYSCLKs so enable the PLLs first. */ + for (i = 0; i < priv->num_plls; ++i) { + if (!asoc_simple_node_is_component(component, priv->plls[i].node)) + continue; + + ret = snd_soc_component_set_pll(component, + priv->plls[i].id, + priv->plls[i].source, + priv->plls[i].freq_in, + priv->plls[i].freq_out); + if (ret) { + dev_err(card->dev, "Failed to set pll for %s: %d\n", + component->name, ret); + return ret; + } + } + + for (i = 0; i < priv->num_sysclks; ++i) { + if (!asoc_simple_node_is_component(component, priv->sysclks[i].node)) + continue; + + ret = snd_soc_component_set_sysclk(component, + priv->sysclks[i].id, + priv->sysclks[i].source, + priv->sysclks[i].freq_in, + priv->sysclks[i].dir); + if (ret) { + dev_err(card->dev, "Failed to set sysclk for %s: %d\n", + component->name, ret); + return ret; + } + } + break; + default: + break; + } + + return 0; +} +EXPORT_SYMBOL_GPL(asoc_simple_set_bias_level); + +int asoc_simple_set_bias_level_post(struct snd_soc_card *card, + struct snd_soc_dapm_context *dapm, + enum snd_soc_bias_level level) +{ + struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(card); + struct snd_soc_component *component = dapm->component; + int i, ret; + + if (!component) + goto out; + + switch (level) { + case SND_SOC_BIAS_OFF: + for (i = 0; i < priv->num_sysclks; ++i) { + if (!asoc_simple_node_is_component(component, priv->sysclks[i].node)) + continue; + + ret = snd_soc_component_set_sysclk(component, + priv->sysclks[i].id, + 0, + 0, + priv->sysclks[i].dir); + if (ret) + dev_warn(card->dev, "Failed to set sysclk for %s: %d\n", + component->name, ret); + } + + for (i = 0; i < priv->num_plls; ++i) { + if (!asoc_simple_node_is_component(component, priv->plls[i].node)) + continue; + + ret = snd_soc_component_set_pll(component, priv->plls[i].id, 0, 0, 0); + if (ret) + dev_warn(card->dev, "Failed to set pll for %s: %d\n", + component->name, ret); + } + break; + default: + break; + } + +out: + dapm->bias_level = level; + + return 0; +} +EXPORT_SYMBOL_GPL(asoc_simple_set_bias_level_post); + void asoc_simple_canonicalize_platform(struct snd_soc_dai_link *dai_link) { /* Assumes platform == cpu */ @@ -433,6 +550,7 @@ EXPORT_SYMBOL_GPL(asoc_simple_canonicalize_cpu); int asoc_simple_clean_reference(struct snd_soc_card *card) { + struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(card); struct snd_soc_dai_link *dai_link; int i; @@ -440,6 +558,13 @@ int asoc_simple_clean_reference(struct snd_soc_card *card) of_node_put(dai_link->cpus->of_node); of_node_put(dai_link->codecs->of_node); } + + for (i = 0; i < priv->num_sysclks; ++i) + of_node_put(priv->sysclks[i].node); + + for (i = 0; i < priv->num_plls; ++i) + of_node_put(priv->plls[i].node); + return 0; } EXPORT_SYMBOL_GPL(asoc_simple_clean_reference); @@ -538,6 +663,65 @@ int asoc_simple_parse_pin_switches(struct snd_soc_card *card, } EXPORT_SYMBOL_GPL(asoc_simple_parse_pin_switches); +static int asoc_simple_parse_sysclks_plls(struct asoc_simple_priv *priv, + char *prefix, + char *prop_root_name, + struct asoc_simple_sysclk_pll **out, + int *out_count) +{ + struct device *dev = priv->snd_card.dev; + struct device_node *node = dev->of_node; + struct of_phandle_args args; + int n_elem, i, ret; + char prop[128]; + + if (!prefix) + prefix = ""; + + snprintf(prop, sizeof(prop), "%s%s", prefix, prop_root_name); + n_elem = of_count_phandle_with_fixed_args(node, prop, 4); + if (n_elem == -ENOENT || n_elem == 0) { + return 0; + } else if (n_elem < 0) { + dev_err(dev, "Failed to parse %s: %d\n", prop, n_elem); + return n_elem; + } + + *out = devm_kcalloc(dev, n_elem, sizeof(**out), GFP_KERNEL); + if (!*out) + return -ENOMEM; + *out_count = n_elem; + + for (i = 0; i < n_elem; ++i) { + ret = of_parse_phandle_with_fixed_args(node, prop, 4, i, &args); + if (ret < 0) + return ret; + + (*out)[i].node = args.np; + (*out)[i].id = args.args[0]; + (*out)[i].source = args.args[1]; + (*out)[i].freq_in = args.args[2]; + (*out)[i].dir = args.args[3]; /* for sysclks */ + (*out)[i].freq_out = args.args[3]; /* for plls */ + } + + return 0; +} + +int asoc_simple_parse_sysclks(struct asoc_simple_priv *priv, char *prefix) +{ + return asoc_simple_parse_sysclks_plls(priv, prefix, "sysclks", + &priv->sysclks, &priv->num_sysclks); +} +EXPORT_SYMBOL_GPL(asoc_simple_parse_sysclks); + +int asoc_simple_parse_plls(struct asoc_simple_priv *priv, char *prefix) +{ + return asoc_simple_parse_sysclks_plls(priv, prefix, "plls", + &priv->plls, &priv->num_plls); +} +EXPORT_SYMBOL_GPL(asoc_simple_parse_plls); + int asoc_simple_init_jack(struct snd_soc_card *card, struct asoc_simple_jack *sjack, int is_hp, char *prefix, diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 75365c7bb393..52c5f737f350 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -475,6 +475,14 @@ static int simple_parse_of(struct asoc_simple_priv *priv) ret = snd_soc_of_parse_aux_devs(card, PREFIX "aux-devs"); + ret = asoc_simple_parse_sysclks(priv, PREFIX); + if (ret < 0) + return ret; + + ret = asoc_simple_parse_plls(priv, PREFIX); + if (ret < 0) + return ret; + return ret; } @@ -604,6 +612,7 @@ static int asoc_simple_probe(struct platform_device *pdev) card->owner = THIS_MODULE; card->dev = dev; card->probe = simple_soc_probe; + snd_soc_card_set_drvdata(card, priv); memset(&li, 0, sizeof(li)); simple_get_dais_count(priv, &li); @@ -672,7 +681,10 @@ static int asoc_simple_probe(struct platform_device *pdev) sizeof(*dai_props->codec_dai)); } - snd_soc_card_set_drvdata(card, priv); + if (priv->num_sysclks || priv->num_plls) { + card->set_bias_level = asoc_simple_set_bias_level; + card->set_bias_level_post = asoc_simple_set_bias_level_post; + } asoc_simple_debug_info(priv); From patchwork Wed Oct 14 14:54:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 11837819 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3687C433E7 for ; Wed, 14 Oct 2020 14:57:19 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8030F212CC for ; Wed, 14 Oct 2020 14:57:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="KxSvukYH"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="jxjvblyt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8030F212CC Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CE8F6171F; Wed, 14 Oct 2020 16:56:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CE8F6171F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1602687436; bh=/JCqfFPvIZQWy7zae1pFuf6ei7QWGAUqhJpcWb1CFGM=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=KxSvukYHSYLOkOukn0MqBlCWI8TgqlGIcEFqpEbM5z1GWTOiA4/paWlb4TbtqdLdP +kHiAFCDi8U7gxGnJz3vZ2dq3Yb+UianJ3PBVSyjQPWrKmUWFHN4YiH5lj/epMFijM LF48tTyw0MHQkTNsGAYCJZ/XximMZk8Y99Q9jIs0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A1647F8026C; Wed, 14 Oct 2020 16:54:51 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 16CB5F8026D; Wed, 14 Oct 2020 16:54:50 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B1DDFF80224 for ; Wed, 14 Oct 2020 16:54:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B1DDFF80224 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="jxjvblyt" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 09EEpi82023902; Wed, 14 Oct 2020 09:54:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=PfQTmtHq+WI6K5BmMwZ1tOrR7fNGk/HI3b3fMtqo+rw=; b=jxjvblytI4yQ9MH61vjajfiLxnq2TvtBFMezOJZ38HrUGNUFoxxYV7e9JJJeSLcxp2NR 1U0EndMf811qu5UdlBQaaJdPpn6een4Wwxeds5buMehfAmHvrvZXATghdbdw0SrbiSlN SCz8btFQGOu22uJq2r59DdMywQpPmktHauAuHegdjBRy75x59MLxwPMhr2xskYVsqTqV jb7LvTd7g3Ow6lzmnEDx9OUadrRXTXuP8M7hLLPWmbzPMPI09nXewP3m2tnuoUfEQTe6 UzyZfIkZwfPraAFxgdrvX78ISep/HghC/3n/hXDa1MPibq6oiRTIF2WNV9nNMw6XIDs9 Gw== Received: from ediex01.ad.cirrus.com ([87.246.76.36]) by mx0a-001ae601.pphosted.com with ESMTP id 343ac1wbwq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 14 Oct 2020 09:54:36 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Wed, 14 Oct 2020 15:54:34 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Wed, 14 Oct 2020 15:54:34 +0100 Received: from AUSNPC0LSNW1-debian.ad.cirrus.com (ausnpc0lsnw1.ad.cirrus.com [198.61.64.143]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 2DEFD45; Wed, 14 Oct 2020 14:54:34 +0000 (UTC) From: Richard Fitzgerald To: , , Subject: [PATCH 4/7] ASoC: arizona: Allow codecs to be selected from kernel config Date: Wed, 14 Oct 2020 15:54:15 +0100 Message-ID: <20201014145418.31838-5-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201014145418.31838-1-rf@opensource.cirrus.com> References: <20201014145418.31838-1-rf@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 impostorscore=0 mlxscore=0 spamscore=0 bulkscore=0 mlxlogscore=743 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010140108 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, Richard Fitzgerald , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" The codec Kconfig options were hidden and intended to be selected by the machine driver that requires them. But that means having either a dedicated machine driver or building all codecs. This patch makes the Kconfig options visible so that they can be selected independently of the machine driver, allowing the codec to be used with simple-card and other machine drivers that are not hardcoded to use a fixed set of codecs. Signed-off-by: Richard Fitzgerald Reported-by: kernel test robot --- sound/soc/codecs/Kconfig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 34c6dd04b85a..4a8d503bdd38 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -661,7 +661,7 @@ config SND_SOC_CS47L15 tristate config SND_SOC_CS47L24 - tristate + tristate "Cirrus Logic CS47L24 CODEC" depends on MFD_CS47L24 config SND_SOC_CS47L35 @@ -1484,11 +1484,11 @@ config SND_SOC_WM5100 depends on I2C config SND_SOC_WM5102 - tristate + tristate "Cirrus Logic WM5102 CODEC" depends on MFD_WM5102 config SND_SOC_WM5110 - tristate + tristate "Cirrus Logic WM5110 CODEC" depends on MFD_WM5110 config SND_SOC_WM8350 @@ -1657,7 +1657,7 @@ config SND_SOC_WM8997 depends on MFD_WM8997 config SND_SOC_WM8998 - tristate + tristate "Cirrus Logic WM8998 CODEC" depends on MFD_WM8998 config SND_SOC_WM9081 From patchwork Wed Oct 14 14:54:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 11837825 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D90EDC433DF for ; Wed, 14 Oct 2020 14:58:04 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 193D5212CC for ; Wed, 14 Oct 2020 14:58:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="uuzTyuAb"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="P8BfR/49" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 193D5212CC Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6C9711738; Wed, 14 Oct 2020 16:57:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6C9711738 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1602687482; bh=IxleBAzyaOz9FIbf0yzIQ5tTDPmJiDhyRtD44QtP7Gk=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=uuzTyuAb3PMw7R3FCxXhmUrQE7r0ezAXoNi4LllEwAF2ed3qPodUwSQnfptUk3qMd n5ifTl8Edm3BCP7nATjYj47/EO2Wnpx1WZvvV28mYAcvrcJImyiU5va/th/IycTpH4 2r3q2bczwNVd0S4tdeR3joHLWqoC0WLYdm5Bv/UY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2DAEFF80289; Wed, 14 Oct 2020 16:54:53 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 86DF6F8012B; Wed, 14 Oct 2020 16:54:50 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 23088F80225 for ; Wed, 14 Oct 2020 16:54:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 23088F80225 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="P8BfR/49" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 09EEpi84023902; Wed, 14 Oct 2020 09:54:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=rEkfyGQEhOwwT47AjLx9+bGijiBq7azRzUX3JTht/hM=; b=P8BfR/49dgWL+D9UmfaLEhemZV5LZOPCFByp2WEpVYE1XLxca/r9P+XLa/jzVi2CIgxF xfmhfacziX467RINc/xW1CjzlGL56Dmdn+tLRlehmdKWsxqhzpp+9Ak3Ez1NBvppv5QO ZemCPxD1/kidhxPjT/QExaPZC2VK3VjQTHb5ZPA2V7BJ10r31kO+a9MpVllsoldmCnzw fnLznLN3VL+vFKtsNElKswoiE0laCotOwMli8uWinMUrMOA2fB8WW8j3w1sO7965CGnX 2BN7rcW9l8zWs8lhTJrilTUjMQ8ccFu+6Eodl5XXeTnCA10FR/kwQqZFPAp6Wkc3BCmR mw== Received: from ediex02.ad.cirrus.com ([87.246.76.36]) by mx0a-001ae601.pphosted.com with ESMTP id 343ac1wbwc-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 14 Oct 2020 09:54:37 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Wed, 14 Oct 2020 15:54:35 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Wed, 14 Oct 2020 15:54:35 +0100 Received: from AUSNPC0LSNW1-debian.ad.cirrus.com (ausnpc0lsnw1.ad.cirrus.com [198.61.64.143]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id A1A362AA; Wed, 14 Oct 2020 14:54:34 +0000 (UTC) From: Richard Fitzgerald To: , , Subject: [PATCH 5/7] ASoC: madera: Allow codecs to be selected from kernel config Date: Wed, 14 Oct 2020 15:54:16 +0100 Message-ID: <20201014145418.31838-6-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201014145418.31838-1-rf@opensource.cirrus.com> References: <20201014145418.31838-1-rf@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 impostorscore=0 mlxscore=0 spamscore=0 bulkscore=0 mlxlogscore=863 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010140108 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, Richard Fitzgerald , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" The codec Kconfig options were hidden and intended to be selected by the machine driver that requires them. But that means having either a dedicated machine driver or building all codecs. This patch makes the Kconfig options visible so that they can be selected independently of the machine driver, allowing the codec to be used with simple-card and other machine drivers that are not hardcoded to use a fixed set of codecs. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/Kconfig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 4a8d503bdd38..e0aed608dbc3 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -658,23 +658,23 @@ config SND_SOC_CS4349 depends on I2C config SND_SOC_CS47L15 - tristate + tristate "Cirrus Logic CS47L15 CODEC" config SND_SOC_CS47L24 tristate "Cirrus Logic CS47L24 CODEC" depends on MFD_CS47L24 config SND_SOC_CS47L35 - tristate + tristate "Cirrus Logic CS47L35 CODEC" config SND_SOC_CS47L85 - tristate + tristate "Cirrus Logic CS47L85 CODEC" config SND_SOC_CS47L90 - tristate + tristate "Cirrus Logic CS47L90 CODEC" config SND_SOC_CS47L92 - tristate + tristate "Cirrus Logic CS47L92 CODEC" # Cirrus Logic Quad-Channel ADC config SND_SOC_CS53L30 From patchwork Wed Oct 14 14:54:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 11837827 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7758BC433DF for ; Wed, 14 Oct 2020 14:58:44 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1A92D212CC for ; Wed, 14 Oct 2020 14:58:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="NCOzUthB"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="FwuakYIu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A92D212CC Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6EA311721; Wed, 14 Oct 2020 16:57:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6EA311721 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1602687521; bh=Rord+He/z1lh82d9exeMAavaxSJ6FMYh6Iks54S3Rbk=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=NCOzUthB3SYTdusp4e92zncoYbXZRA7+QutzNjal/kKmgcfTP9a4Esw1DnuXIKrxm D1pY1mXKxZmHU5paeznwCbunVpUweUGyPdYrZnpK5Q9QwHXuGIZ5bp0CkGtlKy7lZn qgb8+j8DGIgRXMRPQ/q3M/xew37jwNlPpNejmHCQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 84A77F802A1; Wed, 14 Oct 2020 16:54:54 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A7624F80226; Wed, 14 Oct 2020 16:54:51 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DBF09F80226 for ; Wed, 14 Oct 2020 16:54:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DBF09F80226 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="FwuakYIu" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 09EEpi85023902; Wed, 14 Oct 2020 09:54:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=6q42qWMD+D2lwT7KzTwshNAxwHn6MNlVYveR8WVXLAg=; b=FwuakYIuTK2dq/uIj3cjOMtUZPxP7seXwxqFPYF/wQ9+p9DLTaF5VA+2rDaQaH5QCtSU GR5yaBWRi9BVP5SCYhK/lyNMtRa3rth5u2lxLoha6owZFI+zJSNcTlpzSpfh0/kT069J B0CIiAyJYKrumKb/S2PzwLbSa98mwwjzlG0WKqZDTdDb0qNGSS1R7RM6FYb4A4Y8E+us W64dcZ18SLLLsqFRp6JMQ8WPdx46bn8cPEyfKuBntyIyEYPllpyiEeZAcx4xACLZrc+X ZfIpL25F7dh+z1JgZYuc5rzNxgg5Dl8EEgRhg5tdMEFAA8+fgeOoguigFm3MgI/NAKuu Ow== Received: from ediex02.ad.cirrus.com ([87.246.76.36]) by mx0a-001ae601.pphosted.com with ESMTP id 343ac1wbwc-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 14 Oct 2020 09:54:38 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Wed, 14 Oct 2020 15:54:35 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Wed, 14 Oct 2020 15:54:35 +0100 Received: from AUSNPC0LSNW1-debian.ad.cirrus.com (ausnpc0lsnw1.ad.cirrus.com [198.61.64.143]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 1DC2345; Wed, 14 Oct 2020 14:54:35 +0000 (UTC) From: Richard Fitzgerald To: , , Subject: [PATCH 6/7] ARM: dts: Add dts for Raspberry Pi 4 + Cirrus Logic Lochnagar2 Date: Wed, 14 Oct 2020 15:54:17 +0100 Message-ID: <20201014145418.31838-7-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201014145418.31838-1-rf@opensource.cirrus.com> References: <20201014145418.31838-1-rf@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 impostorscore=0 mlxscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010140108 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, Richard Fitzgerald , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" This is based on the default bcm2711-rpi-4-b.dts. Configurations are provided for Cirrus Logic codecs CS42L92, CS47L15, CS47L24, CS47L35, CS47L90 and WM8998. For each codec there is a sound node and a codec device node and both default to disabled. Enable the pair for the codec in use. Signed-off-by: Richard Fitzgerald --- arch/arm/boot/dts/Makefile | 1 + .../dts/bcm2711-rpi4b-cirrus-lochnagar.dts | 1296 +++++++++++++++++ 2 files changed, 1297 insertions(+) create mode 100644 arch/arm/boot/dts/bcm2711-rpi4b-cirrus-lochnagar.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 4572db3fa5ae..53db1be9552d 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -92,6 +92,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \ bcm2837-rpi-3-b-plus.dtb \ bcm2837-rpi-cm3-io3.dtb \ bcm2711-rpi-4-b.dtb \ + bcm2711-rpi4b-cirrus-lochnagar.dtb \ bcm2835-rpi-zero.dtb \ bcm2835-rpi-zero-w.dtb dtb-$(CONFIG_ARCH_BCM_5301X) += \ diff --git a/arch/arm/boot/dts/bcm2711-rpi4b-cirrus-lochnagar.dts b/arch/arm/boot/dts/bcm2711-rpi4b-cirrus-lochnagar.dts new file mode 100644 index 000000000000..80e31ea39af5 --- /dev/null +++ b/arch/arm/boot/dts/bcm2711-rpi4b-cirrus-lochnagar.dts @@ -0,0 +1,1296 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; +#include "bcm2711.dtsi" +#include "bcm2835-rpi.dtsi" +#include "bcm283x-rpi-usb-peripheral.dtsi" +#include +#include +#include +#include +#include + +/ { + compatible = "raspberrypi,4-model-b", "brcm,bcm2711"; + model = "Raspberry Pi 4 Model B"; + + chosen { + /* 8250 auxiliary UART instead of pl011 */ + stdout-path = "serial1:115200n8"; + }; + + /* Will be filled by the bootloader */ + memory@0 { + device_type = "memory"; + reg = <0 0 0>; + }; + + aliases { + emmc2bus = &emmc2bus; + ethernet0 = &genet; + pcie0 = &pcie0; + }; + + leds { + act { + gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; + }; + + pwr { + label = "PWR"; + gpios = <&expgpio 2 GPIO_ACTIVE_LOW>; + default-state = "keep"; + linux,default-trigger = "default-on"; + }; + }; + + wifi_pwrseq: wifi-pwrseq { + compatible = "mmc-pwrseq-simple"; + reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>; + }; + + sd_io_1v8_reg: sd_io_1v8_reg { + compatible = "regulator-gpio"; + regulator-name = "vdd-sd-io"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + regulator-settling-time-us = <5000>; + gpios = <&expgpio 4 GPIO_ACTIVE_HIGH>; + states = <1800000 0x1 + 3300000 0x0>; + status = "okay"; + }; + + sd_vcc_reg: sd_vcc_reg { + compatible = "regulator-fixed"; + regulator-name = "vcc-sd"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + enable-active-high; + gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>; + }; + + wallvdd: wallvdd@0 { + compatible = "regulator-fixed"; + + regulator-name = "WALL_VDD_5V"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-boot-on; + regulator-always-on; + }; + + sound-cs47l15 { + status = "disabled"; + + compatible = "simple-audio-card"; + #address-cells = <1>; + #size-cells = <0>; + + simple-audio-card,name = "Cirrus Logic CS47L15"; + + simple-audio-card,sysclks = < + &cs47l15 1 4 98304000 0 + &cs47l15 8 4 147456000 0 + >; + simple-audio-card,plls = < + &cs47l15 1 0 24576000 98304000 + >; + + simple-audio-card,widgets = + "Microphone", "Microphone Jack", + "Headphone", "Headphone Jack"; + + simple-audio-card,routing = + "Microphone Jack", "MICBIAS1A", + "Microphone Jack", "MICBIAS1B", + "IN1BRN", "Microphone Jack", + "IN1BRP", "Microphone Jack", + "Headphone Jack", "HPOUTL", + "Headphone Jack", "HPOUTR"; + + /* Host->Codec I2S */ + simple-audio-card,dai-link@0 { + reg = <0>; + format = "i2s"; + bitclock-master = <&cs47l15_codec_dai>; + frame-master = <&cs47l15_codec_dai>; + + cpu { + sound-dai = <&i2s 0>; + }; + + cs47l15_codec_dai: codec { + sound-dai = <&cs47l15 0>; + + /* Prevent calls to dai_set_sysclk() */ + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + }; + + /* Debug trace compressed stream */ + simple-audio-card,dai-link@1 { + reg = <1>; + + cpu { + sound-dai = <&cs47l15 3>; + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + + codec { + sound-dai = <&cs47l15 4>; + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + }; + }; + + sound-cs47l24 { + status = "disabled"; + + compatible = "simple-audio-card"; + #address-cells = <1>; + #size-cells = <0>; + + simple-audio-card,name = "Cirrus Logic CS47L24"; + + simple-audio-card,sysclks = < + &cs47l24 1 4 147456000 0 + >; + simple-audio-card,plls = < + &cs47l24 1 0 24576000 147456000 /* fll1 */ + &cs47l24 3 1 32768 0 /* fll1 refclk */ + >; + + simple-audio-card,widgets = + "Microphone", "Microphone Jack", + "Headphone", "Headphone Jack"; + + simple-audio-card,routing = + "Microphone Jack", "MICBIAS1", + "Microphone Jack", "MICBIAS2", + "IN1L", "Microphone Jack", + "IN1R", "Microphone Jack", + "Headphone Jack", "HPOUT1L", + "Headphone Jack", "HPOUT1R"; + + /* Host->Codec I2S */ + simple-audio-card,dai-link@0 { + reg = <0>; + format = "i2s"; + bitclock-master = <&cs47l24_codec_dai>; + frame-master = <&cs47l24_codec_dai>; + + cpu { + sound-dai = <&i2s 0>; + }; + + cs47l24_codec_dai: codec { + sound-dai = <&cs47l24 0>; + + /* Prevent calls to dai_set_sysclk() */ + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + }; + + /* Debug trace compressed stream */ + simple-audio-card,dai-link@1 { + reg = <1>; + + cpu { + sound-dai = <&cs47l24 5>; + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + + codec { + sound-dai = <&cs47l24 6>; + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + }; + + /* Voice control compressed stream */ + simple-audio-card,dai-link@2 { + reg = <2>; + + cpu { + sound-dai = <&cs47l24 3>; + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + + codec { + sound-dai = <&cs47l24 4>; + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + }; + }; + + sound-cs47l35 { + status = "disabled"; + + compatible = "simple-audio-card"; + #address-cells = <1>; + #size-cells = <0>; + + simple-audio-card,name = "Cirrus Logic CS47L35"; + + simple-audio-card,sysclks = < + &cs47l35 1 4 98304000 0 + &cs47l35 8 4 147456000 0 + >; + simple-audio-card,plls = < + &cs47l35 1 0 24576000 98304000 + >; + + simple-audio-card,widgets = + "Microphone", "Microphone Jack", + "Headphone", "Headphone Jack"; + + simple-audio-card,routing = + "Microphone Jack", "MICBIAS1A", + "Microphone Jack", "MICBIAS2A", + "IN1BLN", "Microphone Jack", + "IN1BLP", "Microphone Jack", + "Headphone Jack", "HPOUTL", + "Headphone Jack", "HPOUTR"; + + /* Host->Codec I2S */ + simple-audio-card,dai-link@0 { + reg = <0>; + format = "i2s"; + bitclock-master = <&cs47l35_codec_dai>; + frame-master = <&cs47l35_codec_dai>; + + cpu { + sound-dai = <&i2s 0>; + }; + + cs47l35_codec_dai: codec { + sound-dai = <&cs47l35 0>; + + /* Prevent calls to dai_set_sysclk() */ + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + }; + + /* Debug trace compressed stream */ + simple-audio-card,dai-link@1 { + reg = <1>; + + cpu { + sound-dai = <&cs47l35 7>; + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + + codec { + sound-dai = <&cs47l35 8>; + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + }; + + /* Voice control compressed stream */ + simple-audio-card,dai-link@2 { + reg = <2>; + + cpu { + sound-dai = <&cs47l35 5>; + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + + codec { + sound-dai = <&cs47l35 6>; + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + }; + }; + + sound-cs47l90 { + status = "disabled"; + + compatible = "simple-audio-card"; + #address-cells = <1>; + #size-cells = <0>; + + simple-audio-card,name = "Cirrus Logic CS47L90"; + + simple-audio-card,sysclks = < + &cs47l90 1 4 98304000 0 + &cs47l90 8 4 147456000 0 + >; + simple-audio-card,plls = < + &cs47l90 1 0 24576000 98304000 + >; + + simple-audio-card,widgets = + "Microphone", "Microphone Jack", + "Headphone", "Headphone Jack"; + + simple-audio-card,routing = + "Microphone Jack", "MICBIAS1A", + "Microphone Jack", "MICBIAS2A", + "IN1BRN", "Microphone Jack", + "IN1BRP", "Microphone Jack", + "Headphone Jack", "HPOUT1L", + "Headphone Jack", "HPOUT1R"; + + /* Host->Codec I2S */ + simple-audio-card,dai-link@0 { + reg = <0>; + format = "i2s"; + bitclock-master = <&cs47l90_codec_dai>; + frame-master = <&cs47l90_codec_dai>; + + cpu { + sound-dai = <&i2s 0>; + }; + + cs47l90_codec_dai: codec { + sound-dai = <&cs47l90 0>; + + /* Prevent calls to dai_set_sysclk() */ + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + }; + + /* Debug trace compressed stream */ + simple-audio-card,dai-link@1 { + reg = <1>; + + cpu { + sound-dai = <&cs47l90 9>; + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + + codec { + sound-dai = <&cs47l90 10>; + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + }; + + /* Voice control compressed stream */ + simple-audio-card,dai-link@2 { + reg = <2>; + + cpu { + sound-dai = <&cs47l90 7>; + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + + codec { + sound-dai = <&cs47l90 8>; + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + }; + }; + + sound-cs42l92 { + status = "disabled"; + + compatible = "simple-audio-card"; + #address-cells = <1>; + #size-cells = <0>; + + simple-audio-card,name = "Cirrus Logic CS42L92"; + + simple-audio-card,sysclks = < + &cs42l92 1 4 98304000 0 + >; + simple-audio-card,plls = < + &cs42l92 1 0 24576000 98304000 + >; + + simple-audio-card,widgets = + "Microphone", "Microphone Jack", + "Headphone", "Headphone Jack"; + + simple-audio-card,routing = + "Microphone Jack", "MICBIAS1A", + "Microphone Jack", "MICBIAS1B", + "IN1BLN", "Microphone Jack", + "IN1BLP", "Microphone Jack", + "Headphone Jack", "HPOUT1L", + "Headphone Jack", "HPOUT1R"; + + /* Host->Codec I2S */ + simple-audio-card,dai-link@0 { + reg = <0>; + format = "i2s"; + bitclock-master = <&cs42l92_codec_dai>; + frame-master = <&cs42l92_codec_dai>; + + cpu { + sound-dai = <&i2s 0>; + }; + + cs42l92_codec_dai: codec { + sound-dai = <&cs42l92 0>; + + /* Prevent calls to dai_set_sysclk() */ + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + }; + }; + + sound-wm8998 { + status = "disabled"; + + compatible = "simple-audio-card"; + #address-cells = <1>; + #size-cells = <0>; + + simple-audio-card,name = "Cirrus Logic WM8998"; + + simple-audio-card,sysclks = < + &wm8998 1 4 49152000 0 + >; + simple-audio-card,plls = < + &wm8998 1 0 24576000 49152000 + &wm8998 3 1 32768 0 + >; + + simple-audio-card,widgets = + "Microphone", "Microphone Jack", + "Headphone", "Headphone Jack"; + + simple-audio-card,routing = + "Microphone Jack", "MICBIAS1", + "Microphone Jack", "MICBIAS1", + "IN2B", "Microphone Jack", + "Headphone Jack", "HPOUTL", + "Headphone Jack", "HPOUTR"; + + /* Host->Codec I2S */ + simple-audio-card,dai-link@0 { + reg = <0>; + format = "i2s"; + bitclock-master = <&wm8998_codec_dai>; + frame-master = <&wm8998_codec_dai>; + + cpu { + sound-dai = <&i2s 0>; + }; + + wm8998_codec_dai: codec { + sound-dai = <&wm8998 0>; + + /* Prevent calls to dai_set_sysclk() */ + system-clock-frequency = <0>; + mclk-fs = <0>; + }; + }; + }; +}; + +&firmware { + firmware_clocks: clocks { + compatible = "raspberrypi,firmware-clocks"; + #clock-cells = <1>; + }; + + expgpio: gpio { + compatible = "raspberrypi,firmware-gpio"; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = "BT_ON", + "WL_ON", + "PWR_LED_OFF", + "GLOBAL_RESET", + "VDD_SD_IO_SEL", + "CAM_GPIO", + "SD_PWR_ON", + ""; + status = "okay"; + }; +}; + +&gpio { + /* + * Parts taken from rpi_SCH_4b_4p0_reduced.pdf and + * the official GPU firmware DT blob. + * + * Legend: + * "FOO" = GPIO line named "FOO" on the schematic + * "FOO_N" = GPIO line named "FOO" on schematic, active low + */ + gpio-line-names = "ID_SDA", + "ID_SCL", + "SDA1", + "SCL1", + "GPIO_GCLK", + "GPIO5", + "GPIO6", + "SPI_CE1_N", + "SPI_CE0_N", + "SPI_MISO", + "SPI_MOSI", + "SPI_SCLK", + "GPIO12", + "GPIO13", + /* Serial port */ + "TXD1", + "RXD1", + "GPIO16", + "GPIO17", + "GPIO18", + "GPIO19", + "GPIO20", + "GPIO21", + "GPIO22", + "GPIO23", + "GPIO24", + "GPIO25", + "GPIO26", + "GPIO27", + "RGMII_MDIO", + "RGMIO_MDC", + /* Used by BT module */ + "CTS0", + "RTS0", + "TXD0", + "RXD0", + /* Used by Wifi */ + "SD1_CLK", + "SD1_CMD", + "SD1_DATA0", + "SD1_DATA1", + "SD1_DATA2", + "SD1_DATA3", + /* Shared with SPI flash */ + "PWM0_MISO", + "PWM1_MOSI", + "STATUS_LED_G_CLK", + "SPIFLASH_CE_N", + "SDA0", + "SCL0", + "RGMII_RXCLK", + "RGMII_RXCTL", + "RGMII_RXD0", + "RGMII_RXD1", + "RGMII_RXD2", + "RGMII_RXD3", + "RGMII_TXCLK", + "RGMII_TXCTL", + "RGMII_TXD0", + "RGMII_TXD1", + "RGMII_TXD2", + "RGMII_TXD3"; + + lochnagar_present: lochnagar_present { + brcm,pins = <22>; + brcm,function = ; + }; + + lochnagar_reset: lochnagar_reset { + brcm,pins = <24>; + brcm,function = ; + }; + + cdc_irq: cdc_irq { + brcm,pins = <27>; + brcm,function = ; + }; + + spi_pins: spi_pins { + brcm,pins = <9 10 11>; + brcm,function = ; + }; + + spi_cs: spi_cs { + brcm,pins = <7 8>; + brcm,function = ; + }; + + i2s_pins: i2s_pins { + brcm,pins = <18 19 20 21>; + brcm,function = ; + }; +}; + +&pwm1 { + pinctrl-names = "default"; + pinctrl-0 = <&pwm1_0_gpio40 &pwm1_1_gpio41>; + status = "okay"; +}; + +/* SDHCI is used to control the SDIO for wireless */ +&sdhci { + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&emmc_gpio34>; + bus-width = <4>; + non-removable; + mmc-pwrseq = <&wifi_pwrseq>; + status = "disabled"; + + brcmf: wifi@1 { + reg = <1>; + compatible = "brcm,bcm4329-fmac"; + }; +}; + +/* EMMC2 is used to drive the SD card */ +&emmc2 { + vqmmc-supply = <&sd_io_1v8_reg>; + vmmc-supply = <&sd_vcc_reg>; + broken-cd; + status = "okay"; +}; + +&genet { + phy-handle = <&phy1>; + phy-mode = "rgmii-rxid"; + status = "okay"; +}; + +&genet_mdio { + phy1: ethernet-phy@1 { + /* No PHY interrupt */ + reg = <0x1>; + }; +}; + +/* uart0 communicates with the BT module */ +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32>; + uart-has-rtscts; + status = "okay"; + + bluetooth { + compatible = "brcm,bcm43438-bt"; + max-speed = <2000000>; + shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>; + }; +}; + +/* uart1 is mapped to the pin header */ +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_gpio14>; + status = "okay"; +}; + +&vchiq { + interrupts = ; +}; + +&i2s { + status = "okay"; + #sound-dai-cells = <1>; + pinctrl-names = "default"; + pinctrl-0 = <&i2s_pins>; + dmas = <&dma 2>, <&dma 3>; + dma-names = "tx", "rx"; +}; + +&i2c1 { + status = "okay"; + + lochnagar: lochnagar@22 { + status = "okay"; + + compatible = "cirrus,lochnagar2"; + reg = <0x22>; + + pinctrl-names = "default"; + pinctrl-0 = <&lochnagar_present &lochnagar_reset>; + + reset-gpio = <&gpio 24 0>; + present-gpio = <&gpio 22 0>; + + lochnagar_vdd1v8: VDD1V8 { + compatible = "regulator-fixed"; + + regulator-name = "VDD1V8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + + vin-supply = <&wallvdd>; + }; + + clk_pmic: clk_pmic { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + clk_24m: clk_24m { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24576000>; + }; + + lochnagar_clk: clk { + compatible = "cirrus,lochnagar2-clk"; + + #clock-cells = <1>; + + clocks = <&clk_pmic>, <&clk_24m>; + clock-names = "ln-pmic-32k", "ln-clk-24m"; + + assigned-clocks = <&lochnagar_clk LOCHNAGAR_CDC_MCLK1>, + <&lochnagar_clk LOCHNAGAR_CDC_MCLK2>, + <&lochnagar_clk LOCHNAGAR_SOUNDCARD_MCLK>; + assigned-clock-parents = <&clk_24m>, + <&clk_pmic>, + <&clk_24m>; + }; + + lochnagar_pin: pin { + compatible = "cirrus,lochnagar-pinctrl"; + + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&lochnagar_pin 0 0 LOCHNAGAR2_PIN_NUM_GPIOS>; + + pinctrl-names = "default"; + pinctrl-0 = <&pin_settings>; + + pin_settings: pin_settings { + rpi_aif { + input-enable; + groups = "gf-aif1"; + function = "codec-aif1"; + }; + codec_aif1 { + output-master; + groups = "codec-aif1"; + function = "gf-aif1"; + }; + sc_codec_aif { + output-enable; + groups = "codec-aif2"; + function = "soundcard-aif"; + }; + sc_lochnagar_aif { + input-enable; + groups = "soundcard-aif"; + function = "codec-aif2"; + }; + }; + }; + + lochnagar_hwmon: hwmon { + compatible = "cirrus,lochnagar2-hwmon"; + }; + + lochnagar_micvdd: MICVDD { + compatible = "cirrus,lochnagar2-micvdd"; + + SYSVDD-supply = <&wallvdd>; + + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + }; + + MIC1VDD { + compatible = "cirrus,lochnagar2-mic1vdd"; + + regulator-always-on; + cirrus,micbias-input = <2>; + }; + + MIC2VDD { + compatible = "cirrus,lochnagar2-mic2vdd"; + + regulator-always-on; + cirrus,micbias-input = <3>; + }; + + lochnagar_vddcore: VDDCORE { + compatible = "cirrus,lochnagar2-vddcore"; + + SYSVDD-supply = <&wallvdd>; + + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + }; + + lochnagar_sc: soundcard { + compatible = "cirrus,lochnagar2-soundcard"; + + #sound-dai-cells = <1>; + + clocks = <&lochnagar_clk LOCHNAGAR_SOUNDCARD_MCLK>; + clock-names = "mclk"; + }; + }; + + cs42l92: cs42l92@1a { + status = "disabled"; + + compatible = "cirrus,cs47l92"; + reg = <0x1a>; + + interrupts = <27 8>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio>; + gpio-controller; + #gpio-cells = <2>; + #sound-dai-cells = <1>; + + AVDD-supply = <&lochnagar_vdd1v8>; + DBVDD1-supply = <&lochnagar_vdd1v8>; + CPVDD1-supply = <&lochnagar_vdd1v8>; + CPVDD2-supply = <&lochnagar_vddcore>; + DCVDD-supply = <&lochnagar_vddcore>; + SPKVDDL-supply = <&wallvdd>; + SPKVDDR-supply = <&wallvdd>; + + reset-gpios = <&lochnagar_pin 0 0>; + + cirrus,out-mono = <0 0 1 1 0 0>; + cirrus,dmic-ref = < + MADERA_DMIC_REF_MICBIAS1 + MADERA_DMIC_REF_MICBIAS1 + MADERA_DMIC_REF_MICBIAS1 + MADERA_DMIC_REF_MICBIAS1 + >; + cirrus,inmode = < + MADERA_INMODE_DIFF MADERA_INMODE_DIFF /* IN1A */ + MADERA_INMODE_DIFF MADERA_INMODE_DIFF /* IN1B */ + MADERA_INMODE_SE MADERA_INMODE_SE /* IN2A */ + MADERA_INMODE_DIFF MADERA_INMODE_DIFF /* IN2B */ + >; + + clocks = <&lochnagar_clk LOCHNAGAR_CDC_MCLK1>, + <&lochnagar_clk LOCHNAGAR_CDC_MCLK2>; + clock-names = "mclk1", "mclk2"; + + pinctrl-names = "default"; + pinctrl-0 = <&cdc_irq &cs42l92_defaults>; + + cs42l92_defaults: cs42l92-gpio-defaults { + aif1 { + groups = "aif1"; + function = "aif1"; + bias-bus-hold; + }; + + aif2 { + groups = "aif2"; + function = "aif2"; + bias-bus-hold; + }; + + aif3 { + groups = "aif3"; + function = "aif3"; + bias-bus-hold; + }; + }; + + micvdd { + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + }; + + MICBIAS1 { + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + }; + MICBIAS1A { + regulator-active-discharge = <1>; + }; + MICBIAS1B { + regulator-active-discharge = <1>; + }; + }; + + wm8998: wm8998@1a { + status = "disabled"; + + compatible = "wlf,wm8998"; + reg = <0x1a>; + + interrupts = <27 0>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio>; + gpio-controller; + #gpio-cells = <2>; + #sound-dai-cells = <1>; + + LDOVDD-supply = <&lochnagar_vdd1v8>; + AVDD-supply = <&lochnagar_vdd1v8>; + DBVDD1-supply = <&lochnagar_vdd1v8>; + DBVDD2-supply = <&lochnagar_vdd1v8>; + DBVDD3-supply = <&lochnagar_vdd1v8>; + CPVDD-supply = <&lochnagar_vdd1v8>; + SPKVDDL-supply = <&wallvdd>; + SPKVDDR-supply = <&wallvdd>; + + wlf,gpio-defaults = < + ARIZONA_GP_DEFAULT + ARIZONA_GP_DEFAULT + ARIZONA_GP_DEFAULT + ARIZONA_GP_DEFAULT + ARIZONA_GP_DEFAULT + >; + + wlf,reset = <&lochnagar_pin 0 0>; + wlf,ldoena = <&lochnagar_pin 3 0>; + + wlf,micd-configs = < + 0x0 ARIZONA_DMIC_MICBIAS1 0 + 0x2000 ARIZONA_DMIC_MICBIAS2 1 + >; + wlf,jd-invert; + wlf,micd-force-micbias; + wlf,gpsw = ; + wlf,micd-pol-gpio = <&wm8998 4 GPIO_TRANSITORY>; + wlf,micd-rate = ; + wlf,micd-detect-debounce = <500>; + wlf,dmic-ref = ; + wlf,inmode = ; + + clocks = <&lochnagar_clk LOCHNAGAR_CDC_MCLK1>, + <&lochnagar_clk LOCHNAGAR_CDC_MCLK2>; + clock-names = "mclk1", "mclk2"; + }; +}; + +&spi { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&spi_pins &spi_cs>; + + cs-gpios = <&gpio 8 1>, <&gpio 7 1>; + + spidev1: spidev@1{ + compatible = "spidev"; + reg = <1>; + status = "disabled"; + }; + + cs47l15: cs47l15@1 { + status = "disabled"; + + compatible = "cirrus,cs47l15"; + reg = <0x1>; + + spi-max-frequency = <11000000>; + + interrupts = <27 8>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio>; + gpio-controller; + #gpio-cells = <2>; + #sound-dai-cells = <1>; + + AVDD-supply = <&lochnagar_vdd1v8>; + DCVDD-supply = <&lochnagar_vddcore>; + DBVDD1-supply = <&lochnagar_vdd1v8>; + CPVDD1-supply = <&lochnagar_vdd1v8>; + SPKVDD-supply = <&wallvdd>; + MICVDD-supply = <&lochnagar_micvdd>; + + reset-gpios = <&lochnagar_pin 0 0>; + + cirrus,dmic-ref = < + MADERA_DMIC_REF_MICBIAS1 + MADERA_DMIC_REF_MICBIAS2 + >; + cirrus,inmode = < + MADERA_INMODE_SE MADERA_INMODE_SE /* IN1A */ + MADERA_INMODE_DIFF MADERA_INMODE_DIFF /* IN1B */ + MADERA_INMODE_SE MADERA_INMODE_SE /* IN2A */ + MADERA_INMODE_DIFF MADERA_INMODE_DIFF /* IN2B */ + >; + + clocks = <&lochnagar_clk LOCHNAGAR_CDC_MCLK1>, + <&lochnagar_clk LOCHNAGAR_CDC_MCLK2>; + clock-names = "mclk1", "mclk2"; + + pinctrl-names = "default"; + pinctrl-0 = <&cdc_irq &cs47l15_defaults>; + + cs47l15_defaults: cs47l15-gpio-defaults { + aif1 { + groups = "aif1"; + function = "aif1"; + bias-bus-hold; + }; + aif2 { + groups = "aif2"; + function = "aif2"; + bias-bus-hold; + }; + aif3 { + groups = "aif3"; + function = "aif3"; + bias-bus-hold; + }; + pdmspk1 { + groups = "pdmspk1"; + function = "pdmspk1"; + }; + }; + + micvdd { + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + }; + + MICBIAS1 { + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + }; + MICBIAS1A { + regulator-active-discharge = <1>; + }; + MICBIAS1B { + regulator-active-discharge = <1>; + }; + MICBIAS1C { + regulator-active-discharge = <1>; + }; + }; + + cs47l24: cs47l24@1 { + status = "disabled"; + + compatible = "cirrus,cs47l24"; + reg = <0x1>; + + spi-max-frequency = <11000000>; + + interrupts = <27 0>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio>; + gpio-controller; + #gpio-cells = <2>; + #sound-dai-cells = <1>; + + AVDD-supply = <&lochnagar_vdd1v8>; + DBVDD1-supply = <&lochnagar_vdd1v8>; + DBVDD2-supply = <&lochnagar_vdd1v8>; + DBVDD3-supply = <&lochnagar_vdd1v8>; + CPVDD-supply = <&lochnagar_vdd1v8>; + MICVDD-supply = <&lochnagar_micvdd>; + SPKVDD-supply = <&wallvdd>; + DCVDD-supply = <&lochnagar_vddcore>; + + wlf,gpio-defaults = < + ARIZONA_GP_DEFAULT + ARIZONA_GP_DEFAULT + ARIZONA_GP_DEFAULT + ARIZONA_GP_DEFAULT + ARIZONA_GP_DEFAULT + >; + + wlf,reset = <&lochnagar_pin 0 0>; + + wlf,dmic-ref = ; + wlf,inmode = ; + + clocks = <&lochnagar_clk LOCHNAGAR_CDC_MCLK1>, + <&lochnagar_clk LOCHNAGAR_CDC_MCLK2>; + clock-names = "mclk1", "mclk2"; + }; + + cs47l35: cs47l35@1 { + status = "disabled"; + + compatible = "cirrus,cs47l35"; + reg = <0x1>; + + spi-max-frequency = <11000000>; + + interrupts = <27 8>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio>; + gpio-controller; + #gpio-cells = <2>; + #sound-dai-cells = <1>; + + AVDD-supply = <&lochnagar_vdd1v8>; + DBVDD1-supply = <&lochnagar_vdd1v8>; + DBVDD2-supply = <&lochnagar_vdd1v8>; + CPVDD1-supply = <&lochnagar_vdd1v8>; + CPVDD2-supply = <&lochnagar_vddcore>; + DCVDD-supply = <&lochnagar_vddcore>; + SPKVDD-supply = <&wallvdd>; + + reset-gpios = <&lochnagar_pin 0 0>; + + cirrus,dmic-ref = < + MADERA_DMIC_REF_MICVDD + CS47L35_DMIC_REF_MICBIAS2A + MADERA_DMIC_REF_MICVDD + >; + cirrus,inmode = < + MADERA_INMODE_SE MADERA_INMODE_SE /* IN1A */ + MADERA_INMODE_DIFF MADERA_INMODE_DIFF /* IN1B */ + MADERA_INMODE_SE MADERA_INMODE_SE /* IN2A */ + MADERA_INMODE_DIFF MADERA_INMODE_DIFF /* IN2B */ + >; + + clocks = <&lochnagar_clk LOCHNAGAR_CDC_MCLK1>, + <&lochnagar_clk LOCHNAGAR_CDC_MCLK2>; + clock-names = "mclk1", "mclk2"; + + pinctrl-names = "default"; + pinctrl-0 = <&cdc_irq &cs47l35_defaults>; + + cs47l35_defaults: cs47l35-gpio-defaults { + aif1 { + groups = "aif1"; + function = "aif1"; + bias-bus-hold; + }; + + aif2 { + groups = "aif2"; + function = "aif2"; + bias-bus-hold; + }; + + aif3 { + groups = "aif3"; + function = "aif3"; + bias-bus-hold; + }; + }; + + micvdd { + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + }; + + MICBIAS1 { + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + }; + MICBIAS1A { + regulator-active-discharge = <1>; + }; + + MICBIAS2 { + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + }; + MICBIAS2A { + regulator-active-discharge = <1>; + }; + }; + + cs47l90: cs47l90@1 { + status = "disabled"; + + compatible = "cirrus,cs47l90"; + reg = <0x1>; + + spi-max-frequency = <11000000>; + + interrupts = <27 8>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio>; + gpio-controller; + #gpio-cells = <2>; + #sound-dai-cells = <1>; + + AVDD-supply = <&lochnagar_vdd1v8>; + DBVDD1-supply = <&lochnagar_vdd1v8>; + DBVDD2-supply = <&lochnagar_vdd1v8>; + DBVDD3-supply = <&lochnagar_vdd1v8>; + DBVDD4-supply = <&lochnagar_vdd1v8>; + CPVDD1-supply = <&lochnagar_vdd1v8>; + CPVDD2-supply = <&lochnagar_vddcore>; + DCVDD-supply = <&lochnagar_vddcore>; + SPKVDDL-supply = <&wallvdd>; + SPKVDDR-supply = <&wallvdd>; + + reset-gpios = <&lochnagar_pin 0 0>; + + cirrus,dmic-ref = < + MADERA_DMIC_REF_MICBIAS1 + MADERA_DMIC_REF_MICBIAS2 + >; + cirrus,inmode = < + MADERA_INMODE_DIFF MADERA_INMODE_DIFF /* IN1A */ + MADERA_INMODE_DIFF MADERA_INMODE_DIFF /* IN1B */ + MADERA_INMODE_SE MADERA_INMODE_SE /* IN2A */ + MADERA_INMODE_DIFF MADERA_INMODE_DIFF /* IN2B */ + >; + + clocks = <&lochnagar_clk LOCHNAGAR_CDC_MCLK1>, + <&lochnagar_clk LOCHNAGAR_CDC_MCLK2>; + clock-names = "mclk1", "mclk2"; + + pinctrl-names = "default"; + pinctrl-0 = <&cdc_irq &cs47l90_defaults>; + + cs47l90_defaults: cs47l90-gpio-defaults { + aif1 { + groups = "aif1"; + function = "aif1"; + bias-bus-hold; + }; + + aif2 { + groups = "aif2"; + function = "aif2"; + bias-bus-hold; + }; + + aif3 { + groups = "aif3"; + function = "aif3"; + bias-bus-hold; + }; + }; + + micvdd { + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + }; + + MICBIAS1 { + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + }; + MICBIAS1A { + regulator-active-discharge = <1>; + }; + MICBIAS1B { + regulator-active-discharge = <1>; + }; + + MICBIAS2 { + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + }; + MICBIAS2C { + regulator-active-discharge = <1>; + }; + }; +}; From patchwork Wed Oct 14 14:54:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 11837829 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B401C433E7 for ; Wed, 14 Oct 2020 14:59:07 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5FA41212CC for ; Wed, 14 Oct 2020 14:59:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="eRT3ZtyG"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="eoVgEewy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5FA41212CC Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BFFBE1705; Wed, 14 Oct 2020 16:58:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BFFBE1705 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1602687544; bh=ox6QdeShtbWGwf5pNYcNdJm9bsR70QfgSHQzDyeBshg=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=eRT3ZtyGqWIqAN9+70gxvhH3tSchoMvWBAGpl64kxXJlrC7S27Er7L2dWEHuSFiHZ NCi7qsrrERbsU+GbMw+pOYs48eP6d4zKOwUlB2plI1OebYZyMQz79bfGtIOBG+arCn iS2OQ9tI7M3YBlGBDEyd1BKmNuQUiYN8WB5Ksyng= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2EA52F802D6; Wed, 14 Oct 2020 16:54:59 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CA8F4F80296; Wed, 14 Oct 2020 16:54:53 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8B32BF8021D for ; Wed, 14 Oct 2020 16:54:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8B32BF8021D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="eoVgEewy" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 09EEpi86023902; Wed, 14 Oct 2020 09:54:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=NbuRtoi+iQyrOz1VZGTizLtn/VqJReoSWynFwYIAIsg=; b=eoVgEewyMaXaPElcE4qhIUvMuRcZHJuuzgblZ+UkA86T1S/gZhRKUffDAXAeleIf0CF8 L8L3cU0f/xNQdb0OLghok3s/r5Gz2Qwzn5LrUNNFXks2k0118VgbZNHD1qD3454kg6Rt 4q/s8xWICQToAPa3VzF/J1GdeKV8+iqbhuLSAQDlWVolIhX7Ud+3iJKFdTaPWO/giwrP sznPTYgpWqSw3hUv9AC9jwrayCAuFjRUQY2wCyIimYTsGTDFIZCeVj362t22otN/h0Lk Gdt9WaldBuj7RdNBpDs7PrKIfqFIKOoH6CxDuZLST0EXYDJzNzwL7G+1eAY7zJo8q4jp TQ== Received: from ediex02.ad.cirrus.com ([87.246.76.36]) by mx0a-001ae601.pphosted.com with ESMTP id 343ac1wbwc-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 14 Oct 2020 09:54:38 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Wed, 14 Oct 2020 15:54:36 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Wed, 14 Oct 2020 15:54:36 +0100 Received: from AUSNPC0LSNW1-debian.ad.cirrus.com (ausnpc0lsnw1.ad.cirrus.com [198.61.64.143]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id A1FEE2AA; Wed, 14 Oct 2020 14:54:35 +0000 (UTC) From: Richard Fitzgerald To: , , Subject: [PATCH 7/7] MAINTAINERS: Add dts for Cirrus Logic Lochnagar on RPi4 Date: Wed, 14 Oct 2020 15:54:18 +0100 Message-ID: <20201014145418.31838-8-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201014145418.31838-1-rf@opensource.cirrus.com> References: <20201014145418.31838-1-rf@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 impostorscore=0 mlxscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010140108 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, Richard Fitzgerald , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" Update the Cirrus Logic driver maintainers to include the device tree .dts for using the Lochnagar with a Raspberry Pi 4. Signed-off-by: Richard Fitzgerald --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 87ceaac748a4..09bc583a5b2b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4199,6 +4199,7 @@ M: Charles Keepax M: Richard Fitzgerald L: patches@opensource.cirrus.com S: Supported +F: arch/arm/boot/dts/bcm2711-rpi4b-cirrus-lochnagar.dts F: Documentation/devicetree/bindings/clock/cirrus,lochnagar.yaml F: Documentation/devicetree/bindings/hwmon/cirrus,lochnagar.yaml F: Documentation/devicetree/bindings/mfd/cirrus,lochnagar.yaml