Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1532570pxk; Tue, 1 Sep 2020 00:37:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVu8CuFSlhpJKUB72++37ZY/sVJUITRrKDwpraytGzFVY5upBVn9afosZQ754M0+7uHXkv X-Received: by 2002:a50:b946:: with SMTP id m64mr657396ede.92.1598945870691; Tue, 01 Sep 2020 00:37:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598945870; cv=none; d=google.com; s=arc-20160816; b=a58LBSI98vjYonLhQNcl5zvMv/cBDo805mbZtQBRJVCjYOzYrGj/CKDtpsGA+a4NHP C1IcRhJPGCadWCTAHihC/iTUDeCjuDbiGYz1Txo6mGUCX2G3EGyDilEoZ32pmgsMzW9j qAE8dwcoUNXl4gtgJ6oexdWr1OlmEDmfFiUAbWCG8q2BUqtQ3TUJsJCBU00WUHnbRxg0 G5Ph9IYReZ9dETO0KoGLU0qDqSyAoPOCdn8uGJgSN1R6YJHNXa7mv0P51G/0FliPeNcX mN2VNVYrqQVmsaMfLAJ5PH2ATXCDVO/wCsbIZbia5ZRqWmTPEJoJUcgwnOodbtAg4bek NSCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:date:to:cc:from :subject:references:in-reply-to:content-transfer-encoding :mime-version:dkim-signature; bh=kB+SZnK0sJkXPueegsNdekLuZ/MjR9UpX90Irxxyzvk=; b=nrv1unvqfzTq5lliSdXpM0lVPS90veRj96OofKN6kTwutSzsIyrEDiGivP9VMN0bdN R74L7nA6yO+d3JSo33cAzlSOGz/Y0d4mPtdsNkSq060rblWUWtvMT8AMUXptwYQwt5eg lMcXFpNfD/SeC1WicnCvO35EjQitfC5LgXxtPyeloP0X9GhvUEBE1hKDMReSd1s/t9vx LsJkObwJy9jeClgfN5zb98341GXmFoXcCnl/Ix8zqC5Vh9QH+2RH++MgE4qQxiTM/Qz0 hPbyLuaSnJdrhR8jEqklL8qJ2KNNGTS1fbj7xhxx9VPyxhbZb4rf3cewKfonKt8PHw/j dGtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VnhVnWJC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si140425eda.569.2020.09.01.00.37.27; Tue, 01 Sep 2020 00:37:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VnhVnWJC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727115AbgIAHgi (ORCPT + 99 others); Tue, 1 Sep 2020 03:36:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727089AbgIAHgi (ORCPT ); Tue, 1 Sep 2020 03:36:38 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E757C061247 for ; Tue, 1 Sep 2020 00:36:37 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id k15so301754pfc.12 for ; Tue, 01 Sep 2020 00:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:in-reply-to:references :subject:from:cc:to:date:message-id:user-agent; bh=kB+SZnK0sJkXPueegsNdekLuZ/MjR9UpX90Irxxyzvk=; b=VnhVnWJCP27/mVmO155ONgdwRlS85VvnyJzWOT7jautIZGGqr3zliTS6J4SRsFI+3J sd+uwQ245EwDzVeb0Roq/gsPN09BWfu7bIcGYX+BrByvVqXdEJWtwtySa9erBzpCTdZ0 4tIvtJ+5bT84mJLGYgPCLNPN5qHhTgNOwLOnI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding :in-reply-to:references:subject:from:cc:to:date:message-id :user-agent; bh=kB+SZnK0sJkXPueegsNdekLuZ/MjR9UpX90Irxxyzvk=; b=V2WJwGuWzol1snjIMm4EaFFcVCNA2NTMkfNNgQji5NDaGYZ50kjV4Tri8AYQjdJALf SIWIQoM2Yu79Cb8foYAIUMJv5puchMXbOSFWvtOfsmka4EI+ORlYlTZP7UruNMuUHKwi 5L5U4UlliRO+vQSNkXW0JlnMQQnggNG1z+yQJmYBWE2fVZ9A/lLvwqngQSz2NRHpiKkt 25GWNG3iIyhbM8a2YfN7sRDKSKYyvETHL6Rys5m09hpXf6qEs/kUO0uNgOiR/dhwPWdR Vr9dkhNIaOLnF/tlcHSmFpNv4/c+G4FC2+kxhAK1oBiXd1DFyQrd8tIsjvxq9YH9ImYR Bf3A== X-Gm-Message-State: AOAM531wsiS0eOshPZx5gnF3XsR5VDQ0KriAYAcxzh5FXhBair03OQqa BsUbo4uGcTEun6I15ifGk+aRO37uIv8uyQ== X-Received: by 2002:a63:cd57:: with SMTP id a23mr438823pgj.10.1598945796121; Tue, 01 Sep 2020 00:36:36 -0700 (PDT) Received: from chromium.org ([2620:15c:202:1:3e52:82ff:fe6c:83ab]) by smtp.gmail.com with ESMTPSA id e124sm692938pfa.87.2020.09.01.00.36.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2020 00:36:35 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <1598855964-1042-4-git-send-email-srivasam@codeaurora.org> References: <1598855964-1042-1-git-send-email-srivasam@codeaurora.org> <1598855964-1042-4-git-send-email-srivasam@codeaurora.org> Subject: Re: [PATCH v3 3/5] ASoC: qcom: Add support for lpass hdmi driver From: Stephen Boyd Cc: V Sujith Kumar Reddy , Srinivasa Rao To: Srinivasa Rao Mandadapu , agross@kernel.org, alsa-devel@alsa-project.org, bgoswami@codeaurora.org, bjorn.andersson@linaro.org, broonie@kernel.org, devicetree@vger.kernel.org, lgirdwood@gmail.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, perex@perex.cz, plai@codeaurora.org, robh+dt@kernel.org, rohitkr@codeaurora.org, srinivas.kandagatla@linaro.org, tiwai@suse.com Date: Tue, 01 Sep 2020 00:36:34 -0700 Message-ID: <159894579447.334488.1604209140945740724@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Srinivasa Rao Mandadapu (2020-08-30 23:39:22) > diff --git a/sound/soc/qcom/lpass-hdmi.c b/sound/soc/qcom/lpass-hdmi.c > new file mode 100644 > index 0000000..7e18113 > --- /dev/null > +++ b/sound/soc/qcom/lpass-hdmi.c > @@ -0,0 +1,684 @@ > +// SPDX-License-Identifier: GPL-2.0-only [...] > + > +static int lpass_hdmi_daiops_hw_params(struct snd_pcm_substream *substre= am, > + struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) > +{ [...] > + data_format =3D LPASS_DATA_FORMAT_LINEAR; > + ch_sts_buf0 =3D (((data_format << LPASS_DATA_FORMAT_SHIFT) & LPAS= S_DATA_FORMAT_MASK) > + | ((sampling_freq << LPASS_FREQ_BIT_SHIFT= ) & LPASS_FREQ_BIT_MASK)); > + ch_sts_buf1 =3D (word_length) & LPASS_WORDLENGTH_MASK; > + > + ret =3D regmap_field_write(drvdata->tx_ctl->soft_reset, LPASS_TX_= CTL_RESET); > + if (ret) { > + dev_err(dai->dev, "%s error writing to softreset enable := %d\n", All of these strings bloat the kernel image. Can we just return ret instead and if something goes wrong we can use a debug patch to figure out which register write failed? Would a register write even fail to begin with? > + __func__, ret); > + return ret; > + } > + > + ret =3D regmap_field_write(drvdata->tx_ctl->soft_reset, LPASS_TX_= CTL_CLEAR); > + if (ret) { > + dev_err(dai->dev, "%s error writing to softreset disable = : %d\n", > + __func__, ret); > + return ret; > + } > + > + ret =3D regmap_field_write(drvdata->legacy->legacy_en, > + LPASS_HDMITX_LEGACY_DISABLE); > + if (ret) { > + dev_err(dai->dev, "%s error writing to legacy_en field : = %d\n", > + __func__, ret); > + return ret; > + } > + [...] > #define LPAIF_DMACTL_REG(v, chan, dir) __LPAIF_DMA_REG(v, chan, dir, CTL) > #define LPAIF_DMABASE_REG(v, chan, dir) __LPAIF_DMA_REG(v, chan, dir, BA= SE) > diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platf= orm.c > index df692ed..607f4c4 100644 > --- a/sound/soc/qcom/lpass-platform.c > +++ b/sound/soc/qcom/lpass-platform.c > @@ -553,7 +702,21 @@ static irqreturn_t lpass_platform_lpaif_irq(int irq,= void *data) > =20 > /* Handle per channel interrupts */ > for (chan =3D 0; chan < LPASS_MAX_DMA_CHANNELS; chan++) { > - if (irqs & LPAIF_IRQ_ALL(chan) && drvdata->substream[chan= ]) { > + switch (v->id) { > + case HDMI_INTERFACE: > + val =3D LPAIF_IRQ_HDMI_REQ_ON_PRELOAD(chan) | > + LPAIF_IRQ_HDMI_METADONE | > + LPAIF_IRQ_HDMI_SDEEP_AUD_DIS(chan); > + break; > + case I2S_INTERFACE: > + val =3D 0; > + break; > + default: > + pr_err("%s: invalid %d interface\n", __func__, v= ->id); Any reason we can't use dev_err() here? > + return -EINVAL; > + } > + if (irqs & (LPAIF_IRQ_ALL(chan) | val) > + && drvdata->substream[chan]) { > rv =3D lpass_dma_interrupt_handler( > drvdata->substream[chan], > drvdata, chan, irqs); > @@ -644,15 +807,15 @@ int asoc_qcom_lpass_platform_register(struct platfo= rm_device *pdev) > =20 > /* ensure audio hardware is disabled */ > ret =3D regmap_write(drvdata->lpaif_map, > - LPAIF_IRQEN_REG(v, LPAIF_IRQ_PORT_HOST), 0); > + IRQ_EN(v, LPAIF_IRQ_PORT_HOST), 0); > if (ret) { > dev_err(&pdev->dev, "error writing to irqen reg: %d\n", r= et); > return ret; > } > =20 > ret =3D devm_request_irq(&pdev->dev, drvdata->lpaif_irq, > - lpass_platform_lpaif_irq, IRQF_TRIGGER_RISING, > - "lpass-irq-lpaif", drvdata); > + lpass_platform_lpaif_irq, IRQF_TRIGGER_RISING, Can we use the irq flags from the firmware, i.e. whatever the DT or ACPI tables say? > + pdev->name, drvdata); > if (ret) { > dev_err(&pdev->dev, "irq request failed: %d\n", ret); > return ret;