Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5221501pxj; Wed, 9 Jun 2021 12:04:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycXleevEhkC21J2L3jHzESJ8pgki/N+x3bUM6LlZfdbRHAOBLkK7wGmJM1WyHSSuNlKbqV X-Received: by 2002:a17:906:b0cb:: with SMTP id bk11mr1261902ejb.310.1623265478348; Wed, 09 Jun 2021 12:04:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623265478; cv=none; d=google.com; s=arc-20160816; b=rKqfkZY6huJwp+U1/UYe7pKKOOz881cXDq93F7VfApjQk6jPOUiNk40jApChZbUJjN +hPplq/ZgtibdxjjQWk+120SnoOY44BBhVNfAg+KclxBsl5U+YYG2dt/ApWShM/KoO2u +7faNpZK0YslffXK0HqGv6xvUyFpcmxDVkw+cSvalZQPjCu95rwQNCdisaRjOtJ0cVLi c5Gz12ieYNSkv1WSYy6R1/3ZaW7VwlxDju0vrXCf8riIyaR6Mqm2sFVmw30k+/P1ut92 xfKoSwA72tMoWgqF+xs4HNa1n77FX4nhWixwKFaTy2jRW7imUK1dOWRaBU9k0xh8W2eZ 2IHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DuRRrDPVrUB0Hn2lXRfE4zc9oGvCpM1WLl76byBw51I=; b=ywww73rpe4BXL1OPMFMfSc+8jhdlutkzye49vsFnuak0/BfB3v7eMFGWvwQIZOci4Q PmUyBbcrq0PwmWyNWA+Zai1sN+5xDpLFwAVOaWU9yXFt9Rv83a3JTnGaM0kSQ6M0g/nJ v4fZZl/h2VXgAH/jFeUo7hJH7E3gfpjLz1BjikAgin9xMhkcJySwyA4LTja0vgmNYtC3 5MiKKTgg/XBCHOjlr+vxHxBasQmu84ISnOJsO7SBHnyQFLH6zui22oIeeb5qyOBGThTL OVqDAY/8AXIH3WCajjY8YWRip+B2MFPS2IOZOukRRNUl+9f/sGlViKyP9QD6NhXp+Pbf 5UaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ANyQsTqW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v29si363799eda.545.2021.06.09.12.04.08; Wed, 09 Jun 2021 12:04:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ANyQsTqW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229536AbhFITE3 (ORCPT + 99 others); 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