From patchwork Tue Mar 9 14:15:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 395987 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp2621064jai; Tue, 9 Mar 2021 06:16:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7qSZTQHp+z88eSd3Dwil6taCxjNMNJoDh0g3NiaT6f6OysCBow9QcB1J99yDqNrX4wZEL X-Received: by 2002:a17:906:a2d3:: with SMTP id by19mr16150721ejb.98.1615299392983; Tue, 09 Mar 2021 06:16:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615299392; cv=none; d=google.com; s=arc-20160816; b=PUMHI+mw5Yr1K5bHY7Guam+G0ZyjnjkUgS2Vd3Yvhg17QNdebVfHEgVpgRWrcVlaPb lyVH4ltks/b7HCv2REdskvdauaOjx5WNX3ROrqGzJeITsAsumlxNrnFGkdP+Z+Q/C56O P8cwICQqzDoCCPt6wJksBcdrl8+F2a0yenfmePSnTEoItjtZAYTY+Tk3jg37n5TKd3S3 QOnb4lyb7oBn6hoxQ1B4GvbcvELyvYm9VYhkraRmoz8HGzBg7YvEKTXP+VJ0Fu3c0DL6 3XhQLjx8Ll0Tfl4n/0x4CLMsU4V+MgvAiSu3UMVPMjuWuv4KxeWsOgI5hTTbfJ6sffuU HlpA== 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=7gDmC37JxzQ5hGBDDct3/T0SwytsBBauAUrn0ZFgLOw=; b=cc6bvSVDzqPv8UvPtVtkco2bzAP4OstlIhPubmn5U5QjpKii79Tj6OmwfsQhIhHTcz i/Sa2FULeYofV+OJwnwhhXg0YoUdd0aWm12f5SiGBH2bQu9uPUGcHO686FlDC5ZG6fT8 1fiRB16Tm00NGhGTJnzF1eBv8c27b1ufdKrIJNCspVsBRPBpuYSvlW6kNTbxbqbd/Oyk BoUTFCsV8WnOUoujPSlmOnnLe59/mqinsMg/3ftXMaKkCcA/DiDJRIJlzB2vno6sldDN zN741i0EULyQFDUKvU5MGzx9tjiAKuqExZbQA1LGdV8dRL7E4c/5RIJe0TcmmXLhgiRh txpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="VMfw2/F3"; 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 h26si9227740edq.453.2021.03.09.06.16.32; Tue, 09 Mar 2021 06:16:32 -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="VMfw2/F3"; 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 S230147AbhCIOQA (ORCPT + 6 others); Tue, 9 Mar 2021 09:16:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230299AbhCIOPf (ORCPT ); Tue, 9 Mar 2021 09:15:35 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5F30C06174A for ; Tue, 9 Mar 2021 06:15:34 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id a18so15851240wrc.13 for ; Tue, 09 Mar 2021 06:15:34 -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=7gDmC37JxzQ5hGBDDct3/T0SwytsBBauAUrn0ZFgLOw=; b=VMfw2/F318b244pqC02hJYJaHUKyllWsXMoL96g5Bx3Exg5BpOWKfk396oEP6ylN6h Htuzw4Jb7IrefcX1arcdOlAxcp3FHx4SG6Vm9yRoboFzvTvQqx+auDxgKm66yNq6C9wK sFnQ92HhHYDwTwdbOUEI6JfWH7wU83fWUqXByEvXQTp1VgaSpZn1TpV6DhwWk7vDMsis QWltgCtEx4awHj0350HhRtv3mPIu3YT9AFda+jjqlKDLQDq32/XVDJPFuHclO6J49rV3 fCGiBPfkiBvcLRzvc2ktHCGlUR1bNS9FH+0nk8Nm5FCDVS2Wr5m6NK0Y2B/8zs5LjjcY JQJg== 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=7gDmC37JxzQ5hGBDDct3/T0SwytsBBauAUrn0ZFgLOw=; b=TgfzQXt6zSeqMUdU+AuFQwMLNhoTx+fAChT0mwndv523X6xzmv36xvrZ6431PcvJlT 5I716NmsXfMg10Dw2N+9u78GZO95cyQdn1GqIMO8B9YxkL3raAw5KezcE3Q+e+bGlSoj IewcxDqbxLjOGvfI0r4TawbH9GLSI1CxyCwZ11kVMiwmB5E6JGhfBLu+Pl02LPWObkvb r+ZXgqgfwmTAC3QKw9QIjtLh03woicvp/WVBJaAvjcntFFUyLDhYZWJS7xgZeJhAl4eh N0FmR7k3aToCMEjRVZEf0dEWSC+/mT9U+mHX5KEuwfQAvCY86SSfhw585IudVP75j0az 9Wdg== X-Gm-Message-State: AOAM532X2XKCgF1H0RlDjjXK65n1lt/i2TL+qriUG5rS2gOdgWQkPxtj 547gkHgCIFkAYm0ILc/w7Eq7ig== X-Received: by 2002:adf:e34f:: with SMTP id n15mr28566940wrj.224.1615299333563; Tue, 09 Mar 2021 06:15:33 -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 u20sm28007579wru.6.2021.03.09.06.15.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 06:15:32 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, vkoul@kernel.org Cc: robh@kernel.org, devicetree@vger.kernel.org, yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Srinivas Kandagatla Subject: [PATCH v2 1/5] soundwire: add static port mapping support Date: Tue, 9 Mar 2021 14:15:10 +0000 Message-Id: <20210309141514.24744-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210309141514.24744-1-srinivas.kandagatla@linaro.org> References: <20210309141514.24744-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Some of the SoundWire device ports are statically mapped to Controller ports during design, however there is no way to expose this information to the controller. Controllers like Qualcomm ones use this info to setup static bandwith parameters for those ports. A generic port allocation is not possible in this cases! So this patch adds a new member m_port_map to struct sdw_slave to expose this static map. Signed-off-by: Srinivas Kandagatla --- include/linux/soundwire/sdw.h | 2 ++ 1 file changed, 2 insertions(+) -- 2.21.0 diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h index d08039d65825..2f52d6609076 100644 --- a/include/linux/soundwire/sdw.h +++ b/include/linux/soundwire/sdw.h @@ -614,6 +614,7 @@ struct sdw_slave_ops { * @debugfs: Slave debugfs * @node: node for bus list * @port_ready: Port ready completion flag for each Slave port + * @m_port_map: static Master port map for each Slave port * @dev_num: Current Device Number, values can be 0 or dev_num_sticky * @dev_num_sticky: one-time static Device Number assigned by Bus * @probed: boolean tracking driver state @@ -645,6 +646,7 @@ struct sdw_slave { #endif struct list_head node; struct completion port_ready[SDW_MAX_PORTS]; + unsigned int m_port_map[SDW_MAX_PORTS]; enum sdw_clk_stop_mode curr_clk_stop_mode; u16 dev_num; u16 dev_num_sticky; From patchwork Tue Mar 9 14:15:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 395990 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp2621091jai; Tue, 9 Mar 2021 06:16:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUUiQfjn1t+Roc7YqJbQ2dZiuddLhAdrf95wpvqbmesyeZT1H2nxvGM/VesrGbNtEhQydk X-Received: by 2002:a17:906:1fd6:: with SMTP id e22mr18987240ejt.481.1615299394728; Tue, 09 Mar 2021 06:16:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615299394; cv=none; d=google.com; s=arc-20160816; b=jWbHw8aO5fbmwd5h9gHUzl7PkYYI60TQ1wJrFOIteOndQDmSdYgabIznar0fhdBN4N fXdn/igR+JItqQAEnAKRygBz/aBdBZh5bM46tOUQqnu/08FC328Us1E+6dLRnn61mid/ ogVC/Ru7XOLwYl3SGcPwI6qrT6uTlAkqMWnXdC/2egfnUVSjs74LZV467M20BOq+WEBx kxrFLCwWPPindkscILlwBkxalUezNo+0Ldfnpt0vX71apFD8APxsPZNPoypn9NRMm7Z0 Zw8SRxg28+ePy1VGo8B3OWVFgDrBJV9ay7Eg/hHnnq5wsmoNXHtVwH5WlJ2qfDaPnAS1 1ijg== 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=wgYYRBqu2Co/W7gReOySnEqRtjbIxnEiAoNrpCeyOWk=; b=DStT87UnDu25WD0/9z7yKeITb+/ykMFawHcv3d7/KynZPgAwKL2farUHcYXUqQON/c P75h+0qLOi/IQ4Ei206CzIQ4DjEmR0lSy9nhgK1gvjDC0CCKynsKGehuVv03L5A7lQAM ReC0Uij5hXFSQxBPEnmnbBWPe0O8ZDFlrygXl02uJjy5jpLa613hJKZZMZFnMd648z/Z XEfx7Or5FFR//Nh4pqHDWHQdaUbIhd9Pl0xzdqJr71rKJI8fPqjj3xeAXA30HjXF1Dy0 njZoRRnl+66J8CJxaZN5sttymOA2+J6xzp1UFcykt4CZFlR+Yrk7MJHoNu3b3qKBAIt+ Br4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a0wPe4uB; 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 h26si9227740edq.453.2021.03.09.06.16.34; Tue, 09 Mar 2021 06:16:34 -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=a0wPe4uB; 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 S230320AbhCIOQA (ORCPT + 6 others); Tue, 9 Mar 2021 09:16:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230462AbhCIOPg (ORCPT ); Tue, 9 Mar 2021 09:15:36 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2518C06174A for ; Tue, 9 Mar 2021 06:15:35 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id 7so15930240wrz.0 for ; Tue, 09 Mar 2021 06:15:35 -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=wgYYRBqu2Co/W7gReOySnEqRtjbIxnEiAoNrpCeyOWk=; b=a0wPe4uBWNYiKbyGGwI6t+Hkruw1OOcXeqba3zAZBCB60ZCLwoQVYScCa8hzieutsh SGoyNyzWoaoR2ms5OzwPFK30f5bn+eZ6nzcSFY6ooQqqXgLOYieELbjHJd4fJqpHZ1zf MqMZdPNHQ/1kyYAcbRZKr6mjotlwtICa5A+jl2zKTjF829xKvsI4Om2j6fNLqe8ZptL9 bK2v9xGsqGCCBzA/eGip5CbVucsRc8W8oD1UvjL7Cf3FW/OKgbGuIi3tAdMpc2v7/lfB w1VR4MmEPI3kNqlWuC/T+agMZigWjqZNHid4XGC39rkWjTCam3kLtn67ZnhDLJeXoDQZ UIAg== 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=wgYYRBqu2Co/W7gReOySnEqRtjbIxnEiAoNrpCeyOWk=; b=VdzQ3GE+KtbWDRfut5YVj0D87py+m6TIi0CrjDkcs+4NdOGfoQIcl/iE4rYgUyRXhJ v+z+fOu8QbafCo+dyVJTf7lPCnlMfB5wkCGBqqiNSOAvjPTL1FfRduQBwkuwJ9SY8L9l 2obqto7Pk9T16C9AUZqSZoImGO0KHNxPN0Qi96y+OJ9NTYzg5H0XEIUszYzd6Unwo6uD ghcl6VQjOQKkgL/ElTcIgQ/IkZj9f1bVmmvZVHUmdHQa3yAsfVbqQojiwqBTmInvxvOo CIE/3QgIN4N5t+iV0jVqRC2LK6ryMc6MnhVy2Y/3GUoLHpA3SMQk+m6Tz2Xto860DUyk y7ew== X-Gm-Message-State: AOAM532XNB/euP0HBcwXtiv60MXb8qncgKIBG1Y0cjHr3YgKtVW/4AEh GOf1uyjfvuwEEBf562cpryXHMw== X-Received: by 2002:a05:6000:147:: with SMTP id r7mr29046369wrx.25.1615299334635; Tue, 09 Mar 2021 06:15:34 -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 u20sm28007579wru.6.2021.03.09.06.15.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 06:15:34 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, vkoul@kernel.org Cc: robh@kernel.org, devicetree@vger.kernel.org, yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Srinivas Kandagatla Subject: [PATCH v2 2/5] soundwire: qcom: update port map allocation bit mask Date: Tue, 9 Mar 2021 14:15:11 +0000 Message-Id: <20210309141514.24744-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210309141514.24744-1-srinivas.kandagatla@linaro.org> References: <20210309141514.24744-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org currently the internal bitmask used for allocating ports starts with offset 0. This is bit confusing as data port numbers on Qualcomm controller are valid from 1 to 14. So adjust this bit mask accordingly, this will also help while adding static port map support. Signed-off-by: Srinivas Kandagatla --- drivers/soundwire/qcom.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) -- 2.21.0 diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index 6d22df01f354..f4f1c5f2af0b 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -519,7 +519,7 @@ static void qcom_swrm_stream_free_ports(struct qcom_swrm_ctrl *ctrl, port_mask = &ctrl->din_port_mask; list_for_each_entry(p_rt, &m_rt->port_list, port_node) - clear_bit(p_rt->num - 1, port_mask); + clear_bit(p_rt->num, port_mask); } mutex_unlock(&ctrl->port_lock); @@ -552,13 +552,13 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl, list_for_each_entry(p_rt, &s_rt->port_list, port_node) { /* Port numbers start from 1 - 14*/ pn = find_first_zero_bit(port_mask, maxport); - if (pn > (maxport - 1)) { + if (pn > (maxport)) { dev_err(ctrl->dev, "All ports busy\n"); ret = -EBUSY; goto err; } set_bit(pn, port_mask); - pconfig[nports].num = pn + 1; + pconfig[nports].num = pn; pconfig[nports].ch_mask = p_rt->ch_mask; nports++; } @@ -580,7 +580,7 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl, err: if (ret) { for (i = 0; i < nports; i++) - clear_bit(pconfig[i].num - 1, port_mask); + clear_bit(pconfig[i].num, port_mask); } mutex_unlock(&ctrl->port_lock); @@ -754,6 +754,9 @@ static int qcom_swrm_get_port_config(struct qcom_swrm_ctrl *ctrl) ctrl->num_dout_ports = val; nports = ctrl->num_dout_ports + ctrl->num_din_ports; + /* port numbers are non zero, so mark port 0 */ + set_bit(0, &ctrl->dout_port_mask); + set_bit(0, &ctrl->din_port_mask); ret = of_property_read_u8_array(np, "qcom,ports-offset1", off1, nports); From patchwork Tue Mar 9 14:15:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 395989 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp2621078jai; Tue, 9 Mar 2021 06:16:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJwzCqknlHX2i1RC8ZxAMOlY8lcBtk/OHZoWY8fgHSML0ImK5y+99vuEh+RaNx0kIIEQvCDx X-Received: by 2002:a17:906:b80c:: with SMTP id dv12mr20763125ejb.110.1615299393874; Tue, 09 Mar 2021 06:16:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615299393; cv=none; d=google.com; s=arc-20160816; b=DmimlPKn9cTwHslRC6opUggvNsadvPRYTGBLnuwi2JmuO1OgP8Sj3qXJDwVd56fr1B E7g94sI0t8iZ2Vgw4fBdUepgpVKsS18KaF3Qyj0ni3ahVKbQdXW4kMuVU0187+TS2jCd kzbbzC1Mz8adhdQxmI/eNOhhLifRru+h4Let1fwOXGNOcaVerHCF6m8Jos0w3S3vHfWE WZjcH0daBm2HHIbaaqF5pyttscl5WwvVQXcaZd2dCMNXmvaYVz6Ar31TUQveho4kpM3F AGS+6dzbyCD8nNNJlrI7DABoxmju6xabfpwj6Jlt/4EjMPgVsBVYugCk4DUWIchOCj5N e7tA== 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=Ol6OkkC2nUnq8Y6A1v6xDdX14ho/H0K1X/8pX5FNFEo=; b=0u+VAVYYgj87yK70yBIdvhFEEPI+4ljW+KWV5qLKuO6dKwLQdKojxFmQFGLETFCjOi MLIvpJ0FIBClK+ivJaArEPPxS4iTY0NGmhPsJ6XH/KxWrb9qQE29f/E1ife5yiEImvY+ DYd2kOL7CPQoPur8KhRayPEl3UB1q5ObKDsokxr32un1T7fVn6N6AZEPT1vItGk3yzFr yEGZXMLCxSC7PxeNX/5LaO3lW36lFZKIBHYxG8USX1RTEaJXQVI4PpgAdDUEKtKyvj3M o8lbBMIs0cGV0+hcWNzAXLw+U6goDQkfDo1RgNsk6KvcQAB8uYH5BNtIP4joO2WM+CQU 5HGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VS6jbPEB; 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 h26si9227740edq.453.2021.03.09.06.16.33; Tue, 09 Mar 2021 06:16:33 -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=VS6jbPEB; 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 S230403AbhCIOQB (ORCPT + 6 others); Tue, 9 Mar 2021 09:16:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230490AbhCIOPh (ORCPT ); Tue, 9 Mar 2021 09:15:37 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCBAEC06175F for ; Tue, 9 Mar 2021 06:15:36 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id d15so15907009wrv.5 for ; Tue, 09 Mar 2021 06:15:36 -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=Ol6OkkC2nUnq8Y6A1v6xDdX14ho/H0K1X/8pX5FNFEo=; b=VS6jbPEBrW4C2FdnvkFOBPnTbV0uD/pIpsf1p+n3Eh2OqdKgSICyT5VXU2/IdSZ54f rYdTXRYRRhuhJW1X9+bIjk5EWynJCtJuAPkTRePPYK3v8FhgGgy4BKP1cCn3H05ioo2p 1Xj/fZ17Br0/nUqpmPVkF0aSGAuGGKFc2WURtEbIaX+4yUH4hTBU5hYI0RC/KswRDXtP MsOPTqai2Vs4P/+xxasDuCQ7I2OZMSLjbaSQgzWqAczd/0nthktjo1z7mnwBqSceG7E1 hWLAz4kdK8sieuhZtotcsL0XWJHXHUvofCpP4qNHXJQwqinUFddQ3oe5c/mF2kdYusSu or2A== 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=Ol6OkkC2nUnq8Y6A1v6xDdX14ho/H0K1X/8pX5FNFEo=; b=gGG8hjvQVGYX3kWPsiRi09GrCkuWlks/6vOb7dTWvbubKsx4a2jKFjzCSl99SQg/jo a4DFbMupzR6AualqovsxulEkcJnHtLEiA/WHrjWLStnCjH7U8tYHWmw2S781eDj0AmuH rM98elvy+nyyp+zMJgOzAiZ+CjCtw9YaKGUdZWTd/ZwYO9qyr5EAh0557bW/e6SLeAyX oWGZka1K/m+4mQCQUN2Y+6HGxXiDMhe2DCUk3IX3gFjGPdSriWtpKzSWwIwI/vx+uMYj 3seb0RHuSU4H3K9Cz38ek8DmQmlx282CJI9KbO85uZJjpoaSJoqCNMORZAMAW0PyOOH8 1g0w== X-Gm-Message-State: AOAM533p9Oy/qTa3UOaQBA++rf3ZEZkYHNwvdr2GN8GjBayu+6hJl8Uf HAcBvVGkayX9EL0EAcZuvo3zKw== X-Received: by 2002:adf:f292:: with SMTP id k18mr28854329wro.335.1615299335594; Tue, 09 Mar 2021 06:15:35 -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 u20sm28007579wru.6.2021.03.09.06.15.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 06:15:35 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, vkoul@kernel.org Cc: robh@kernel.org, devicetree@vger.kernel.org, yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Srinivas Kandagatla Subject: [PATCH v2 3/5] soundwire: qcom: add static port map support Date: Tue, 9 Mar 2021 14:15:12 +0000 Message-Id: <20210309141514.24744-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210309141514.24744-1-srinivas.kandagatla@linaro.org> References: <20210309141514.24744-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org SoundWire device ports are statically mapped to Controller ports during design. Add support to read these from SoundWire devices. This controller uses static port map info to setup bandwidth parameters for those ports. A generic port allocation is not possible in this cases! Signed-off-by: Srinivas Kandagatla --- drivers/soundwire/qcom.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) -- 2.21.0 diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index f4f1c5f2af0b..b4d1aaf535c5 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -460,6 +460,8 @@ static int qcom_swrm_compute_params(struct sdw_bus *bus) struct sdw_slave_runtime *s_rt; struct sdw_port_runtime *p_rt; struct qcom_swrm_port_config *pcfg; + struct sdw_slave *slave; + unsigned int m_port; int i = 0; list_for_each_entry(m_rt, &bus->m_rt_list, bus_node) { @@ -473,8 +475,13 @@ static int qcom_swrm_compute_params(struct sdw_bus *bus) } list_for_each_entry(s_rt, &m_rt->slave_rt_list, m_rt_node) { + slave = s_rt->slave; list_for_each_entry(p_rt, &s_rt->port_list, port_node) { - pcfg = &ctrl->pconfig[i]; + m_port = slave->m_port_map[p_rt->num - 1]; + if (m_port) + pcfg = &ctrl->pconfig[m_port - 1]; + else + pcfg = &ctrl->pconfig[i]; p_rt->transport_params.port_num = p_rt->num; p_rt->transport_params.sample_interval = pcfg->si + 1; @@ -535,8 +542,10 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl, struct sdw_master_runtime *m_rt; struct sdw_slave_runtime *s_rt; struct sdw_port_runtime *p_rt; + struct sdw_slave *slave; unsigned long *port_mask; int i, maxport, pn, nports = 0, ret = 0; + unsigned int m_port; mutex_lock(&ctrl->port_lock); list_for_each_entry(m_rt, &stream->master_list, stream_node) { @@ -549,9 +558,15 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl, } list_for_each_entry(s_rt, &m_rt->slave_rt_list, m_rt_node) { + slave = s_rt->slave; list_for_each_entry(p_rt, &s_rt->port_list, port_node) { + m_port = slave->m_port_map[p_rt->num - 1]; /* Port numbers start from 1 - 14*/ - pn = find_first_zero_bit(port_mask, maxport); + if (m_port) + pn = m_port; + else + pn = find_first_zero_bit(port_mask, maxport); + if (pn > (maxport)) { dev_err(ctrl->dev, "All ports busy\n"); ret = -EBUSY; From patchwork Tue Mar 9 14:15:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 395992 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp2621137jai; Tue, 9 Mar 2021 06:16:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/r1o1vDBLuEWLYt0SypUVepALGFzarMb5wU3TEhtIbWDn9nRqKq+nXLmRpjFqIjzUd7rC X-Received: by 2002:a17:907:7014:: with SMTP id wr20mr20917560ejb.179.1615299397017; Tue, 09 Mar 2021 06:16:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615299397; cv=none; d=google.com; s=arc-20160816; b=WldlSKn+4dRdCeLG1y9wuwcvtGTshjev+fD5DKJFu+YsL4/vGzKeAuUMcnxYhyoB5i EP6KetBy3j11obUOTP83ksqh1/AeJWzuiM+itfc/faun0+KDAKDcQbvO8g+RAGf4jgu8 b8XPzhVLn/eZiA7IGgiCAXM14iNUqLR6mv32ysCu6mBzaClrTiCGDWcY/fCAX2tLBLhs NFTYRzMNNtrnUIeMVBeVrUbqmI41A58QY9SqSgLXPvEKXonk/YgOlOi2MOD9FWb6Nl5V RcU7SwLmvv2BYLV41A5kJF/YXYdfAd930UKxSFg/nDBkqcFhl3ocVcnUuQ71qmG3eaa0 Kqtw== 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=edjmsvTbiBGyAA1eKIb4COjGcbGBPS+75xg700Bbb9k=; b=F2ISofFnpjqlgvCLCW1MFMCsFiBnnDr0/JcbKE1bezkIWt/DFB09IO2h7XPUsvg5Kp bhwPoWX7B0DwvSHqEquJEJHDCIFXDJjitmFBXvjdyqOEASIpjYtNWjWBC/RAHxzoLshp dUm//f1ZUB2VxveDZG8X6gomgQoO1EkZTT0KEk+zen5JcnzN4aivc8SZDVv9QVv/rvk4 JugHTIKFr9f2wFbu0UfM6AF3MWs7g+/CsQNCVXoZp8UXzUmbBnSWBA8ZrKFfc02yePp7 GlZiTcqVNwwmUn0J+FqoR9RWZpEXEvEaUsHK4QgKVT/hqmwkoYGaF8TWaHeWSr3/XebC RQDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="X//NLVhI"; 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 h26si9227740edq.453.2021.03.09.06.16.36; Tue, 09 Mar 2021 06:16:37 -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="X//NLVhI"; 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 S231152AbhCIOQB (ORCPT + 6 others); Tue, 9 Mar 2021 09:16:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230516AbhCIOPi (ORCPT ); Tue, 9 Mar 2021 09:15:38 -0500 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5529C06175F for ; Tue, 9 Mar 2021 06:15:37 -0800 (PST) Received: by mail-wr1-x434.google.com with SMTP id f12so15891032wrx.8 for ; Tue, 09 Mar 2021 06:15:37 -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=edjmsvTbiBGyAA1eKIb4COjGcbGBPS+75xg700Bbb9k=; b=X//NLVhIAdcbeOgoTBSqEzOS6xAs/LrLYRCs0Iz3aE+2RlVsk/ZmS0RkLWbHASlHXw lA1WEwlrcvJz4Mo6Xz1Qf8O2rPXg5suJYTTZWZhwf6JwKWDb9M1kxVQ1q722/7PdC83B rSQwb13ezL6pBecUL1R3KuBd8YPj/oX4p+BnUZ5FyDHlInhvgedjwVX4sNJDbDi1x8ch T067BcNYNiyibRD57kC2o17RsXETeMG749GHfsgCDHmy86fCa6CrpjtAkGzLgTeC75Cy vnI5hBHrVdO8uBQ3GMfisN27f23T213RQ/67DMXymXpvATdNv5E1aNni7cdSD2nBd+tT yWuA== 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=edjmsvTbiBGyAA1eKIb4COjGcbGBPS+75xg700Bbb9k=; b=CBTl6OEgh5W4vWhanxlFmw+NRq1GEvYu1kS77/8VJQtcnYXBptLoaiKp3aWBKrkKui NyQ+oR9UwWAljQZHeVtQerylJ3h3wmvjoLV7Fp/ZAu/4i+iGbGwhkRjNaFaG2MWWewXM N/U5drp2KPuKBLSUpT2iOFXqCGNohCW63WFlWtpFKgPk8t88cx7xl2fZJGQ69L48XqYS 6+RwxcixqxvylMag/mWrSggRj54dXGQ7XOtS2cWuWdFDTh940FBmASD3VN+yZ8ry3DOS apLoZLApgT5Prs+sluQ4C7Ss9a64ANQG5P7cLHXzF9wjtdg8MCeyEi5p2gCDqL5UWOzH oQeQ== X-Gm-Message-State: AOAM533tazhXG11U2GZw658gaWHlI0jg5HozqPK26wL3ISDTLaGCl+ib hofdYQJsD9/lrAkZhRyV/XaXrQ== X-Received: by 2002:adf:ff8c:: with SMTP id j12mr28335588wrr.297.1615299336486; Tue, 09 Mar 2021 06:15:36 -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 u20sm28007579wru.6.2021.03.09.06.15.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 06:15:36 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, vkoul@kernel.org Cc: robh@kernel.org, devicetree@vger.kernel.org, yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Srinivas Kandagatla Subject: [PATCH v2 4/5] ASoC: dt-bindings: wsa881x: add bindings for port mapping Date: Tue, 9 Mar 2021 14:15:13 +0000 Message-Id: <20210309141514.24744-5-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210309141514.24744-1-srinivas.kandagatla@linaro.org> References: <20210309141514.24744-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org WSA881x SoundWire device ports are statically assigned to master ports at design time. So add bindings required to specify these mappings! Signed-off-by: Srinivas Kandagatla --- .../devicetree/bindings/sound/qcom,wsa881x.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.21.0 diff --git a/Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml b/Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml index ea44d03e58ca..48bc72304b90 100644 --- a/Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml @@ -26,6 +26,13 @@ properties: description: GPIO spec for Powerdown/Shutdown line to use maxItems: 1 + qcom,port-mapping: + description: | + Specifies static port mapping between slave and master ports. + In the order of slave port index. + maxItems: 4 + $ref: /schemas/types.yaml#/definitions/uint32-array + '#thermal-sensor-cells': const: 0 @@ -54,6 +61,7 @@ examples: powerdown-gpios = <&wcdpinctrl 2 0>; #thermal-sensor-cells = <0>; #sound-dai-cells = <0>; + qcom-port-mapping = <1 2 3 7>; }; speaker@0,2 { @@ -62,6 +70,7 @@ examples: powerdown-gpios = <&wcdpinctrl 2 0>; #thermal-sensor-cells = <0>; #sound-dai-cells = <0>; + qcom-port-mapping = <4 5 6 8>; }; }; From patchwork Tue Mar 9 14:15:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 395991 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp2621121jai; Tue, 9 Mar 2021 06:16:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJTpS+BeId59ZJMUp+4HPp//ZcLm/eU/NN79Wv/c4LGJCRq0eZ7vTBcEBaYWhYdyZiy3ts X-Received: by 2002:aa7:c903:: with SMTP id b3mr4390916edt.156.1615299396124; Tue, 09 Mar 2021 06:16:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615299396; cv=none; d=google.com; s=arc-20160816; b=ItcltAssKb4q2QvFrmKkdfhJE6Lgqxb9obL7uBo5Wvf4QPVi7ODxvbWbK93HprZXur m8aB44qNCa9XyrNh4kgKVy8tTxwOTJS7DK3xUX+NUKEjugmzA0VqcybiEdt3nmBpO2qN SizMYxHF7G+1sgxaaNc3Fy7wdPFS9lQd2h1xQ0PvTcTgVRgmW+zKN+FtEAO95j62lgYU U7rAhKQXukmWUackhzufhp9dkPHvfv0aty5cqu3+FeDvCUEht3ebpmgvyAIXQSz1TSsA Y2bFok3ErYZQSRUVerMUqsPTYnJZzJc1TS43Q8lXA4oWWRSZUK5ylFIGb4jm7XlZxoy4 5vqg== 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=5k92QxyrxRTJi0W/7xlk/UVOaJACzUsOHFwPLvqgR18=; b=E8mxkNTa1xKPgmx5swEUooMB8gbP2OHWnp8XGli3NcUPzu0CyOzH9PW22n0k/eFTxw Y7Ik1rlqjx6FD0YEG8iIqRL/1ih/T3wAOoDXRJHV1lJVOAKrhfwdIE0rVqomJhl4XZNo agztAQYFdzHiHZuLm3FdpyAWNLEiV8WovDPAqa/HGNVe0kmlb1TYAbdBWzghfaz2kd9S S7qcUDzWfmceL6LyqoN1y3OFkx34Pn1XStR5/h9zJjTAnawuXE/8ytXfdOJlGP+t0vzd X8KndWJ96AFG3dcR0LZCZu9+SUrxfwLEqxTMLmSsUsJsn8+EdcphpmGkOd5XkYVv7e1m BI9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RiA6ZyC1; 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 h26si9227740edq.453.2021.03.09.06.16.35; Tue, 09 Mar 2021 06:16:36 -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=RiA6ZyC1; 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 S231200AbhCIOQB (ORCPT + 6 others); Tue, 9 Mar 2021 09:16:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231137AbhCIOPj (ORCPT ); Tue, 9 Mar 2021 09:15:39 -0500 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C31FAC06174A for ; Tue, 9 Mar 2021 06:15:38 -0800 (PST) Received: by mail-wr1-x42b.google.com with SMTP id w11so15889977wrr.10 for ; Tue, 09 Mar 2021 06:15:38 -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=5k92QxyrxRTJi0W/7xlk/UVOaJACzUsOHFwPLvqgR18=; b=RiA6ZyC1Ou9XpUVI0ItDLdRO6zud+MChTC+o6ira9EZ0LBKCxLcd8dACvfFCXex9xG p9fGwmwAdu/qM0fLG5hU2OZBg4MfZbWN73bTzYkYRS30+4biIrxv4hCR8cCmxo8lzhrb bYVcrdHfDEwi/XU/nMoe5UUQwgnui//jQX5bUPQ8Etcwz7hjAFy1mA1E/nlEy7PUm+39 qLyqPwaB+iPP8IqhopbnW5deD1QMEGHEKPxbMKDL1EkHzi+ILkcE7r1xx71+MucFMxKl EQQnAL4Ef0A3fFDmI5bLlCm8mcKv7KhFev83MLpVMYV0BYT42XI+CD5MhUKDwNUX5qph 5BDA== 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=5k92QxyrxRTJi0W/7xlk/UVOaJACzUsOHFwPLvqgR18=; b=BH0/uOD0Aht1uSX5P+56PlO5iE2FpiBUiyAIcsl3KZz9i2FY2E6KMBSsdEV5qVF/Md U+c+N9zzxlRneN9ScOtrJG+2N10tJ2s8lPZhyXaMLFE99g4QYiJLvkEUgAveSzSo8jiN dqg1dxu17pdr2bJC5BKHPMciNIR2UANWAhY8JHbe4fJPMfQn+qx6z7f2ZrI5dvWO8RF9 C7vXajwmBEEsiGoo2FIyhmxpnAx1WwbMY3BDkyb+9qlE3C3GulyyYRZOcip8nOy2CX18 bX8dE/+A6Tp4iPns3EHKAbW0bAIRSvH2oK/f89CYKcrlngZWHbMte6ZFWwUcJgEAkyAs E4Lg== X-Gm-Message-State: AOAM533Cd5DDxeptYvOIhRpokrBulH7/qTIWp/IHj7O7Cl1onJFiilYz EwXWtT0MPfWhitpl5AIQDl44lg== X-Received: by 2002:a5d:43cc:: with SMTP id v12mr28316085wrr.287.1615299337598; Tue, 09 Mar 2021 06:15:37 -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 u20sm28007579wru.6.2021.03.09.06.15.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 06:15:37 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, vkoul@kernel.org Cc: robh@kernel.org, devicetree@vger.kernel.org, yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Srinivas Kandagatla Subject: [PATCH v2 5/5] ASoC: codecs: wsa881x: add static port map support Date: Tue, 9 Mar 2021 14:15:14 +0000 Message-Id: <20210309141514.24744-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210309141514.24744-1-srinivas.kandagatla@linaro.org> References: <20210309141514.24744-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Two instances of WSA881x(Speaker Right, Speaker Left) ports are statically mapped to master ports. Allow the driver to parse those mappings from device tree. Signed-off-by: Srinivas Kandagatla --- sound/soc/codecs/wsa881x.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.21.0 Reported-by: kernel test robot Reported-by: kernel test robot diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c index db87e07b11c9..f7b6bbd62728 100644 --- a/sound/soc/codecs/wsa881x.c +++ b/sound/soc/codecs/wsa881x.c @@ -1105,6 +1105,11 @@ static int wsa881x_probe(struct sdw_slave *pdev, return PTR_ERR(wsa881x->sd_n); } + if (of_property_read_u32_array(dev->of_node, "qcom,port-mapping", + pdev->m_port_map, + WSA881X_MAX_SWR_PORTS)) + dev_info(dev, "Static Port mapping not specified\n"); + dev_set_drvdata(&pdev->dev, wsa881x); wsa881x->slave = pdev; wsa881x->dev = &pdev->dev;