From patchwork Fri Mar 12 12:00:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 398602 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1132970jai; Fri, 12 Mar 2021 04:01:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzk8NqZiZ1k6g4cI+tHHhS0V6wORSRsx6QL+QleILl+05PsLUDHJeFbg9tVQ4sp870FxA04 X-Received: by 2002:a05:6402:510b:: with SMTP id m11mr13797816edd.103.1615550482426; Fri, 12 Mar 2021 04:01:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615550482; cv=none; d=google.com; s=arc-20160816; b=RtsD1GMVeNnVYD9KW4hCTyWNZvMfKXAwtxvF1WppdbPy89EbL3XmFUUStJPtDvh1vG wZTVCZkVYhP8/cvm+i45RVQZRNUmJIkCEIMw8uph5ZxujqgS4uONF7NJTc85WB7i9Ht9 JfbG5CxhpAwGbMYWvjrgcf/Fs35b9W8Cp68zG9kNP9bYgqqQkbZh/ivKdcL9eANmv74j RqvICHzMYeS/aKZ8MsDQMf2io6EGIl0IfgigUwEYDC9E0fz5KlGyN9MER++RFjHe8tSh iifiXFi6g5g+fqBVgPLazKsMws6Jn72OKQLcZ6xVyIl/zrIk/hwtvUo36MFcqKUvWL5e nn8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ns+tspE3TpNVqG5EYUwkfh0nuT4Nkt3p2sWFNFRFG3w=; b=NwYMz9S76+X7b+LSJCwl+SwPfN26LNcs5cqQwJsWC5GV84Xp95xtWzeUO3Gm6LXyG3 KSVA19bEByYtOeuiPXbOhrFjiPFjRTo/WM73jVorjm6r1lUC0khu4fphxHfRB+vap2O5 CXJcwa47cVL9WSUln7zjMhNZJWMcTAYeD3iRuUuWKX8qumG/He5v+QLc6tj187T+OyZe dPe4cUpeROjKnm7+MD4n3DTvPSfnRw7KArEHJco4fpySUROzbnvPgG3KpJwYm8GL1Kl+ ckPk/fUOAY+Jbnbw23/02eQ0HzuV8CLKqGACFj4bucZMF3RcOZtnlXEv5oF5xZvORTiD ZIGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P6+peZvD; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n20si3843636ejx.104.2021.03.12.04.01.22; Fri, 12 Mar 2021 04:01:22 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-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=@linaro.org header.s=google header.b=P6+peZvD; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231439AbhCLMAx (ORCPT + 6 others); Fri, 12 Mar 2021 07:00:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231437AbhCLMAc (ORCPT ); Fri, 12 Mar 2021 07:00:32 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A1D9C061761 for ; Fri, 12 Mar 2021 04:00:32 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id l11so4655922wrp.7 for ; Fri, 12 Mar 2021 04:00:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ns+tspE3TpNVqG5EYUwkfh0nuT4Nkt3p2sWFNFRFG3w=; b=P6+peZvDODkplKd7B975gw81MJr7jqWIWBOCgEwcQ6jwIjBbL1A4fSfPMJubO9u/HI klsjbXDAggxVo9agrb0jMULcytEzWovafXLqeTCJPvnRVuG451MUOen4ZgTsVM2xkmPx DP9VCq/2rpA3kT9bLXvhQb/qWsKgd860Kvp4RuYkjt82c9UgfGZHbDma2ONT3f5uiqjL Pwj//Vr/Sac6hv2F4v3XuEZEVPoDILbXRZzgFSDFcTzf49sp9XrwfQ4NBP6fpT2Cs8IF hIS8V8ZOPlc4RmjO3OSHfUKRPmjyHP8VyroNx0+sTrQT0WluViH1T5wWPBQy0ZEpZsNU feew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ns+tspE3TpNVqG5EYUwkfh0nuT4Nkt3p2sWFNFRFG3w=; b=jDjBc8ixcDuAfSMPRCFILIqwoBkqlCNiz+GlNNA3yUDOygyZ30sI0yYqcsaKmZHjnb DC6k92eV7w6nVkffUJlWFJYJAt26TQP1Xiw0M/ZLx11jeHuCBle448zFBVI39m1GAYqX myR5o8oMFf/ZRYDPnXtSvyIEGXNydcRrXPHe2m2GgfESXQnPsi76pt/EBWRkaUqL7d25 3Q3xpbSvp1hyexU6yjIcqb64ir2IKguIxj4ipHlM+pktH++t2BzcuNo/eIFGygNN91KA ZB9EaJWH8HfPF5VeYM5GwwBa+cge9/hvgBUgImYbP/0kT9LJbbaaPr3n8+wYA79eE6f9 Qrxg== X-Gm-Message-State: AOAM533mjgsPWpW5FFgKE1O3PQDvsJimQm17n1ws4omRvejQZ8Ht4HWv 5juZBb9SgvJFQ5d4WTE9oYW7Iw== X-Received: by 2002:adf:fe48:: with SMTP id m8mr13403133wrs.135.1615550430888; Fri, 12 Mar 2021 04:00:30 -0800 (PST) Received: from srini-hackbox.lan (cpc86377-aztw32-2-0-cust226.18-1.cable.virginm.net. [92.233.226.227]) by smtp.gmail.com with ESMTPSA id h25sm2268315wml.32.2021.03.12.04.00.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 04:00:30 -0800 (PST) From: Srinivas Kandagatla To: vkoul@kernel.org Cc: yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, robh@kernel.org, devicetree@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v4 7/9] soundwire: export sdw_compare_devid() and sdw_extract_slave_id() Date: Fri, 12 Mar 2021 12:00:07 +0000 Message-Id: <20210312120009.22386-8-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210312120009.22386-1-srinivas.kandagatla@linaro.org> References: <20210312120009.22386-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Exporting these two functions makes sense as it can be used by other controllers like Qualcomm during auto-enumeration! Signed-off-by: Srinivas Kandagatla --- drivers/soundwire/bus.c | 4 +++- include/linux/soundwire/sdw.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) -- 2.21.0 diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index 46885429928a..6d7708964735 100644 --- a/drivers/soundwire/bus.c +++ b/drivers/soundwire/bus.c @@ -603,7 +603,7 @@ static struct sdw_slave *sdw_get_slave(struct sdw_bus *bus, int i) return NULL; } -static int sdw_compare_devid(struct sdw_slave *slave, struct sdw_slave_id id) +int sdw_compare_devid(struct sdw_slave *slave, struct sdw_slave_id id) { if (slave->id.mfg_id != id.mfg_id || slave->id.part_id != id.part_id || @@ -614,6 +614,7 @@ static int sdw_compare_devid(struct sdw_slave *slave, struct sdw_slave_id id) return 0; } +EXPORT_SYMBOL(sdw_compare_devid); /* called with bus_lock held */ static int sdw_get_device_num(struct sdw_slave *slave) @@ -698,6 +699,7 @@ void sdw_extract_slave_id(struct sdw_bus *bus, "SDW Slave class_id 0x%02x, mfg_id 0x%04x, part_id 0x%04x, unique_id 0x%x, version 0x%x\n", id->class_id, id->mfg_id, id->part_id, id->unique_id, id->sdw_version); } +EXPORT_SYMBOL(sdw_extract_slave_id); static int sdw_program_device_num(struct sdw_bus *bus) { diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h index b032d6ac0b39..c677ab1013ab 100644 --- a/include/linux/soundwire/sdw.h +++ b/include/linux/soundwire/sdw.h @@ -1011,5 +1011,7 @@ int sdw_write_no_pm(struct sdw_slave *slave, u32 addr, u8 value); int sdw_read_no_pm(struct sdw_slave *slave, u32 addr); int sdw_nread(struct sdw_slave *slave, u32 addr, size_t count, u8 *val); int sdw_nwrite(struct sdw_slave *slave, u32 addr, size_t count, u8 *val); +int sdw_compare_devid(struct sdw_slave *slave, struct sdw_slave_id id); +void sdw_extract_slave_id(struct sdw_bus *bus, u64 addr, struct sdw_slave_id *id); #endif /* __SOUNDWIRE_H */