Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4031306ybx; Mon, 4 Nov 2019 06:46:05 -0800 (PST) X-Google-Smtp-Source: APXvYqzN746fWfWYAHHVOb/pNsFRE7qDMhKWzHG/tfn8XTsp3NyfX4gGZuqB6etPSfD1BTl+t5SW X-Received: by 2002:a17:906:ecf5:: with SMTP id qt21mr23908234ejb.295.1572878765311; Mon, 04 Nov 2019 06:46:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572878765; cv=none; d=google.com; s=arc-20160816; b=kz9USzKSV0cTpgsl9xJM30YUkYj7yCFY9iAra73KLczQvi8IoVb8Usbo2ee+oPvadB dYfDxhiz6zq2XSk2UclCiUOQF/NS49yqqU0rJkekrTfaCgFpv/Go4WtnIE6mL1bBkgcq dluHve+HNRz2+Bbie5CW4+TVLFplLBRdQbarKn69RlOKrXGTKL8z5PtYhkaplcxA4XxC QA0ULfT/jWoT6QwR2GpDpV6HH4994fLOYcfTL9pHiGKbj/t/55NDOhIUYWFppZ3PQaiY P5NbRbmxwMt/ad1NjekSn1s7CnjMQPMtzL68fdOLPG9hHgEY2q60J5Nf0fqg3XldNCFo aNHQ== 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=7g04xtjvWwJCMuAWSDflLwC+YISS9p0znRtDjV00krc=; b=eAsgcloOkVCLhbZuVQgVotqGGpGq9zxHXK9IuttVFIFYdxkutPasGEz6i4e1o063h1 2RVfTkqZuxCuK/niAqz8zPxGixxGGJB+QlbWrGCRFf1tjxZCi37gNU2KgO6ryse4AnOV ALPm5Ppf7IopO+0Ka/7q67DfnOxhizKExVrsGQeRo/AKw2mDLCGHuQLr8no1zWYPnEhr w+IBNWvcj81N/1P8aLKm6OTsgAKNyERraMTxGUyIsxn/nTrR+nmBAziSKN34wrZ+ufLG kBsXALXXBBgtWFVLrbuLDO1O29mlc7+H1s6tDRsN4FjnYSMHgK6qW5dzQxjD/4AJ6nCZ EcZA== 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 m16si12398017ejd.306.2019.11.04.06.45.42; Mon, 04 Nov 2019 06:46:05 -0800 (PST) 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 S1728417AbfKDOoL (ORCPT + 99 others); Mon, 4 Nov 2019 09:44:11 -0500 Received: from mga14.intel.com ([192.55.52.115]:29247 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728012AbfKDOoL (ORCPT ); Mon, 4 Nov 2019 09:44:11 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Nov 2019 06:44:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,267,1569308400"; d="scan'208";a="402993333" Received: from cckuo1-mobl2.amr.corp.intel.com (HELO [10.251.130.8]) ([10.251.130.8]) by fmsmga006.fm.intel.com with ESMTP; 04 Nov 2019 06:44:09 -0800 Subject: Re: [alsa-devel] [PATCH 06/14] soundwire: add support for sdw_slave_type 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, Bard liao , Rander Wang , Ranjani Sridharan , Sanyog Kale References: <20191023212823.608-1-pierre-louis.bossart@linux.intel.com> <20191023212823.608-7-pierre-louis.bossart@linux.intel.com> <20191103053243.GI2695@vkoul-mobl.Dlink> From: Pierre-Louis Bossart Message-ID: Date: Mon, 4 Nov 2019 08:35:52 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <20191103053243.GI2695@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 11/3/19 12:32 AM, Vinod Koul wrote: > On 23-10-19, 16:28, Pierre-Louis Bossart wrote: >> Currently the bus does not have any explicit support for master >> devices. Add explicit support for sdw_slave_type, so that in >> follow-up patches we can add support for the sdw_md_type (md==Master >> Device), following the Grey Bus example. >> >> Signed-off-by: Pierre-Louis Bossart >> --- >> drivers/soundwire/bus_type.c | 9 ++++++++- >> drivers/soundwire/slave.c | 7 ++++++- >> include/linux/soundwire/sdw_type.h | 6 ++++++ >> 3 files changed, 20 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/soundwire/bus_type.c b/drivers/soundwire/bus_type.c >> index 9a0fd3ee1014..5df095f4e12f 100644 >> --- a/drivers/soundwire/bus_type.c >> +++ b/drivers/soundwire/bus_type.c >> @@ -49,9 +49,16 @@ int sdw_slave_modalias(const struct sdw_slave *slave, char *buf, size_t size) >> >> static int sdw_uevent(struct device *dev, struct kobj_uevent_env *env) >> { >> - struct sdw_slave *slave = to_sdw_slave_device(dev); >> + struct sdw_slave *slave; >> char modalias[32]; >> >> + if (is_sdw_slave(dev)) { >> + slave = to_sdw_slave_device(dev); >> + } else { >> + dev_warn(dev, "uevent for unknown Soundwire type\n"); >> + return -EINVAL; > > when is the case where this would be triggered? this is in preparation for the master case, where you will have 2 types of devices, so need to check if the type is correct.