From mboxrd@z Thu Jan 1 00:00:00 1970 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=-13.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 64355C433DF for ; Tue, 11 Aug 2020 12:02:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3DFEA20782 for ; Tue, 11 Aug 2020 12:02:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Sfr0g5fJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728903AbgHKMCw (ORCPT ); Tue, 11 Aug 2020 08:02:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728888AbgHKMCQ (ORCPT ); Tue, 11 Aug 2020 08:02:16 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3026C061787 for ; Tue, 11 Aug 2020 05:02:15 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id kq25so12798716ejb.3 for ; Tue, 11 Aug 2020 05:02:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UtO337UuhwrHztkf/uXMNcdRJRUGGo/p2OPF/qdxl2E=; b=Sfr0g5fJMimBf15dE6fMhdMgI0QznVXtfJt+gZEla2kYWaDQAf8FGWzxAx7q0DtYhS HL3QWZD2Bf7+3J0wt9peBnWV1Fs+iPXsIXyeD1TEiYDTb5Lc//Qn2YiFpq3nFIXcHqIG QbLFTYed/Aeo4gfv+UwO+PJRuYcGlbAaLUyelMi2EMPUwwQnvt4wQw9deYkSZZ8QjPJu 6FTQ1jPuLy6D9z2Vs+MjwVbvaNbbOMxNl/agMbyuGOCNZq47gQS0laVH5PoCqlQ+M7YO foepncG0wwI0G0EyUbJDVVKmrk3Dm8iy/ikAs2ZGyBacodY7D2F+hz4jrsoK3uyMBNMd N91Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UtO337UuhwrHztkf/uXMNcdRJRUGGo/p2OPF/qdxl2E=; b=E80KI72CVDBZ0e04/Xrb6XZQcmCHaRb+At6f4dwr/q8Chn0Iw/cINFaSxkVUHCKw3M G2hypkek72jKy7eTKnpD48jXul4SAJN1120Q3yQ7ohqg+PN8sDcb5LD3LsoFWW/QF/Tw AP9eoujIa36kUdsxeSnA0u2UslakaPXPltn4E5UhBk5njSxHHAXA0xqOcWbGYfMgpmuB kNNQeKA5TAXbsUGGpWZ+1Hb9wYu8bTKJQCDKYNKndKDDXGeqXtsYyy/+Rgjz8zgyCTm6 TDZw/jctsPSkxhmt4hEn5anFW3rvJafBO7LbQeGoqnTgw5eTMJ2MdrKjnPA89jpTReRu l1EA== X-Gm-Message-State: AOAM533ZbMedGYGNPMCVZZlpLlmoBEFFj92NwZKV0qBkJAHWqpv/P2I2 3H+mByxcKXic5D8FvZn/V5J5mg== X-Google-Smtp-Source: ABdhPJynE3JraElTEyvaK4HUeYOem+y7v5bgGfQh1UqOS+jNIUVSQ8t3NnSIo9Bn040DIQpQ6LntPg== X-Received: by 2002:a17:906:403:: with SMTP id d3mr25577883eja.522.1597147334476; Tue, 11 Aug 2020 05:02:14 -0700 (PDT) Received: from srini-hackbox.lan (cpc86377-aztw32-2-0-cust226.18-1.cable.virginm.net. [92.233.226.227]) by smtp.gmail.com with ESMTPSA id f21sm14238363edv.66.2020.08.11.05.02.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2020 05:02:13 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org Cc: tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, john.stultz@linaro.org, stephan@gerhold.net, Srinivas Kandagatla Subject: [PATCH v2 2/2] ASoC: q6routing: add dummy register read/write function Date: Tue, 11 Aug 2020 13:02:05 +0100 Message-Id: <20200811120205.21805-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200811120205.21805-1-srinivas.kandagatla@linaro.org> References: <20200811120205.21805-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Most of the DAPM widgets for DSP ASoC components reuse reg field of the widgets for its internal calculations, however these are not real registers. So read/writes to these numbers are not really valid. However ASoC core will read these registers to get default state during startup. With recent changes to ASoC core, every register read/write failures are reported very verbosely. Prior to this fails to reads are totally ignored, so we never saw any error messages. To fix this add dummy read/write function to return default value. Reported-by: John Stultz Fixes: e3a33673e845 ("ASoC: qdsp6: q6routing: Add q6routing driver") Signed-off-by: Srinivas Kandagatla --- Changes since v1: - added reg write callback sound/soc/qcom/qdsp6/q6routing.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sound/soc/qcom/qdsp6/q6routing.c b/sound/soc/qcom/qdsp6/q6routing.c index eaa95b5a7b66..25d23e0266c7 100644 --- a/sound/soc/qcom/qdsp6/q6routing.c +++ b/sound/soc/qcom/qdsp6/q6routing.c @@ -973,6 +973,20 @@ static int msm_routing_probe(struct snd_soc_component *c) return 0; } +static unsigned int q6routing_reg_read(struct snd_soc_component *component, + unsigned int reg) +{ + /* default value */ + return 0; +} + +static int q6routing_reg_write(struct snd_soc_component *component, + unsigned int reg, unsigned int val) +{ + /* dummy */ + return 0; +} + static const struct snd_soc_component_driver msm_soc_routing_component = { .probe = msm_routing_probe, .name = DRV_NAME, @@ -981,6 +995,8 @@ static const struct snd_soc_component_driver msm_soc_routing_component = { .num_dapm_widgets = ARRAY_SIZE(msm_qdsp6_widgets), .dapm_routes = intercon, .num_dapm_routes = ARRAY_SIZE(intercon), + .read = q6routing_reg_read, + .write = q6routing_reg_write, }; static int q6pcm_routing_probe(struct platform_device *pdev) -- 2.21.0 From mboxrd@z Thu Jan 1 00:00:00 1970 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=-13.0 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 15D0BC433E0 for ; Tue, 11 Aug 2020 12:04:12 +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 8321F2076C for ; Tue, 11 Aug 2020 12:04:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="XdegCqJt"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Sfr0g5fJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8321F2076C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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 CD90F1668; Tue, 11 Aug 2020 14:03:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CD90F1668 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1597147449; bh=qRHEls1vEzBzly/NaWz6gypSbYGLmyWf3Q2UsepB4zI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=XdegCqJtU9kmKl/XgBpi3e5WolkpOX/0u1Y1EnF01GM5Hj8SF3zCsHwHV+kTsmClS PccDVM4rb2ZCTp5oilT3gE+S6lm67UngR7PZhf3MFtT45ljG2zRlZLwSLaL41hDj1C r50ZZL6wqzoJ+Wo9U+Fq3sF01SEIPmWcQ/OTduL8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B77CCF80171; Tue, 11 Aug 2020 14:02:27 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0374CF8015B; Tue, 11 Aug 2020 14:02:26 +0200 (CEST) Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9F980F800D3 for ; Tue, 11 Aug 2020 14:02:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9F980F800D3 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Sfr0g5fJ" Received: by mail-ej1-x644.google.com with SMTP id o23so12809954ejr.1 for ; Tue, 11 Aug 2020 05:02:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UtO337UuhwrHztkf/uXMNcdRJRUGGo/p2OPF/qdxl2E=; b=Sfr0g5fJMimBf15dE6fMhdMgI0QznVXtfJt+gZEla2kYWaDQAf8FGWzxAx7q0DtYhS HL3QWZD2Bf7+3J0wt9peBnWV1Fs+iPXsIXyeD1TEiYDTb5Lc//Qn2YiFpq3nFIXcHqIG QbLFTYed/Aeo4gfv+UwO+PJRuYcGlbAaLUyelMi2EMPUwwQnvt4wQw9deYkSZZ8QjPJu 6FTQ1jPuLy6D9z2Vs+MjwVbvaNbbOMxNl/agMbyuGOCNZq47gQS0laVH5PoCqlQ+M7YO foepncG0wwI0G0EyUbJDVVKmrk3Dm8iy/ikAs2ZGyBacodY7D2F+hz4jrsoK3uyMBNMd N91Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UtO337UuhwrHztkf/uXMNcdRJRUGGo/p2OPF/qdxl2E=; b=XM/QEzblbD+dqlW+PjAiknZRhCLMrgxyxL+8/hmhBjdDIrxUym0bUEBIz2ocJjF7J4 GNMXo5xpaXUO/YW7a9IhR4/OS76OwyvG35ucjfdh+0PL5jCnF4jsq2pbTG0OuyZQ6po0 JGhi0aypuLcMPuYQJ85FIFqplUU1zs42QwR/lb8Ni+gWqj5LJwtnXsBjTZWrFygLbGuE GtGR3D9qKBHygLPZuEY85cYWQfTvgTg8iZ5Yg8qBNwa7ZFvxTuzN+12LJZG4zL5RxxnK PrTZy6mg+0+NtBvkQAYXwKvCVfjpa8t1StIDrY/UjQGaGoRSwF4ikqEnurDeynkeQdP4 kXgg== X-Gm-Message-State: AOAM533Ypp4OEQ5+H8G8oTa54NTM2NqMMYKgQgJx9JtgMcNWOTiXAAU3 1oK0ATafntWkUjtd5WBvgZIcVQ== X-Google-Smtp-Source: ABdhPJynE3JraElTEyvaK4HUeYOem+y7v5bgGfQh1UqOS+jNIUVSQ8t3NnSIo9Bn040DIQpQ6LntPg== X-Received: by 2002:a17:906:403:: with SMTP id d3mr25577883eja.522.1597147334476; Tue, 11 Aug 2020 05:02:14 -0700 (PDT) Received: from srini-hackbox.lan (cpc86377-aztw32-2-0-cust226.18-1.cable.virginm.net. [92.233.226.227]) by smtp.gmail.com with ESMTPSA id f21sm14238363edv.66.2020.08.11.05.02.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2020 05:02:13 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org Subject: [PATCH v2 2/2] ASoC: q6routing: add dummy register read/write function Date: Tue, 11 Aug 2020 13:02:05 +0100 Message-Id: <20200811120205.21805-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200811120205.21805-1-srinivas.kandagatla@linaro.org> References: <20200811120205.21805-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: alsa-devel@alsa-project.org, stephan@gerhold.net, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, tiwai@suse.com, john.stultz@linaro.org, Srinivas Kandagatla 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" Most of the DAPM widgets for DSP ASoC components reuse reg field of the widgets for its internal calculations, however these are not real registers. So read/writes to these numbers are not really valid. However ASoC core will read these registers to get default state during startup. With recent changes to ASoC core, every register read/write failures are reported very verbosely. Prior to this fails to reads are totally ignored, so we never saw any error messages. To fix this add dummy read/write function to return default value. Reported-by: John Stultz Fixes: e3a33673e845 ("ASoC: qdsp6: q6routing: Add q6routing driver") Signed-off-by: Srinivas Kandagatla --- Changes since v1: - added reg write callback sound/soc/qcom/qdsp6/q6routing.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sound/soc/qcom/qdsp6/q6routing.c b/sound/soc/qcom/qdsp6/q6routing.c index eaa95b5a7b66..25d23e0266c7 100644 --- a/sound/soc/qcom/qdsp6/q6routing.c +++ b/sound/soc/qcom/qdsp6/q6routing.c @@ -973,6 +973,20 @@ static int msm_routing_probe(struct snd_soc_component *c) return 0; } +static unsigned int q6routing_reg_read(struct snd_soc_component *component, + unsigned int reg) +{ + /* default value */ + return 0; +} + +static int q6routing_reg_write(struct snd_soc_component *component, + unsigned int reg, unsigned int val) +{ + /* dummy */ + return 0; +} + static const struct snd_soc_component_driver msm_soc_routing_component = { .probe = msm_routing_probe, .name = DRV_NAME, @@ -981,6 +995,8 @@ static const struct snd_soc_component_driver msm_soc_routing_component = { .num_dapm_widgets = ARRAY_SIZE(msm_qdsp6_widgets), .dapm_routes = intercon, .num_dapm_routes = ARRAY_SIZE(intercon), + .read = q6routing_reg_read, + .write = q6routing_reg_write, }; static int q6pcm_routing_probe(struct platform_device *pdev) -- 2.21.0