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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3C5B3C3DA78 for ; Fri, 13 Jan 2023 19:29:15 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B4BD9AFAA; Fri, 13 Jan 2023 20:28:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B4BD9AFAA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1673638153; bh=z3ekLWY5ObJLmIVZrmrckQLOgVzWCWpMqm4KtCSrWtI=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=ZxRDa3NcAbptb+8t6fQSsEeIQjphL/mPY9YuMC2sqlAyoHhgkLem6ME2Y5SqEz4TR 75QJayK+O2jGyX6CcU6AURA8eEM4gLl13isDndh1OATNUEDemL7P0zHGgFJavjqzaA bO7cZ2/YHKjPYaI0uTQCqvVqnGrIOZGivqS92BPA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E3936F80424; Fri, 13 Jan 2023 20:27:57 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 30790F804A9; Fri, 13 Jan 2023 20:27:55 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F0286F8030F for ; Fri, 13 Jan 2023 20:27:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F0286F8030F Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=JHWaXsvi DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673638074; x=1705174074; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=z3ekLWY5ObJLmIVZrmrckQLOgVzWCWpMqm4KtCSrWtI=; b=JHWaXsvic+wzkeAcIkovVDUWX3N4VCTFiG1CJVJ4ZYuCyFiq7Yw3Kp1Q GmsyMvv/Uuz70BUgdxaH9EGdJFEr2BHnC7xzNo9Q+mwlNAHNQv/0+IrfY E5HRYYJ5WoMZw79g0fnUCXczUFQVLd5InQc+NXYSYRTorhwc/aaRtQ+tb uGQX4+DK5LyXg32TV2SitYTwK/Dv2YVu4xVQIqUYsmOhSdwxHiBQRa3HD 0UmHMwzD+ZzvaZepU0CYdeMcp2rSgJ872y11IUqCObi/cOgRR90MtOTur MqI6gmPQIxvtgcPX+BTInD2JZFv9A79h/Tt8dozFf3RU3MPr65rXab2Ll w==; X-IronPort-AV: E=McAfee;i="6500,9779,10589"; a="322777236" X-IronPort-AV: E=Sophos;i="5.97,214,1669104000"; d="scan'208";a="322777236" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2023 11:27:50 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10589"; a="608257464" X-IronPort-AV: E=Sophos;i="5.97,214,1669104000"; d="scan'208";a="608257464" Received: from rerayess-mobl.amr.corp.intel.com (HELO [10.212.13.223]) ([10.212.13.223]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2023 11:27:49 -0800 Message-ID: <68b22ad4-1da0-48e4-a3aa-2b55e5553c01@linux.intel.com> Date: Fri, 13 Jan 2023 11:13:46 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.4.2 Subject: Re: [PATCH 03/19] soundwire: amd: register sdw controller dai ops Content-Language: en-US To: "Mukunda,Vijendar" , broonie@kernel.org, vkoul@kernel.org, alsa-devel@alsa-project.org References: <20230111090222.2016499-1-Vijendar.Mukunda@amd.com> <20230111090222.2016499-4-Vijendar.Mukunda@amd.com> From: Pierre-Louis Bossart In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: Mastan.Katragadda@amd.com, Sunil-kumar.Dommati@amd.com, Basavaraj.Hiregoudar@amd.com, open list , Mario.Limonciello@amd.com, arungopal.kondaveeti@amd.com, Sanyog Kale , Bard Liao Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" >>> +static int amd_sdwc_hw_params(struct snd_pcm_substream *substream, >>> + struct snd_pcm_hw_params *params, >>> + struct snd_soc_dai *dai) >>> +{ >>> + struct amd_sdwc_ctrl *ctrl = snd_soc_dai_get_drvdata(dai); >>> + struct sdw_amd_dma_data *dma; >>> + struct sdw_stream_config sconfig; >>> + struct sdw_port_config *pconfig; >>> + int ch, dir; >>> + int ret; >>> + >>> + dma = snd_soc_dai_get_dma_data(dai, substream); >>> + if (!dma) >>> + return -EIO; >>> + >>> + ch = params_channels(params); >>> + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) >>> + dir = SDW_DATA_DIR_RX; >>> + else >>> + dir = SDW_DATA_DIR_TX; >>> + dev_dbg(ctrl->dev, "%s: dir:%d dai->id:0x%x\n", __func__, dir, dai->id); >>> + dma->hw_params = params; >>> + >>> + sconfig.direction = dir; >>> + sconfig.ch_count = ch; >>> + sconfig.frame_rate = params_rate(params); >>> + sconfig.type = dma->stream_type; >>> + >>> + sconfig.bps = snd_pcm_format_width(params_format(params)); >>> + >>> + /* Port configuration */ >>> + pconfig = kzalloc(sizeof(*pconfig), GFP_KERNEL); >>> + if (!pconfig) { >>> + ret = -ENOMEM; >>> + goto error; >>> + } >>> + >>> + pconfig->num = dai->id; >>> + pconfig->ch_mask = (1 << ch) - 1; >>> + ret = sdw_stream_add_master(&ctrl->bus, &sconfig, >>> + pconfig, 1, dma->stream); >>> + if (ret) >>> + dev_err(ctrl->dev, "add master to stream failed:%d\n", ret); >>> + >>> + kfree(pconfig); >>> +error: >>> + return ret; >>> +} >> This looks inspired from intel.c, but you are not programming ANY >> registers here. is this intentional? > We don't have any additional registers to be programmed like intel. ok, this is worthy of a comment. >>> +static const struct snd_soc_dai_ops amd_sdwc_dai_ops = { >>> + .hw_params = amd_sdwc_hw_params, >>> + .hw_free = amd_sdwc_hw_free, >>> + .set_stream = amd_pcm_set_sdw_stream, >> In the first patch there was support for PDM exposed, but here it's PDM >> only? > Didn't get your question. > First patch talks about creating dev nodes for Soundwire managers and > ACP PDM controller based on ACP pin config. Sorry, my comment has a typo. I meant that the first patch exposed PDM support but here you only have PCM?