Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp774997ybh; Sat, 3 Aug 2019 09:31:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwryAIXlkAlp62KQvOPxYKyyY5eu5XJgv6hYi4GO488O3qu8qfz2jRfGREefF2w6jSd410 X-Received: by 2002:aa7:8817:: with SMTP id c23mr66095016pfo.146.1564849871973; Sat, 03 Aug 2019 09:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564849871; cv=none; d=google.com; s=arc-20160816; b=VlrZ+upk8cA6i9yzdUrZ+84MFvM2uHXcn/Wni7AHZTiqmXKYmvTVUn8IQqn8VAuvsD 3mEx/etPBlGqXx1fZyYPRNP5tVJk9/XDEi0u81FehctSM0hgPra3QvSo69lt2oz6joi4 zsviDhBktxibV14AJbN2bc+4cxsorm0CUYfA+3vImbKGX/7yXl238pe6aJDYLVS9TtAS uilmiynoQmEHHA++VcbByMMgvPD+oeeGbVlHcsti+WFiNecNbyEhbWkMsK20ZewEfWas cZWy9ILAC6NbsX8y8Cpb6L2G4mPwfdPnF3g1LLMD6j7ExutFJqocQI3DWDtayRoSEsa9 /PaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=jM1yf31r8yro1aYEWsK7PvgWLA73p0KvJwF987VONA4=; b=lfh/nuzbZ+FICmqAIKzhseKzR2S8NrIkBvSpuJ1xYLIDye4EjQeIUCj+fZnZ8Rg2iX wnmeBqRzCLhcOPl3eyUHpdl4Zvh//Yd4/wWgegB8ZYmXkiURi4n3vZ3lI2fGY18jpVlT aBIvqmoZKXUwIEUB7ItAYcJ3Kp6N0Bu/5Yrqbz7QxajgsEcuA+x56wPPflk5t7ZHvF6b B0d8N1ijVLfKkIdjkRCFF7CCrjvP49Mq6wEuth769eYPJUiljvxEs/PtLTHbsZDawfSM WIz/aIZps6CTbIVHtgLEM0fIAdLaPPDZyGNEPjGkxAp3mijmac0zMZxoHe4ik9aAd1AA OjxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l24si2691549pgj.173.2019.08.03.09.30.55; Sat, 03 Aug 2019 09:31:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404932AbfHBRYM (ORCPT + 99 others); Fri, 2 Aug 2019 13:24:12 -0400 Received: from mga14.intel.com ([192.55.52.115]:2162 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404689AbfHBRYL (ORCPT ); Fri, 2 Aug 2019 13:24:11 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Aug 2019 10:24:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,338,1559545200"; d="scan'208";a="324630980" Received: from linux.intel.com ([10.54.29.200]) by orsmga004.jf.intel.com with ESMTP; 02 Aug 2019 10:24:10 -0700 Received: from cwhanson-mobl.amr.corp.intel.com (unknown [10.252.133.191]) by linux.intel.com (Postfix) with ESMTP id 65DFC58046F; Fri, 2 Aug 2019 10:24:09 -0700 (PDT) Subject: Re: [RFC PATCH 24/40] soundwire: cadence_master: use BIOS defaults for frame shape To: Vinod Koul Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, slawomir.blauciak@intel.com, Sanyog Kale References: <20190725234032.21152-1-pierre-louis.bossart@linux.intel.com> <20190725234032.21152-25-pierre-louis.bossart@linux.intel.com> <20190802171014.GZ12733@vkoul-mobl.Dlink> From: Pierre-Louis Bossart Message-ID: Date: Fri, 2 Aug 2019 12:24:08 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190802171014.GZ12733@vkoul-mobl.Dlink> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/2/19 12:10 PM, Vinod Koul wrote: > On 25-07-19, 18:40, Pierre-Louis Bossart wrote: >> Remove hard-coding and use BIOS values. If they are wrong use default > > BIOS :) this is cadence, am sure this can be used outside BIOS :D > > It would be better to say firmware (ACPI/DT) yes > >> 48x2 frame shape. >> >> Signed-off-by: Pierre-Louis Bossart >> --- >> drivers/soundwire/cadence_master.c | 19 +++++++++++++++++-- >> 1 file changed, 17 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c >> index 442f78c00f09..d84344e29f71 100644 >> --- a/drivers/soundwire/cadence_master.c >> +++ b/drivers/soundwire/cadence_master.c >> @@ -175,7 +175,6 @@ >> /* Driver defaults */ >> >> #define CDNS_DEFAULT_CLK_DIVIDER 0 >> -#define CDNS_DEFAULT_FRAME_SHAPE 0x30 >> #define CDNS_DEFAULT_SSP_INTERVAL 0x18 >> #define CDNS_TX_TIMEOUT 2000 >> >> @@ -954,6 +953,20 @@ int sdw_cdns_pdi_init(struct sdw_cdns *cdns, >> } >> EXPORT_SYMBOL(sdw_cdns_pdi_init); >> >> +static u32 cdns_set_default_frame_shape(int n_rows, int n_cols) >> +{ >> + u32 val; >> + int c; >> + int r; > > This can be in single line! one line per variable is what I prefer. > >> + >> + r = sdw_find_row_index(n_rows); >> + c = sdw_find_col_index(n_cols); >> + >> + val = (r << 3) | c; > > Magic 3? yes fixed already.