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=-1.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 33860C54E4B for ; Tue, 12 May 2020 03:30:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE4A22070B for ; Tue, 12 May 2020 03:30:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589254244; bh=QNWc4mCSUQkWmfV/BNuwNh/r3Nw7d08P4k2wYg5jrDo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=AEybvslQW/VLcYo/BuDKfnKy/woiHRtWeE+c/JVfE9q0t9qyYTGTjc9/Im44M2z2A y14+waCE0yP98iJOv9CNlGfpPUu+M3QqfsL+w/Qwbi9hgnCrK03Pk2oiqzLlCROtxh PdiZe6ZG4iDR7X/CHMF8TGxAdy/7APz99YIYGnBc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728775AbgELDan (ORCPT ); Mon, 11 May 2020 23:30:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:51836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728115AbgELDam (ORCPT ); Mon, 11 May 2020 23:30:42 -0400 Received: from localhost (unknown [171.76.78.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 88FDD206B9; Tue, 12 May 2020 03:30:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589254241; bh=QNWc4mCSUQkWmfV/BNuwNh/r3Nw7d08P4k2wYg5jrDo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DXljxuItkt/Ukfz/eJPpHgaVnfEHwiP5bCPwjke9teJ8Hob+gJ3hupnjt2b1996UX leH+KWNPvkvy0IFqe3koseuEWo8D7y9XlJOL6lqXlOo4JOJjM4PRBL2WpFxKPzEt+V WYcVWKB2KW0zGtvRBbH5De9dgkRJKGfSYUO9N2Ts= Date: Tue, 12 May 2020 09:00:35 +0530 From: Vinod Koul To: Pierre-Louis Bossart Cc: Bard Liao , alsa-devel@alsa-project.org, tiwai@suse.de, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, ranjani.sridharan@linux.intel.com, hui.wang@canonical.com, broonie@kernel.org, srinivas.kandagatla@linaro.org, jank@cadence.com, mengdong.lin@intel.com, slawomir.blauciak@intel.com, sanyog.r.kale@intel.com, rander.wang@linux.intel.com, bard.liao@intel.com Subject: Re: [PATCH 3/3] soundwire: bus_type: add sdw_master_device support Message-ID: <20200512033035.GV1375924@vkoul-mobl> References: <20200429185145.12891-1-yung-chuan.liao@linux.intel.com> <20200429185145.12891-4-yung-chuan.liao@linux.intel.com> <20200511063227.GS1375924@vkoul-mobl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11-05-20, 14:00, Pierre-Louis Bossart wrote: > > > + md = &bus->md; > > > + md->dev.bus = &sdw_bus_type; > > > + md->dev.type = &sdw_master_type; > > > + md->dev.parent = parent; > > > + md->dev.of_node = parent->of_node; > > > + md->dev.fwnode = fwnode; > > > + md->dev.dma_mask = parent->dma_mask; > > > + > > > + dev_set_name(&md->dev, "sdw-master-%d", bus->link_id); > > > > This give nice sdw-master-0. In DT this comes from reg property. I dont > > seem to recall if the ACPI/Disco spec treats link_id as unique across > > the system, can you check that please, if not we would need to update > > this. > Table 3 in the Disco for Soundwire 1.0 spec: "all LinkID values are relative > to the immediate parent Device." > > There isn't any known implementation with more than one controller. But then it can come in "future" right. So lets try to make it future proof by not using the link_id (we can expose that as a sysfs if people want to know). So a global unique id needs to allocated (hint: idr or equivalent) and used as master_id Thanks -- ~Vinod 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=-1.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 0EA5CC54E8B for ; Tue, 12 May 2020 03:31:50 +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 8B3832070B for ; Tue, 12 May 2020 03:31:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Nww7n8RE"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="DXljxuIt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B3832070B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.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 D0B7D86E; Tue, 12 May 2020 05:30:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D0B7D86E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1589254307; bh=QNWc4mCSUQkWmfV/BNuwNh/r3Nw7d08P4k2wYg5jrDo=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Nww7n8RESgqzpx3ShW00jRDRZmEEs6EgX7xB4WDUheCsWlASaDQ4FoegbS4mtxEUf N0/BFhfq0dz/gNFtxKwTt5XvacrjUgOebBAbFef+wEl5uzux3PQpQRGjTRB0Wemv05 szvu1CM7L9WxziGlSNzgx5Rdcbx51DF12bf/dPqo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 40953F80112; Tue, 12 May 2020 05:30:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 80985F8014C; Tue, 12 May 2020 05:30:50 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0F9A1F800E3 for ; Tue, 12 May 2020 05:30:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0F9A1F800E3 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="DXljxuIt" Received: from localhost (unknown [171.76.78.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 88FDD206B9; Tue, 12 May 2020 03:30:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589254241; bh=QNWc4mCSUQkWmfV/BNuwNh/r3Nw7d08P4k2wYg5jrDo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DXljxuItkt/Ukfz/eJPpHgaVnfEHwiP5bCPwjke9teJ8Hob+gJ3hupnjt2b1996UX leH+KWNPvkvy0IFqe3koseuEWo8D7y9XlJOL6lqXlOo4JOJjM4PRBL2WpFxKPzEt+V WYcVWKB2KW0zGtvRBbH5De9dgkRJKGfSYUO9N2Ts= Date: Tue, 12 May 2020 09:00:35 +0530 From: Vinod Koul To: Pierre-Louis Bossart Subject: Re: [PATCH 3/3] soundwire: bus_type: add sdw_master_device support Message-ID: <20200512033035.GV1375924@vkoul-mobl> References: <20200429185145.12891-1-yung-chuan.liao@linux.intel.com> <20200429185145.12891-4-yung-chuan.liao@linux.intel.com> <20200511063227.GS1375924@vkoul-mobl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Cc: alsa-devel@alsa-project.org, tiwai@suse.de, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, ranjani.sridharan@linux.intel.com, hui.wang@canonical.com, broonie@kernel.org, srinivas.kandagatla@linaro.org, jank@cadence.com, mengdong.lin@intel.com, slawomir.blauciak@intel.com, sanyog.r.kale@intel.com, Bard Liao , rander.wang@linux.intel.com, bard.liao@intel.com 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" On 11-05-20, 14:00, Pierre-Louis Bossart wrote: > > > + md = &bus->md; > > > + md->dev.bus = &sdw_bus_type; > > > + md->dev.type = &sdw_master_type; > > > + md->dev.parent = parent; > > > + md->dev.of_node = parent->of_node; > > > + md->dev.fwnode = fwnode; > > > + md->dev.dma_mask = parent->dma_mask; > > > + > > > + dev_set_name(&md->dev, "sdw-master-%d", bus->link_id); > > > > This give nice sdw-master-0. In DT this comes from reg property. I dont > > seem to recall if the ACPI/Disco spec treats link_id as unique across > > the system, can you check that please, if not we would need to update > > this. > Table 3 in the Disco for Soundwire 1.0 spec: "all LinkID values are relative > to the immediate parent Device." > > There isn't any known implementation with more than one controller. But then it can come in "future" right. So lets try to make it future proof by not using the link_id (we can expose that as a sysfs if people want to know). So a global unique id needs to allocated (hint: idr or equivalent) and used as master_id Thanks -- ~Vinod