From patchwork Thu Oct 11 16:28:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 10637057 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E99C61508 for ; Thu, 11 Oct 2018 17:06:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D389B2BB93 for ; Thu, 11 Oct 2018 17:06:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5DD32BCDA; Thu, 11 Oct 2018 17:06:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C885D2BB93 for ; Thu, 11 Oct 2018 17:06:44 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 15C05267943; Thu, 11 Oct 2018 18:28:43 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 09BE8267957; Thu, 11 Oct 2018 18:28:40 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by alsa0.perex.cz (Postfix) with ESMTP id 62E102678FE for ; Thu, 11 Oct 2018 18:28:36 +0200 (CEST) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w9BGSYGJ020802; Thu, 11 Oct 2018 11:28:34 -0500 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from mail3.cirrus.com ([87.246.76.56]) by mx0b-001ae601.pphosted.com with ESMTP id 2mxu49892m-1; Thu, 11 Oct 2018 11:28:33 -0500 Received: from EX17.ad.cirrus.com (ex17.ad.cirrus.com [172.20.9.81]) by mail3.cirrus.com (Postfix) with ESMTP id 98D92611C8B8; Thu, 11 Oct 2018 11:30:45 -0500 (CDT) Received: from imbe.wolfsonmicro.main (198.61.95.81) by EX17.ad.cirrus.com (172.20.9.81) with Microsoft SMTP Server id 14.3.408.0; Thu, 11 Oct 2018 17:28:31 +0100 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by imbe.wolfsonmicro.main (8.14.4/8.14.4) with ESMTP id w9BGSVIQ010322; Thu, 11 Oct 2018 17:28:31 +0100 From: Charles Keepax To: Date: Thu, 11 Oct 2018 17:28:27 +0100 Message-ID: <20181011162831.26351-1-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=570 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810110158 Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org, lgirdwood@gmail.com Subject: [alsa-devel] [RFC PATCH 0/4] Initial prototype of DAPM sample rate domains X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Here is a first pass at adding dapm sample rate domain support. Things are still pretty rough in quite a few places and I expect some major refactoring before they are ready to merge, but things are far enough along for people to look at the approach I am taking to the problem. And should provide enough for discussion at the mini-conference, although hopefully I will get some more done next week as well. The basic high level summary is two new concepts are added to ASoC, one being a sample rate domain and the other being a domain group. The domain groups represent widgets that are limited by hardware restrictions to always run at the same sample rate as each other. Sample rate domains represent a slot on a device for a sample rate. Both of these are currently limited to be within the scope of a single component. The core will track which groups are connected together, then as a group is powered up it will be allocated a domain based on the other groups it is connected to. Domain groups are implemented as a new type of DAPM widget and the domains themselves are a new thing which devices add through their component drivers. As we have previously discussed my intention would be that we also add bridges between domains although I haven't started work on that yet. The current code is limited to within a single component and I think that the bridges will allow better support for propagating rates between components as well as obviously for SRCs. Currently the SRCs on wm5110 are just being handled as points where the domain groups don't connect to another peer. This allows them to function but doesn't accurately convey things like the limitations which input rates support which output rates on the ISRC. Thanks, Charles Charles Keepax (4): ASoC: dapm: Add support for hw_free on CODEC to CODEC links ASoC: dapm: Add support for a rate domain widget ASoC: domain: Add sample rate domain support ASoC: arizona: Add rate domain support include/sound/soc-dapm.h | 14 ++ include/sound/soc-domain.h | 98 +++++++++++ include/sound/soc.h | 8 + sound/soc/Makefile | 2 +- sound/soc/codecs/arizona.c | 255 ++++++++++++++++++++++------ sound/soc/codecs/arizona.h | 76 ++++++++- sound/soc/codecs/wm5110.c | 414 ++++++++++++++++++++++++++++++++++----------- sound/soc/soc-core.c | 8 + sound/soc/soc-dapm.c | 57 ++++++- sound/soc/soc-domain.c | 412 ++++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 1183 insertions(+), 161 deletions(-) create mode 100644 include/sound/soc-domain.h create mode 100644 sound/soc/soc-domain.c