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=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 2B3FCC48BCD for ; Wed, 9 Jun 2021 19:03:40 +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 CCB76613D4 for ; Wed, 9 Jun 2021 19:03:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CCB76613D4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.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 7726A16C7; Wed, 9 Jun 2021 21:02:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7726A16C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1623265416; bh=01ekqEr7/oKQrK293xZwJEbpRjqwL9EMuSKoKq+9fCQ=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Z5EKoUzFCkzI7MQogvwI3G6qfwuJIdRuFKsdPmkN2y9ttRCl0BDX6Kj1OLmzc4dfE 8DXuSCJhXUnOZf7fiZcYrgafyuiQEqq7tP+MLO/ilJ8QP6MMh/6GzAIavhsdrfpPzR 8Mm31SdMBBSi0bKjQTMHggSzgtTetxXKk/RUdrSs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E573FF80212; Wed, 9 Jun 2021 21:02:45 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A9D02F8026C; Wed, 9 Jun 2021 21:02:44 +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 1C57EF800F4 for ; Wed, 9 Jun 2021 21:02:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1C57EF800F4 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ANyQsTqW" Received: by mail.kernel.org (Postfix) with ESMTPSA id 7F60E613CA; Wed, 9 Jun 2021 19:02:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623265353; bh=01ekqEr7/oKQrK293xZwJEbpRjqwL9EMuSKoKq+9fCQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ANyQsTqW9jkL7tJ5o8WN2TFDaZ7uI8G/1l2wIG4s4Rtdnj0trnOX5+3wq/RyXoubu PU67pN2h+3F79jrO/G7ONF/u903jmIt1/EXgCghb6Wc/RLAynSieww3/Cu1j5JhVTs 2ewQj6d5zLtBJpgDYQkWJxcQLGcLoEw1XBIb3Nic= Date: Wed, 9 Jun 2021 21:02:30 +0200 From: Greg KH To: Pierre-Louis Bossart Subject: Re: [PATCH v4] soundwire: intel: move to auxiliary bus Message-ID: References: <20210511052132.28150-1-yung-chuan.liao@linux.intel.com> <21002781-0b78-3b36-952f-683482a925d7@linux.intel.com> <07dbe0a2-0abb-810b-ef39-b83511d3f3e0@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <07dbe0a2-0abb-810b-ef39-b83511d3f3e0@linux.intel.com> Cc: alsa-devel@alsa-project.org, Leon Romanovsky , Ranjani Sridharan , linux-kernel@vger.kernel.org, hui.wang@canonical.com, Vinod Koul , Jason Gunthorpe , Dave Ertman , 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 Wed, Jun 09, 2021 at 09:44:08AM -0500, Pierre-Louis Bossart wrote: > The model is exactly the same as what we have today with the platform > devices. We did not add ANY new fields or information, what is passed in > that structure is exactly the same as what we do upstream today with the > platform devices. > > To make my point, here is the structure in intel.h as of v5.13-rc1 > > struct sdw_intel_link_res { > struct platform_device *pdev; > void __iomem *mmio_base; /* not strictly needed, useful for debug */ > void __iomem *registers; > void __iomem *shim; > void __iomem *alh; > int irq; > const struct sdw_intel_ops *ops; > struct device *dev; > struct mutex *shim_lock; /* protect shared registers */ > u32 *shim_mask; > u32 clock_stop_quirks; > u32 link_mask; > struct sdw_cdns *cdns; > struct list_head list; > }; > > and here's what we suggested in this patch: > > struct sdw_intel_link_res { > void __iomem *mmio_base; /* not strictly needed, useful for debug */ > void __iomem *registers; > void __iomem *shim; > void __iomem *alh; > int irq; > const struct sdw_intel_ops *ops; > struct device *dev; > struct mutex *shim_lock; /* protect shared registers */ > u32 *shim_mask; > u32 clock_stop_quirks; > u32 link_mask; > struct sdw_cdns *cdns; > struct list_head list; > }; > > You will notice that we removed the platform_device *pdev, but embedded this > structure into a larger one to make use of container_of() > > struct sdw_intel_link_dev { > struct auxiliary_device auxdev; > struct sdw_intel_link_res link_res; > }; > > That's it. We did not change anything else, all the other fields are > identical. We are only changing the TYPE of device and the interfaces for > probe/remove but using the same information and the same device hierarchy. And this is the correct thing to do, you have done it properly here, nice work. greg k-h 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=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 6C6A7C48BCF for ; Wed, 9 Jun 2021 19:02:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 47478613DF for ; Wed, 9 Jun 2021 19:02:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229771AbhFITE3 (ORCPT ); Wed, 9 Jun 2021 15:04:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:42824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbhFITE2 (ORCPT ); Wed, 9 Jun 2021 15:04:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7F60E613CA; Wed, 9 Jun 2021 19:02:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623265353; bh=01ekqEr7/oKQrK293xZwJEbpRjqwL9EMuSKoKq+9fCQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ANyQsTqW9jkL7tJ5o8WN2TFDaZ7uI8G/1l2wIG4s4Rtdnj0trnOX5+3wq/RyXoubu PU67pN2h+3F79jrO/G7ONF/u903jmIt1/EXgCghb6Wc/RLAynSieww3/Cu1j5JhVTs 2ewQj6d5zLtBJpgDYQkWJxcQLGcLoEw1XBIb3Nic= Date: Wed, 9 Jun 2021 21:02:30 +0200 From: Greg KH To: Pierre-Louis Bossart Cc: Vinod Koul , alsa-devel@alsa-project.org, Leon Romanovsky , linux-kernel@vger.kernel.org, Ranjani Sridharan , hui.wang@canonical.com, Jason Gunthorpe , Dave Ertman , sanyog.r.kale@intel.com, Bard Liao , rander.wang@linux.intel.com, bard.liao@intel.com Subject: Re: [PATCH v4] soundwire: intel: move to auxiliary bus Message-ID: References: <20210511052132.28150-1-yung-chuan.liao@linux.intel.com> <21002781-0b78-3b36-952f-683482a925d7@linux.intel.com> <07dbe0a2-0abb-810b-ef39-b83511d3f3e0@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <07dbe0a2-0abb-810b-ef39-b83511d3f3e0@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 09, 2021 at 09:44:08AM -0500, Pierre-Louis Bossart wrote: > The model is exactly the same as what we have today with the platform > devices. We did not add ANY new fields or information, what is passed in > that structure is exactly the same as what we do upstream today with the > platform devices. > > To make my point, here is the structure in intel.h as of v5.13-rc1 > > struct sdw_intel_link_res { > struct platform_device *pdev; > void __iomem *mmio_base; /* not strictly needed, useful for debug */ > void __iomem *registers; > void __iomem *shim; > void __iomem *alh; > int irq; > const struct sdw_intel_ops *ops; > struct device *dev; > struct mutex *shim_lock; /* protect shared registers */ > u32 *shim_mask; > u32 clock_stop_quirks; > u32 link_mask; > struct sdw_cdns *cdns; > struct list_head list; > }; > > and here's what we suggested in this patch: > > struct sdw_intel_link_res { > void __iomem *mmio_base; /* not strictly needed, useful for debug */ > void __iomem *registers; > void __iomem *shim; > void __iomem *alh; > int irq; > const struct sdw_intel_ops *ops; > struct device *dev; > struct mutex *shim_lock; /* protect shared registers */ > u32 *shim_mask; > u32 clock_stop_quirks; > u32 link_mask; > struct sdw_cdns *cdns; > struct list_head list; > }; > > You will notice that we removed the platform_device *pdev, but embedded this > structure into a larger one to make use of container_of() > > struct sdw_intel_link_dev { > struct auxiliary_device auxdev; > struct sdw_intel_link_res link_res; > }; > > That's it. We did not change anything else, all the other fields are > identical. We are only changing the TYPE of device and the interfaces for > probe/remove but using the same information and the same device hierarchy. And this is the correct thing to do, you have done it properly here, nice work. greg k-h