From patchwork Tue Dec 1 17:32:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 7739151 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8236E9F39D for ; Tue, 1 Dec 2015 17:32:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A349120650 for ; Tue, 1 Dec 2015 17:32:58 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 6D73220544 for ; Tue, 1 Dec 2015 17:32:57 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 78CB3264F39; Tue, 1 Dec 2015 18:32:55 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id A01D7261B07; Tue, 1 Dec 2015 18:32:47 +0100 (CET) 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 B643C261B1E; Tue, 1 Dec 2015 18:32:44 +0100 (CET) Received: from mx0a-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by alsa0.perex.cz (Postfix) with ESMTP id 62361261AFF for ; Tue, 1 Dec 2015 18:32:37 +0100 (CET) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.15.0.59/8.15.0.59) with SMTP id tB1HTVRj026231; Tue, 1 Dec 2015 11:32:35 -0600 Received: from mail1.cirrus.com (mail1.cirrus.com [141.131.3.20]) by mx0a-001ae601.pphosted.com with ESMTP id 1yhbgwrd85-1; Tue, 01 Dec 2015 11:32:35 -0600 Received: from EX12.ad.cirrus.com (unknown [172.19.9.182]) by mail1.cirrus.com (Postfix) with ESMTP id D334D34036; Tue, 1 Dec 2015 11:32:51 -0600 (CST) Received: from imbe.wolfsonmicro.main (172.20.9.178) by EX12.ad.cirrus.com (172.19.9.182) with Microsoft SMTP Server id 14.3.248.2; Tue, 1 Dec 2015 17:32:13 +0000 Received: from algalon.wolfsonmicro.main ([172.22.20.24]) by imbe.wolfsonmicro.main (8.14.4/8.14.4) with ESMTP id tB1HW9aB017392; Tue, 1 Dec 2015 17:32:09 GMT From: Charles Keepax To: Date: Tue, 1 Dec 2015 17:32:08 +0000 Message-ID: <1448991128-22784-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310000 definitions=main-1512010279 Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, lgirdwood@gmail.com Subject: [alsa-devel] [PATCH] ASoC: dapm: Replace siggen widget type with mic widgets 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 The siggen widget type doesn't really require its own special handling. It can be handled identically to a mic widget, ie. it is a source of a signal and causes things to power up when an output is connected. Additionally, several places (cs42l52, cs42l56, wm8962, arizona_haptics) tie siggens in to the input framework and the pattern for this is usually to use snd_soc_dapm_enable_pin/disable_pin on the siggen widget. However, as siggen widgets present as always on (the power check always returns 1), this leads to some odd interactions with DAPM. Enabling/disabling the widget then connecting it to a path works as expected, however once in a path enabling the widget has no effect. dapm_widget_set_power will return immediately as the current power state of the widget will return 1, meaning we never check peer power states. Treating the widget as a mic widget causes the expected behaviour in all cases. This does cause a minor cosmetic side effect that siggen widgets no longer show as always on through debugfs, although in the case described above that is more representive of their behaviour. Signed-off-by: Charles Keepax --- include/sound/soc-dapm.h | 2 +- sound/soc/soc-dapm.c | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 9706946..67f176f 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -47,7 +47,7 @@ struct device; /* platform domain */ #define SND_SOC_DAPM_SIGGEN(wname) \ -{ .id = snd_soc_dapm_siggen, .name = wname, .kcontrol_news = NULL, \ +{ .id = snd_soc_dapm_mic, .name = wname, .kcontrol_news = NULL, \ .num_kcontrols = 0, .reg = SND_SOC_NOPM } #define SND_SOC_DAPM_SINK(wname) \ { .id = snd_soc_dapm_sink, .name = wname, .kcontrol_news = NULL, \ diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index a8156b5..ea6f477 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -1817,12 +1817,9 @@ static int dapm_power_widgets(struct snd_soc_card *card, int event) /* Supplies and micbiases only bring the * context up to STANDBY as unless something * else is active and passing audio they - * generally don't require full power. Signal - * generators are virtual pins and have no - * power impact themselves. + * generally don't require full power. */ switch (w->id) { - case snd_soc_dapm_siggen: case snd_soc_dapm_vmid: break; case snd_soc_dapm_supply: @@ -3354,7 +3351,6 @@ snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm, w->power_check = dapm_generic_check_power; break; case snd_soc_dapm_vmid: - case snd_soc_dapm_siggen: w->is_ep = SND_SOC_DAPM_EP_SOURCE; w->power_check = dapm_always_on_check_power; break;