From patchwork Fri Jan 8 16:04:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 1423857 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=cirrus.com header.i=@cirrus.com header.a=rsa-sha256 header.s=PODMain02222019 header.b=pjeryqd8; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4DC7JT0TtNz9sWf for ; Sat, 9 Jan 2021 03:06:33 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726059AbhAHQGW (ORCPT ); Fri, 8 Jan 2021 11:06:22 -0500 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:57248 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727971AbhAHQGK (ORCPT ); Fri, 8 Jan 2021 11:06:10 -0500 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 108G2EoX011561; Fri, 8 Jan 2021 10:05:08 -0600 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=2j2pa6/Jqo6QYZqsSeLPknoRF/7N3vv/yIiaZr+oTAo=; b=pjeryqd8SbN62ve1AflY1HOFGYsSF12MSr/J0ayKxf8VxDDs0WzXsuwGL63k5P4mLg9d SRYppa6wyfsynAPIVqyGqEf1A6PE/4j/kbqY1EFbHBF/O6pQRLZ7AyBPAFa3VpSO48Pb 9hDk5PfaDMiCZTm95CJqlPj42QsapkYbqwQ5bQooHzxqtxX349NKk03PfgmDlm2lcQuc YuBECeZnrdT/5OHUjwQf0OvxqXRlLrwgPlDrBfOPQGSWkcnF8642gaPcyutHCx0rKe2b 7UqxzyOYlSDmHBBtYkL8zwDshabVuM4jCo2TCnFM6KBM645O3oD93jk0gJHbi4GJdYZ8 ag== Received: from ediex02.ad.cirrus.com ([87.246.76.36]) by mx0b-001ae601.pphosted.com with ESMTP id 35wqjka90t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 08 Jan 2021 10:05:08 -0600 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; Fri, 8 Jan 2021 16:05:06 +0000 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; Fri, 8 Jan 2021 16:05:06 +0000 Received: from AUSNPC0LSNW1-debian.cirrus.com (AUSNPC0LSNW1.ad.cirrus.com [198.61.64.226]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 62C1E11CB; Fri, 8 Jan 2021 16:05:06 +0000 (UTC) From: Richard Fitzgerald To: , , , , CC: , , , , , , , Richard Fitzgerald , Rob Herring Subject: [PATCH v4 1/6] of: base: Add of_count_phandle_with_fixed_args() Date: Fri, 8 Jan 2021 16:04:56 +0000 Message-ID: <20210108160501.7638-2-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210108160501.7638-1-rf@opensource.cirrus.com> References: <20210108160501.7638-1-rf@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 spamscore=0 clxscore=1015 bulkscore=0 phishscore=0 priorityscore=1501 suspectscore=0 impostorscore=0 lowpriorityscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101080091 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add an equivalent of of_count_phandle_with_args() for fixed argument sets, to pair with of_parse_phandle_with_fixed_args(). The existing of_count_phandle_with_args() is modified to be a private function that handles both cases and the public functions are trivial wrappers round that. Signed-off-by: Richard Fitzgerald Reviewed-by: Rob Herring --- drivers/of/base.c | 73 +++++++++++++++++++++++++++++++--------------- include/linux/of.h | 9 ++++++ 2 files changed, 59 insertions(+), 23 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 161a23631472..c5ff2524bf40 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1720,34 +1720,22 @@ int of_parse_phandle_with_fixed_args(const struct device_node *np, } EXPORT_SYMBOL(of_parse_phandle_with_fixed_args); -/** - * of_count_phandle_with_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 - * @cells_name: property name that specifies phandles' arguments count - * - * 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. The number of arguments is encoded - * by a property in the phandle-target node. For example, a gpios - * property would contain a list of GPIO specifies consisting of a - * phandle and 1 or more arguments. The number of arguments are - * determined by the #gpio-cells property in the node pointed to by the - * phandle. - */ -int of_count_phandle_with_args(const struct device_node *np, const char *list_name, - const char *cells_name) +static int __of_count_phandle_with_args(const struct device_node *np, + const char *list_name, + const char *cells_name, + int cells_count) { struct of_phandle_iterator it; int rc, cur_index = 0; /* - * If cells_name is NULL we assume a cell count of 0. This makes - * counting the phandles trivial as each 32bit word in the list is a - * phandle and no arguments are to consider. So we don't iterate through - * the list but just use the length to determine the phandle count. + * If cells_count < 0 and cells_name is NULL we assume a cell count + * of 0. A zero cell count makes counting the phandles trivial as each + * 32bit word in the list is a phandle and no arguments are to consider. + * So we don't iterate through the list but just use the length to + * determine the phandle count. */ - if (!cells_name) { + if ((cells_count < 0 && !cells_name) || cells_count == 0) { const __be32 *list; int size; @@ -1758,7 +1746,7 @@ int of_count_phandle_with_args(const struct device_node *np, const char *list_na return size / sizeof(*list); } - rc = of_phandle_iterator_init(&it, np, list_name, cells_name, -1); + rc = of_phandle_iterator_init(&it, np, list_name, cells_name, cells_count); if (rc) return rc; @@ -1770,8 +1758,47 @@ int of_count_phandle_with_args(const struct device_node *np, const char *list_na return cur_index; } + +/** + * of_count_phandle_with_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 + * @cells_name: property name that specifies phandles' arguments count + * + * 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. The number of arguments is encoded + * by a property in the phandle-target node. For example, a gpios + * property would contain a list of GPIO specifies consisting of a + * phandle and 1 or more arguments. The number of arguments are + * determined by the #gpio-cells property in the node pointed to by the + * phandle. + */ +int of_count_phandle_with_args(const struct device_node *np, const char *list_name, + const char *cells_name) +{ + return __of_count_phandle_with_args(np, list_name, cells_name, -1); +} 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) +{ + return __of_count_phandle_with_args(np, list_name, NULL, cells_count); +} +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 4b27c9a27df3..4f09d644a803 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, @@ -888,6 +890,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 Fri Jan 8 16:04:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 1423858 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=cirrus.com header.i=@cirrus.com header.a=rsa-sha256 header.s=PODMain02222019 header.b=oJ5K4MIT; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4DC7Jw26N3z9sWf for ; Sat, 9 Jan 2021 03:06:56 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728003AbhAHQGK (ORCPT ); Fri, 8 Jan 2021 11:06:10 -0500 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:31040 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727966AbhAHQGH (ORCPT ); Fri, 8 Jan 2021 11:06:07 -0500 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 108G2EoY011561; Fri, 8 Jan 2021 10:05:09 -0600 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=kOekwXaZfSzN5B1r/aiMtLh+hLUch+Y8pXk00v7FV8I=; b=oJ5K4MITbPRuVJtx9dPXSS661PHDCyQCrnd23VoiyFcfqPtvWjFD6vXGOghK5aFkh4t0 4ySW1Rnyj8zU1lr1yMNIwBlrGILAOTLyhdlFTGxsfqvonQdMHVCED3H0q1i3/vk9Ff3c PQOqVqy+w7CSViB2V7LYFB30/h6LnEp0OSZ406zbFopfYNkISh0OqhKayejVfRvCrCEG +pMgabUx+uMEcxFnUpA61NMytQk8vfqXsrr/qBrAP9J1sY5l4vrgB9GhEjlWHGyd5aOF GjNjmVAo9SHH3FlXgweDUXQlOrVh1jGycqq32xCr6f/D2iJI8rZ2ihb0F7pckeIAQufz GQ== Received: from ediex02.ad.cirrus.com ([87.246.76.36]) by mx0b-001ae601.pphosted.com with ESMTP id 35wqjka90t-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 08 Jan 2021 10:05:09 -0600 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; Fri, 8 Jan 2021 16:05:07 +0000 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; Fri, 8 Jan 2021 16:05:07 +0000 Received: from AUSNPC0LSNW1-debian.cirrus.com (AUSNPC0LSNW1.ad.cirrus.com [198.61.64.226]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 0395C11CE; Fri, 8 Jan 2021 16:05:06 +0000 (UTC) From: Richard Fitzgerald To: , , , , CC: , , , , , , , Richard Fitzgerald Subject: [PATCH v4 2/6] dt-bindings: audio-graph-card: Add plls and sysclks properties Date: Fri, 8 Jan 2021 16:04:57 +0000 Message-ID: <20210108160501.7638-3-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210108160501.7638-1-rf@opensource.cirrus.com> References: <20210108160501.7638-1-rf@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 spamscore=0 clxscore=1015 bulkscore=0 phishscore=0 priorityscore=1501 suspectscore=0 impostorscore=0 lowpriorityscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101080091 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The audio-graph-card driver has properties for configuring the clocking for DAIs within a component, but is missing properties for setting up the PLLs and sysclks of the component. This patch adds the two new properties 'plls' and 'sysclks' so that the audio-graph-driver can fully configure the component clocking. Signed-off-by: Richard Fitzgerald --- .../bindings/sound/audio-graph.yaml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/audio-graph.yaml b/Documentation/devicetree/bindings/sound/audio-graph.yaml index 4b46794e5153..9e0819205a17 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph.yaml @@ -39,6 +39,52 @@ properties: mic-det-gpio: maxItems: 1 + plls: + description: | + A list of component pll settings. There are 4 cells per PLL setting: + - phandle to the node of the codec or cpu component, + - component PLL id, + - component clock source id, + - frequency (in Hz) of the PLL output clock. + The PLL id and clock source id are specific to the particular component + so see the relevant component driver for the ids. Typically the + clock source id indicates the pin the source clock is connected to. + The same phandle can appear in multiple entries so that several plls + can be set in the same component. + $ref: /schemas/types.yaml#/definitions/phandle-array + + plls-clocks: + $ref: /schemas/types.yaml#/definitions/non-unique-string-array + description: | + A list of clock names giving the source clock for each setting + in the plls property. + + sysclks: + description: | + A list of component sysclk settings. There are 4 cells per sysclk + setting: + - phandle to the node of the codec or cpu component, + - component sysclk id, + - component clock source id, + - direction of the clock: 0 if the clock is an input to the component, + 1 if it is an output. + The sysclk id and clock source id are specific to the particular + component so see the relevant component driver for the ids. Typically + the clock source id indicates the pin the source clock is connected to. + The same phandle can appear in multiple entries so that several sysclks + can be set in the same component. + $ref: /schemas/types.yaml#/definitions/phandle-array + + sysclks-clocks: + $ref: /schemas/types.yaml#/definitions/non-unique-string-array + description: | + A list of clock names giving the source clock for each setting + in the sysclks property. + +dependencies: + plls: [ plls-clocks ] + sysclks: [ sysclks-clocks ] + required: - dais From patchwork Fri Jan 8 16:05:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 1423859 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=cirrus.com header.i=@cirrus.com header.a=rsa-sha256 header.s=PODMain02222019 header.b=eoS6vRyt; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4DC7Jw5Gt7z9sWs for ; Sat, 9 Jan 2021 03:06:56 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727918AbhAHQGb (ORCPT ); Fri, 8 Jan 2021 11:06:31 -0500 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:64942 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726386AbhAHQGK (ORCPT ); Fri, 8 Jan 2021 11:06:10 -0500 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 108G2EoZ011561; Fri, 8 Jan 2021 10:05:10 -0600 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=627cyMSOyeSzZ7/Nq+d6A7Mp3C4WbFQei8V0n6bIm60=; b=eoS6vRythwrqRcbrJrEBUWfYn/UNWAMCivNJSRovifGKPFGkKMmw9zgL4OO1Pe2G1NiR TqID91IfmBNy1Tmfnrni+Rb5m2O7eVvEbRbRVHnDCUm5B8qNQbYj3gzThostEu33kWYD 7t2/MQDQwmvCN8Le75mL4AX8yWWDAyLkV9P4looci6+liLdNTmyC4ATBG8cs7Gw2I1fX r7v5CaPNF7mJS/Nh7nKsVXGjev6SKCxW4FGz/gvrbYd9fZBXo0zfIyIwZeODuQWo4cxQ WoHJg4nfmmfom4aOE9wBjor6OJi5oDILe+Sx7SQ3TJDbk98XNEusZV2zA38aSctXZyNd 3Q== Received: from ediex02.ad.cirrus.com ([87.246.76.36]) by mx0b-001ae601.pphosted.com with ESMTP id 35wqjka90t-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 08 Jan 2021 10:05:09 -0600 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; Fri, 8 Jan 2021 16:05:09 +0000 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; Fri, 8 Jan 2021 16:05:09 +0000 Received: from AUSNPC0LSNW1-debian.cirrus.com (AUSNPC0LSNW1.ad.cirrus.com [198.61.64.226]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id B206811CB; Fri, 8 Jan 2021 16:05:08 +0000 (UTC) From: Richard Fitzgerald To: , , , , CC: , , , , , , , Richard Fitzgerald Subject: [PATCH v4 5/6] ASoC: madera: Export clock config defines to dt-bindings Date: Fri, 8 Jan 2021 16:05:00 +0000 Message-ID: <20210108160501.7638-6-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210108160501.7638-1-rf@opensource.cirrus.com> References: <20210108160501.7638-1-rf@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 spamscore=0 clxscore=1015 bulkscore=0 phishscore=0 priorityscore=1501 suspectscore=0 impostorscore=0 lowpriorityscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101080091 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Move the defines for clock/fll IDs and sources into the dt-bindings header so that they can be used by machine driver dts files. Signed-off-by: Richard Fitzgerald --- include/dt-bindings/sound/madera.h | 60 ++++++++++++++++++++++++++++++ sound/soc/codecs/madera.h | 56 +--------------------------- 2 files changed, 61 insertions(+), 55 deletions(-) diff --git a/include/dt-bindings/sound/madera.h b/include/dt-bindings/sound/madera.h index d0096d5eb0da..5c5fc1bfe6f9 100644 --- a/include/dt-bindings/sound/madera.h +++ b/include/dt-bindings/sound/madera.h @@ -22,4 +22,64 @@ #define CS47L35_DMIC_REF_MICBIAS2A 2 #define CS47L35_DMIC_REF_MICBIAS2B 3 +/* FLL IDs */ +#define MADERA_FLL1_REFCLK 1 +#define MADERA_FLL2_REFCLK 2 +#define MADERA_FLL3_REFCLK 3 +#define MADERA_FLLAO_REFCLK 4 +#define MADERA_FLL1_SYNCCLK 5 +#define MADERA_FLL2_SYNCCLK 6 +#define MADERA_FLL3_SYNCCLK 7 +#define MADERA_FLLAO_SYNCCLK 8 + +/* FLL input source pin IDs */ +#define MADERA_FLL_SRC_NONE -1 +#define MADERA_FLL_SRC_MCLK1 0 +#define MADERA_FLL_SRC_MCLK2 1 +#define MADERA_FLL_SRC_MCLK3 2 +#define MADERA_FLL_SRC_SLIMCLK 3 +#define MADERA_FLL_SRC_FLL1 4 +#define MADERA_FLL_SRC_FLL2 5 +#define MADERA_FLL_SRC_AIF1BCLK 8 +#define MADERA_FLL_SRC_AIF2BCLK 9 +#define MADERA_FLL_SRC_AIF3BCLK 10 +#define MADERA_FLL_SRC_AIF4BCLK 11 +#define MADERA_FLL_SRC_AIF1LRCLK 12 +#define MADERA_FLL_SRC_AIF2LRCLK 13 +#define MADERA_FLL_SRC_AIF3LRCLK 14 +#define MADERA_FLL_SRC_AIF4LRCLK 15 + +/* SYSCLK IDs */ +#define MADERA_CLK_SYSCLK_1 1 +#define MADERA_CLK_ASYNCCLK_1 2 +#define MADERA_CLK_OPCLK 3 +#define MADERA_CLK_ASYNC_OPCLK 4 +#define MADERA_CLK_SYSCLK_2 5 +#define MADERA_CLK_SYSCLK_3 6 +#define MADERA_CLK_ASYNCCLK_2 7 +#define MADERA_CLK_DSPCLK 8 +#define MADERA_CLK_OUTCLK 9 + +/* SYSCLK source IDs */ +#define MADERA_CLK_SRC_MCLK1 0x0 +#define MADERA_CLK_SRC_MCLK2 0x1 +#define MADERA_CLK_SRC_MCLK3 0x2 +#define MADERA_CLK_SRC_FLL1 0x4 +#define MADERA_CLK_SRC_FLL2 0x5 +#define MADERA_CLK_SRC_FLL3 0x6 +#define MADERA_CLK_SRC_FLLAO_HI 0x7 +#define MADERA_CLK_SRC_FLL1_DIV6 0x7 +#define MADERA_CLK_SRC_AIF1BCLK 0x8 +#define MADERA_CLK_SRC_AIF2BCLK 0x9 +#define MADERA_CLK_SRC_AIF3BCLK 0xA +#define MADERA_CLK_SRC_AIF4BCLK 0xB +#define MADERA_CLK_SRC_FLLAO 0xF + +/* OPCLK source IDs */ +#define MADERA_OUTCLK_SYSCLK 0 +#define MADERA_OUTCLK_ASYNCCLK 1 +#define MADERA_OUTCLK_MCLK1 4 +#define MADERA_OUTCLK_MCLK2 5 +#define MADERA_OUTCLK_MCLK3 6 + #endif diff --git a/sound/soc/codecs/madera.h b/sound/soc/codecs/madera.h index e0c0be59e2ef..1f4ea15648c5 100644 --- a/sound/soc/codecs/madera.h +++ b/sound/soc/codecs/madera.h @@ -9,67 +9,13 @@ #ifndef ASOC_MADERA_H #define ASOC_MADERA_H +#include #include #include #include #include "wm_adsp.h" -#define MADERA_FLL1_REFCLK 1 -#define MADERA_FLL2_REFCLK 2 -#define MADERA_FLL3_REFCLK 3 -#define MADERA_FLLAO_REFCLK 4 -#define MADERA_FLL1_SYNCCLK 5 -#define MADERA_FLL2_SYNCCLK 6 -#define MADERA_FLL3_SYNCCLK 7 -#define MADERA_FLLAO_SYNCCLK 8 - -#define MADERA_FLL_SRC_NONE -1 -#define MADERA_FLL_SRC_MCLK1 0 -#define MADERA_FLL_SRC_MCLK2 1 -#define MADERA_FLL_SRC_MCLK3 2 -#define MADERA_FLL_SRC_SLIMCLK 3 -#define MADERA_FLL_SRC_FLL1 4 -#define MADERA_FLL_SRC_FLL2 5 -#define MADERA_FLL_SRC_AIF1BCLK 8 -#define MADERA_FLL_SRC_AIF2BCLK 9 -#define MADERA_FLL_SRC_AIF3BCLK 10 -#define MADERA_FLL_SRC_AIF4BCLK 11 -#define MADERA_FLL_SRC_AIF1LRCLK 12 -#define MADERA_FLL_SRC_AIF2LRCLK 13 -#define MADERA_FLL_SRC_AIF3LRCLK 14 -#define MADERA_FLL_SRC_AIF4LRCLK 15 - -#define MADERA_CLK_SYSCLK_1 1 -#define MADERA_CLK_ASYNCCLK_1 2 -#define MADERA_CLK_OPCLK 3 -#define MADERA_CLK_ASYNC_OPCLK 4 -#define MADERA_CLK_SYSCLK_2 5 -#define MADERA_CLK_SYSCLK_3 6 -#define MADERA_CLK_ASYNCCLK_2 7 -#define MADERA_CLK_DSPCLK 8 -#define MADERA_CLK_OUTCLK 9 - -#define MADERA_CLK_SRC_MCLK1 0x0 -#define MADERA_CLK_SRC_MCLK2 0x1 -#define MADERA_CLK_SRC_MCLK3 0x2 -#define MADERA_CLK_SRC_FLL1 0x4 -#define MADERA_CLK_SRC_FLL2 0x5 -#define MADERA_CLK_SRC_FLL3 0x6 -#define MADERA_CLK_SRC_FLLAO_HI 0x7 -#define MADERA_CLK_SRC_FLL1_DIV6 0x7 -#define MADERA_CLK_SRC_AIF1BCLK 0x8 -#define MADERA_CLK_SRC_AIF2BCLK 0x9 -#define MADERA_CLK_SRC_AIF3BCLK 0xA -#define MADERA_CLK_SRC_AIF4BCLK 0xB -#define MADERA_CLK_SRC_FLLAO 0xF - -#define MADERA_OUTCLK_SYSCLK 0 -#define MADERA_OUTCLK_ASYNCCLK 1 -#define MADERA_OUTCLK_MCLK1 4 -#define MADERA_OUTCLK_MCLK2 5 -#define MADERA_OUTCLK_MCLK3 6 - #define MADERA_MIXER_VOL_MASK 0x00FE #define MADERA_MIXER_VOL_SHIFT 1 #define MADERA_MIXER_VOL_WIDTH 7