Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1380015rwd; Thu, 15 Jun 2023 09:43:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5mOJzBabkQXqK/9z2qhkhPp6dWHfCEFy6FPp56UBeX2B/VjaLkWHYbMKURslCa4XMd2lwl X-Received: by 2002:a17:90a:c7d2:b0:25e:3c2b:37d1 with SMTP id gf18-20020a17090ac7d200b0025e3c2b37d1mr4004536pjb.39.1686847424559; Thu, 15 Jun 2023 09:43:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686847424; cv=none; d=google.com; s=arc-20160816; b=S4I3Etl56tOWVM4K1JZAWe73rNBDCXtExNcB+rSV6r+iNns1y4PTDnaiYPwLjOo+fY 8Wm/7kgo2faQW4mU53RwwI651SSg83yUHA4Y0Cr1Upx0KNaDul8B9K1yQDr3fRH4gthS fcBmscO23nexlvYrNH2ZH2jeZtclivsTX1FTph61KG+eeApasTfXE4sXoA7O6WaCr6eP Q88j6iVjUmbGcfaYqs+IkCeeGTbbflo/9ZedJ33Mwk02vB1eGtnkir52T9Y2yX5jCA43 cVnhxRPCxFNHy2S17GGiXX1bELjC8uj5VeqPE4G6EBohwjBt0PVgp4k4drIwhbKw55rY vgnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=nmboS0DdN93O5jXwgL/NwbOGzCwZLu+63yTFEHeWSa4=; b=pHonIvsfFLKgMTMf+d0YDFdnEuI2pKhCrzNnSbotoLASKJwvBJAYtvgs1ropEHKpoe +cam0BbJ85phvDHyDiMiyL3wagOvpfmzawsgmxNHZIwv57CtI5zL1hizUfUch1bcduys AOKJyvh2iAStbisZ1TMhwzcDNbwb7yJg7PGGAxe2z1n8+v4k3QYHZJNrSnTFWJ53GrJQ 1d1hJjDlTOHyffS3p8g4Cwv3/RYKtOWGFmgAP87LA89EKKEep9iohWAN0TnOYtpNPHOe 7dzSWatf07fy2uSFIKwkUhldwVDrlUKyUp6RraNbDaLyQUFbE6+zaEJ3cCQb20eH8Es4 lP0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="hLFw/TIn"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 13-20020a63010d000000b0054201a3f08dsi12964990pgb.592.2023.06.15.09.43.32; Thu, 15 Jun 2023 09:43:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="hLFw/TIn"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231300AbjFOQag (ORCPT + 99 others); Thu, 15 Jun 2023 12:30:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231245AbjFOQad (ORCPT ); Thu, 15 Jun 2023 12:30:33 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E230273E for ; Thu, 15 Jun 2023 09:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686846632; x=1718382632; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=wxqMg8pf+Z+Iffs07wBWUeS7VLTVDNo0vpmK0c0PBOE=; b=hLFw/TInoQeZ0gHgjYvavivsruUBNWjPwxGdd4/2V/DV5N/tsa9CeN1I lXyEJw+euE1Q+OMVzJpWp8l/3YinVHRpOojvb0KMRkfPw371yHxfQZwC/ lxnrYkjh37V4jj8H/cbepnjiPRdrRm0r0rrlTQuXMNVtguHDm4XgW6cF1 lsMGSkf6XUVNgQmrtQZOOFFueY0HK6mOdhSNzqhW/rvQVexmFRsXB1FyI SIcZ68o0+6luPPVm6FULEXSprrzmGGxC15MLQxE1FwH8e6exZAeJkD19A uN39EFGA37/TaGdA2NhL0IgUKtVm8xNKTgOLRjcfFJAfU4yV8Ea+a4pw6 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10742"; a="422603166" X-IronPort-AV: E=Sophos;i="6.00,245,1681196400"; d="scan'208";a="422603166" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2023 09:24:27 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10742"; a="745640902" X-IronPort-AV: E=Sophos;i="6.00,245,1681196400"; d="scan'208";a="745640902" Received: from mrejmak-mobl.ger.corp.intel.com (HELO [10.252.36.104]) ([10.252.36.104]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2023 09:24:22 -0700 Message-ID: <59da8a18-752a-bc8c-c8c5-19d75d8c87fb@linux.intel.com> Date: Thu, 15 Jun 2023 18:23:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.11.0 Subject: Re: [PATCH V4 1/9] ASoC: amd: ps: create platform devices based on acp config Content-Language: en-US To: "Mukunda,Vijendar" , broonie@kernel.org Cc: alsa-devel@alsa-project.org, Basavaraj.Hiregoudar@amd.com, Sunil-kumar.Dommati@amd.com, Mastan.Katragadda@amd.com, Arungopal.kondaveeti@amd.com, mario.limonciello@amd.com, Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Syed Saba Kareem , open list References: <20230612095903.2113464-1-Vijendar.Mukunda@amd.com> <20230612095903.2113464-2-Vijendar.Mukunda@amd.com> <5899c2b8-e984-fda9-5e12-190b0c9fd3b2@linux.intel.com> From: Pierre-Louis Bossart In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/13/23 07:42, Mukunda,Vijendar wrote: > On 12/06/23 23:39, Pierre-Louis Bossart wrote: >> = >>> +static int sdw_amd_scan_controller(struct device *dev) >>> +{ >>> + struct acp63_dev_data *acp_data; >>> + struct fwnode_handle *link; >>> + char name[32]; >>> + u32 sdw_manager_bitmap; >>> + u8 count = 0; >>> + u32 acp_sdw_power_mode = 0; >>> + int index; >>> + int ret; >>> + >>> + acp_data = dev_get_drvdata(dev); >>> + /* >>> + * Current implementation is based on MIPI DisCo 2.0 spec. >>> + * Found controller, find links supported. >>> + */ >>> + ret = fwnode_property_read_u32_array((acp_data->sdw_fw_node), "mipi-sdw-manager-list", >>> + &sdw_manager_bitmap, 1); >>> + >>> + if (ret) { >>> + dev_err(dev, "Failed to read mipi-sdw-manager-list: %d\n", ret); >>> + return -EINVAL; >>> + } >>> + count = hweight32(sdw_manager_bitmap); >>> + /* Check count is within bounds */ >>> + if (count > AMD_SDW_MAX_MANAGERS) { >>> + dev_err(dev, "Manager count %d exceeds max %d\n", count, AMD_SDW_MAX_MANAGERS); >>> + return -EINVAL; >>> + } >> nit-pick: the count is not enough, you should also check that only bits >> 0 and 1 are set in mipi-sdw-manager-list... > As per our design for PS platform, > we will go with two bit map values as 0x03 and 0x01. > 1. As per ACP PIN CONFIG, we support Single SDW Manager instance > which refers to SW0 manager instance. For this, we need to use bitmap > value as 0x01. > 2. Other bit map value - 0x03 will be used to populate two SoundWire > manager instances. > We have extra sub property "amd-sdw-enable" to invoke the init sequence > for SoundWire manager. > > As we are supporting two bit map value combinations here, it's not required > to check bit set value. count value is enough to know manager instance count. > It doesn't break anything. Not a blocker but you underestimate the creativity of UEFI BIOS writers...