From patchwork Mon Mar 15 16:56:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 400518 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3591540jai; Mon, 15 Mar 2021 09:57:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzE2aSQt/E2/H3GnfJ4VssNanWPASpNDF70IZfLX1Ek8QVvhF9LXZE7o35M7lez2K2xMHam X-Received: by 2002:a17:906:6044:: with SMTP id p4mr25000529ejj.82.1615827460409; Mon, 15 Mar 2021 09:57:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615827460; cv=none; d=google.com; s=arc-20160816; b=gh5/6INTgtElVSp8oRL6i4sufrOmCrctwEdC3XXCEdloWcJP5AR1tQ4LwaYbMne7MJ 37zfWpl9ounpgRmFrFs1znbtiFLqS3WrW1a7XBx/DROZBF+TdCKfpP4tlf4iMAOJYDYM +C/YPhTXF8jtj4xIDlbUiVT1AskEV9tPdujuFhuJDU1QeDavvedCTctG0pM9Be8L92CX tCTSlaeZn2c7Rq2calJXatVEWQVUvTu8ADNl96eSOvmXE7SBRfOKUp4p/B/ctL3yjCq+ ipjSsVNiyDfoyqjGykgk6cY4F2RIHdKjYRxFv2lsgGiWJ4+De2vnQFDJcdLeO5FN6Ch5 ZAaA== 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=qgWiq0fpW1Ao1ReNyBWnVsZYnSiuoBY4LWY+fyyXN+8=; b=X7Up7DYXFZt1A0cZl6lRjRdigFDnpBDcFvEH6tWZLwj7UGzbcgLnUs9eTXeyG3UQsK MAFl1679lGDOwGq5zdqHR5md6Ar3r081kp3jH3yZTu3NXXL4koXVrM9AwlBmO2mxg6ny oe0oulfupUccroX0TcnyRKZqatScdxOKb+7Lt51+C0sLiTxbzLHHoKF1MIGkyJk2u8jh SzrmUoKvhA1nWoWTOcjUNcOCnX3s5OierxZHbE4F1MHXWYYyVYWMvbpCCcXORXNMab1t YkwCJKvWTKtNa9LDUJk3WdhJuYYdHFiLuHQF9M1lpp14xyh1b+T7l80HTti5tpJRPbn1 G0DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DvVmN0K4; 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 p8si11752848edm.44.2021.03.15.09.57.40; Mon, 15 Mar 2021 09:57:40 -0700 (PDT) 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=DvVmN0K4; 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 S234254AbhCOQ5J (ORCPT + 6 others); Mon, 15 Mar 2021 12:57:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234286AbhCOQ45 (ORCPT ); Mon, 15 Mar 2021 12:56:57 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35BD9C061763 for ; Mon, 15 Mar 2021 09:56:56 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id y16so9073262wrw.3 for ; Mon, 15 Mar 2021 09:56:56 -0700 (PDT) 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=qgWiq0fpW1Ao1ReNyBWnVsZYnSiuoBY4LWY+fyyXN+8=; b=DvVmN0K4XDY3htV9Bkl3qmU9Rm69lhS1NtKvpdnnh6nJxKA4m/q3cf6WHrrgbG8+x2 tvjlkie8aIW7mZYYfH1DT+pxwJJ+HJ6vJ6sw9f8sa68G4g9llVGHL30HcJVjXC7g0b+0 7IqazsE1TMdnG5L/+7588THq+lREaDEVTtmWx59liQ+GCmAbsoocdQX9OiEUe9wGs4MS CO1mdTpBWjLLIYn8wSLJhXyoJVVkeje156i+q7ZMvxQkdFzTp5N/gEQwEVSxxoBCExEu uNJ30LA/1ltGByLOid8utVjMo52TEeoEGH2R1PhTV6UubBuUkySQMlXbPEYn2qElVpni UqgA== 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=qgWiq0fpW1Ao1ReNyBWnVsZYnSiuoBY4LWY+fyyXN+8=; b=lQZq6iqs3Oj1zL49z1XNm7LTVc9Ffq/GgZc18f/hM+4oAR6taWMAW80MBS/CTjH1KT zm1xpQVSYgPsQDptG1xmh5cKgZ209GFQNbZ5i4izMzwUOKJvDXcEnBfCUsKV6GKRNbUd a678I0lI4TPdJ7M5tWUfGt1+6//pWXvxIFqAPRr1sIiZ6TPweZOG+cVnSDRwRAVhWEJ9 cCg1znNK8CVeP/bqeyfWbm6iuFSYyq4c7m1+SYH4pwf/C6ZkyyLYreJdGQXMrxMtDyri jLn5YrxmWz6uQ4PGPMhVMRQqZd3IC2qgwfb9Hm9gcle59y32tEwgcgGHreWtl/nnVweY slfQ== X-Gm-Message-State: AOAM5336gyHAS/sFxEmYXHzZXBco+Gcj2HY8QkL7miS3ijNrXnSG/WXQ EB3Gy79AALCN9wapriuGuq/PIQ== X-Received: by 2002:a5d:42cb:: with SMTP id t11mr595569wrr.280.1615827414967; Mon, 15 Mar 2021 09:56:54 -0700 (PDT) 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 o2sm227656wmc.23.2021.03.15.09.56.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 09:56:54 -0700 (PDT) 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 v4 1/5] soundwire: add static port mapping support Date: Mon, 15 Mar 2021 16:56:46 +0000 Message-Id: <20210315165650.13392-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210315165650.13392-1-srinivas.kandagatla@linaro.org> References: <20210315165650.13392-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 bandwidth 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 Mon Mar 15 16:56:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 400519 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3591546jai; Mon, 15 Mar 2021 09:57:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJT4TvTdztLCG7D2WfBanaoIcC/InUFqzr+z/vm0p6uBm8DxYuXZ7W/HWgRzUojx39jOlU X-Received: by 2002:a05:6402:34d5:: with SMTP id w21mr10149532edc.14.1615827460744; Mon, 15 Mar 2021 09:57:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615827460; cv=none; d=google.com; s=arc-20160816; b=JTansaHmspdtCmziTOZ8Hy81ZBUQWxOsmUsLVKj0ZkFQNT2YZf3xCvA2FepedTUaBX 3mb4n37n3vfG4xfqJKTUxR9boVJUBcGUI95EbUGacOA01C5t3//oiLUnjYSUWAd2umo7 vwFswsf97PX4ljsVZWI9CRYYndGhsOQ9Ayfonw5l/ASXwo0jTVGja43zsis6y0NugD9W j7s+vYvklei+n1EFQuZInaB6IiUfMakdCAOi7RJhlhK/vu63S3/Los9O2CP9UiLUNgh0 IBowzU1gF/ZX3Px1kQDToe9pclowYe51hNb61Mp8S+XBjRRVN+sQnboitqN97XXlb21D Id8g== 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=ZdZJGNP62lIlEnEmG/cCC95BLhByXorN62IvToLdpl4=; b=G74F978Z6sV6c22u3xXK0OthiMLc+uJOblLF0lyhUj2UhxZlHqnKus0GoogHoQA/30 paJBuQhoUYAg7WjN64FhqDVludYzo5rtiihYKWOVOVB0fffpx8y237MUAlMfEpDQqT0R VOf8t/haLnJlQtrJLvWeC9TTKg0znsAvoecHJ/fxXRRj+B6dtON2qMy3GarjvcoHj+fu UwAkY408JgtHflpo1Tld7dU84oVfO3nFFLbmtWNWCNz4w6wGPgLGN/ARc7f8fPLFMDHI LPKUE+8GcVAzx5CISPwOseLHv0PmzmwmTEaxR5kDXTWneeSOznzA8Q4Z5m7L3Fvy4/TE rd7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WAQzO0mH; 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 p8si11752848edm.44.2021.03.15.09.57.40; Mon, 15 Mar 2021 09:57:40 -0700 (PDT) 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=WAQzO0mH; 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 S234279AbhCOQ5K (ORCPT + 6 others); Mon, 15 Mar 2021 12:57:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234338AbhCOQ45 (ORCPT ); Mon, 15 Mar 2021 12:56:57 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F238C061764 for ; Mon, 15 Mar 2021 09:56:57 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id j4-20020a05600c4104b029010c62bc1e20so19887427wmi.3 for ; Mon, 15 Mar 2021 09:56:57 -0700 (PDT) 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=ZdZJGNP62lIlEnEmG/cCC95BLhByXorN62IvToLdpl4=; b=WAQzO0mHPFAvj8xI6C+JLfJgBcnurW3P3e7LtcjfLvIf+WQJ9obNauAt0jq26jtK76 OyiyoEK6/MtbMXRt7XjRdOfJdHcAeqCq6igi58b20Juqge1uldi96B7qgd+Q+qFAzpDp cv5NKQbh9xv73qG55vroWhwyxUzHUj+xzuSXUNcJDqHlssvr60Je4bnPaVeRebskFXGT tU+CQee1BdIR8CdSHwrSxbFv98zZDq0mUWHSwA0QMsp5HXjxlzXpdqOIQ1q514Ee9jAq 2vbwOuX3taRNxDjolBiT71am2IVNcwP3DfTisGlPnMKTIoUrIk/KcyVIS2loXhcjnM2b Qb6Q== 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=ZdZJGNP62lIlEnEmG/cCC95BLhByXorN62IvToLdpl4=; b=U2Hbf37Il8Pgia9HsY+WyhU9G+F82LhtFEw3JNGPuD6hNkyL9Kzsts1OTCebYUtY4i qDUApq9kGLlBdb1q1BbSURtdXCO29lJoBpqv7m5IHbc8WsWCYUDLnHdjGuq+ajOKlmJv /P6zR2H+sk+ExgczxQ4mmS2sExYTR9AESeJBAu3XGNDGb+iHi6m4eAbBacmDN8GZ5jtb mRb9J6ChSNiRkhLbCWR9nfJO1dhcYWKdVS/zWy0nnx+uX/XyBKrh+AS/IzdRJLp5RFk8 vtF6Q5kEmgsJozkH6cEFzNBtw23ehTxVuHFY+BvjongYwP8gIWyG2QXPTwxyBYk1B7Ua OtUQ== X-Gm-Message-State: AOAM531VhOiqqNHI/TiN/f+vkHndjVDc37Mp4QzemxV+EcMzSjRv2LZu 9yCEzIe798llcnkjgWTCeAp/YYl8kasE8g== X-Received: by 2002:a7b:c195:: with SMTP id y21mr601189wmi.178.1615827415959; Mon, 15 Mar 2021 09:56:55 -0700 (PDT) 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 o2sm227656wmc.23.2021.03.15.09.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 09:56:55 -0700 (PDT) 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 v4 2/5] soundwire: qcom: update port map allocation bit mask Date: Mon, 15 Mar 2021 16:56:47 +0000 Message-Id: <20210315165650.13392-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210315165650.13392-1-srinivas.kandagatla@linaro.org> References: <20210315165650.13392-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..9e70c53e2c7b 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; + /* Valid port numbers are from 1-14, so mask out port 0 explicitly */ + 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 Mon Mar 15 16:56:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 400522 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3591574jai; Mon, 15 Mar 2021 09:57:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQ5Vzus/PvF39hwoqCAYlwDDrG5kADHntCuYl5zdSJQGc8qOoOkhSFHyL+mJ7qGtck+fXa X-Received: by 2002:a50:9ea7:: with SMTP id a36mr31459480edf.174.1615827462558; Mon, 15 Mar 2021 09:57:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615827462; cv=none; d=google.com; s=arc-20160816; b=oYrHrzuzoOEyJ9Pv+SmI2AkY/aXQR+vQddjTokuTgVO5LKg+wQj1TncZ0o2T2slKID ZYeJ1Xc/7N7YnxfosHY6g2Gji+urSpHPcVa4GI6DcX1hjOs4WFCjW1iPpNGVsYFLDJpF ljOm2nWm0svnca0+1esLOCJf91qCDrnu+5pFCaqon3HTGbySvZ+jdObIpuMhRnoON7wi CayvDlPis10cfA2HXlXIzQpRA3/35WGnvFXwcd8XACNDv3KF2KDlozxsW1XcrkWEVg30 PGZlztlXvA2iS+qnzXyf0TnmpctBV6muM52szW0gdlfGRIkKOyI0FscuLUbK4n5Qn3a2 YevA== 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=6S4oc3H/pGD3ohc32wC+7IuRuvb/2oR7Yf16M/iJXA4=; b=GIqiwUPBcd9f18Fqwtjxhm8RjNwVgbTOr/DnFKSeNOatQmF/M/dbNHJQWxfW2JzCRf Rw5JA/YoZyncU4SEF/JBrhc+0hMZhtqAaqiqsULEgsBnxzryojG6dgUaHu7SPAwmlMIV ZP9f4GTrDv+bduaJ4Js4QXypZ7giuzN9tJRxdmC1S0pIVUFrCOkSMf9SJOTdA/oBqdz8 bui5uNfAWIwrFocp9py//fonuk7aC2g/mvQyZt82xJnrN3iE+pet7mfBNMI/Uu2BRqUj z0Al5z9pZUf19qUppgvprRLNZkmFDCPk8LEUdltJ7AAz2p8j3ksk41O1wzgtKluhYVli +KiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KRguXn6v; 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 p8si11752848edm.44.2021.03.15.09.57.42; Mon, 15 Mar 2021 09:57:42 -0700 (PDT) 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=KRguXn6v; 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 S234285AbhCOQ5K (ORCPT + 6 others); Mon, 15 Mar 2021 12:57:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234348AbhCOQ46 (ORCPT ); Mon, 15 Mar 2021 12:56:58 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CFC0C06174A for ; Mon, 15 Mar 2021 09:56:58 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id r10-20020a05600c35cab029010c946c95easo19868752wmq.4 for ; Mon, 15 Mar 2021 09:56:58 -0700 (PDT) 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=6S4oc3H/pGD3ohc32wC+7IuRuvb/2oR7Yf16M/iJXA4=; b=KRguXn6v6qWoSKXlekTUoqzfznIkwnBZk388f10HNP0qDrHICvrjYs9zpA07T0bvJ6 89p0lDFhapxhLq1535ZPsd2sRtkAxs27G7nMs/FG6YuNWkgR0+VqnhrfySnK9UgW10RV fzA+ELnQbNMT7oRP2BAxF28RzZvEW9GiV/zfv/HknWeAZIVLX+tFy9nDrtWp+P/xcZ74 ITZhRtK78sLj79myS0GaSIuMBHRpkGNs8c+986iaYdGRrrbx47xaW9AmypyaZj2E5yQH nsXob37tOIjHrOj4r9z4JUg9BuI+1+WG9YAQcehdTgao+qff7BeQ2C1GjGUel2pbzgNb o9vQ== 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=6S4oc3H/pGD3ohc32wC+7IuRuvb/2oR7Yf16M/iJXA4=; b=EBK5NzWfZl9XMFebnkj7LgNo48fjyokeJYXGtwaSSrbpr0qWPvWFO5K7bC0CjXie9A jLtxjm6deprk0NcA82eJ1OE7KKbE7v7ClOX+dwRXXnVQJonlfsEQHeO9AHiP+hNQ2C1V +z3Yekz66RWeWoGERzq9/nH8iDBwS0O2yA5zcFCVH+VSO9y8fJme2Tt9PnyUFBQcRCtG uA6FC611leudGQz8GslLFzEidGieqV2GbXU2iOF6Se1qX6sh33huaKAjZwDCBYWCCVz7 TTQO4Ty2ug4daPywMLPXAMpVhFqP1VMqXB+0Ot8WhEBjZ3QkTksI3dBiGtR5GnAMzNO8 Ld0g== X-Gm-Message-State: AOAM532/qE5tXRUhTwOqaAWrWzPHA9mS03ZreRJLA1tb3Zn8CLqntOmv UmxF1arNuvARh5AS0Toj2Mgrn3/mfpfCYw== X-Received: by 2002:a1c:c904:: with SMTP id f4mr647858wmb.14.1615827417008; Mon, 15 Mar 2021 09:56:57 -0700 (PDT) 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 o2sm227656wmc.23.2021.03.15.09.56.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 09:56:56 -0700 (PDT) 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 v4 3/5] soundwire: qcom: add static port map support Date: Mon, 15 Mar 2021 16:56:48 +0000 Message-Id: <20210315165650.13392-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210315165650.13392-1-srinivas.kandagatla@linaro.org> References: <20210315165650.13392-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 | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) -- 2.21.0 diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index 9e70c53e2c7b..39222b04a2e0 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,14 @@ 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]; + /* port config starts at offset 0 so -1 from actual port number */ + 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 +543,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 +559,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]; /* 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 Mon Mar 15 16:56:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 400521 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3591560jai; Mon, 15 Mar 2021 09:57:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPRwTZ609vCBNpWBKitNcMLe0sZuExShJ6cvRf4ahrXjmFPpThCgaZ3p0bpAFhK7eKx5DE X-Received: by 2002:a05:6402:1754:: with SMTP id v20mr30738985edx.191.1615827461764; Mon, 15 Mar 2021 09:57:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615827461; cv=none; d=google.com; s=arc-20160816; b=jctkXePc08fJ5GeBBl6CaqWh9GlH5IiuKd66XsmnZI9HHwhfxgMgsFiekf7QjB/45X +DjQJPTtTO7+JEEj4l05Ye2i5YTFh89GkI0rxV4Z9FkYZpxQ3NAQaM6d2o0sOVIURbJK oYYDTJ8QHyi/1s3xlQso3BUn4AvRiLbtr1S20XdacL88oFDUGexkwcAA78Kp+SSZub6f OSCvWJdiYb6A2czOGaJhXcsr78TqN2rtczDZdL6NQPlGrrULrO836E87Ve+yIOvA+BtP pc3LLum3O86amyeIC59Aou0ApfX7Jj10+wY/LIJCteWiSdjKpPENCIT2HpQYTgZPUAgr VR0A== 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=Dw9cMYL3jtOlJaAZjl852OdyP+MrjSkhGMQF/GJ7398=; b=UuYqNOv0FZJRc6hCfVkjpQ/TN8cm36Q8Ij6B/DCyRZZbGumfUJU7mdPeP7pgN/gteY m5bMbmZmjWnTvROII9wVrUHNUJCR5sM1Q75pw+M9DqSkvMdDij0W7bnPGw23OHsVdg6w YVNbv80PXuMgt1VZaAjg2zGs1p5Wt8kjJw2JgCuU/sX2QqMPHjx5pZxPsfpcEDNNv1q6 l4qO1bgyrBNcqV/lw8R/7FeMj+eTFYOHdAKuLdDO6SsmM0PgXI5ksCnbUuiP+E5Ptapz 1eunN+WDVP72k7S2GFKhLrJGCpKPwbleYkqmw1uDiY7WDULvfv5Mm7olFE9PQrrl70YS 0n3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hgOmJNEg; 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 p8si11752848edm.44.2021.03.15.09.57.41; Mon, 15 Mar 2021 09:57:41 -0700 (PDT) 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=hgOmJNEg; 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 S234338AbhCOQ5L (ORCPT + 6 others); Mon, 15 Mar 2021 12:57:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234356AbhCOQ47 (ORCPT ); Mon, 15 Mar 2021 12:56:59 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37B3FC06175F for ; Mon, 15 Mar 2021 09:56:59 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id t5-20020a1c77050000b029010e62cea9deso19864515wmi.0 for ; Mon, 15 Mar 2021 09:56:59 -0700 (PDT) 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=Dw9cMYL3jtOlJaAZjl852OdyP+MrjSkhGMQF/GJ7398=; b=hgOmJNEgjoKRZJFLsQvmXzKGK0x6KpA7ts+E75YZSi7QZn+qZOS507y4wZdiB+K3yg qFF1KpqSP0gXwhKwQN8Bcd/gkNIkpaaRM92zi50lqMRsFVUxQTA0BgSZOapRo76i7GOe vlF9+LLtakDwOMZdFtlrxrdwoBnGLV3zdCF6TTyth2SEfCJZa6/JpAnHBR0n02NhLbdd MIBEXh5gV/lIxkZOdATeu8l2jsaZ0kTAFDaQyZCAF5LHrdvFkHMFo4DcsCNyCc0Dp5n7 kxlaFq9kX3YOzm2tjYEwdDfzPNKIs/8fYgLJRwUwXM9gyflouEMti7ucdkQrRVRKO1DO NTNg== 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=Dw9cMYL3jtOlJaAZjl852OdyP+MrjSkhGMQF/GJ7398=; b=Kdn6gFvJHJlTps7GaUUsY0JHZN7hBw67H4l+lrIOHP2c68DVa0y0uL+snU+HX7DioY WanjSkgHojZqsuQGj889uD+bfL4xXo1E2TNTnLVZvyzDcw5O4s1dv+Fkl/uoIaQiRalx w/r1XNcyWR1GSc7xyzPl30nwvwA6RC5cKles+FLW6qKNv4wS8l7h0RRIKrafxJORskHA Vg/Vj01wuJDtIzTYkr5f+/9LU0m66As7mw4/xcDmairGFHrge7EXx/eSDsroxTSUUqKb vGao9UZ30CLeYcaelu/550iGG6saF4A1plleHaQKfbSH3Y+Ja3ICTwCMgD9fwubicr2Z PTQQ== X-Gm-Message-State: AOAM530kOEq8KHUlN3mU1jkjxtqTkmAHgHRcu7yTCuLUhEvF219+a2A4 fx2hUPEBYyP+ywSF0vwDo7wFNg== X-Received: by 2002:a1c:e389:: with SMTP id a131mr630946wmh.78.1615827417971; Mon, 15 Mar 2021 09:56:57 -0700 (PDT) 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 o2sm227656wmc.23.2021.03.15.09.56.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 09:56:57 -0700 (PDT) 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 v4 4/5] ASoC: dt-bindings: wsa881x: add bindings for port mapping Date: Mon, 15 Mar 2021 16:56:49 +0000 Message-Id: <20210315165650.13392-5-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210315165650.13392-1-srinivas.kandagatla@linaro.org> References: <20210315165650.13392-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 Reviewed-by: Rob Herring diff --git a/Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml b/Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml index ea44d03e58ca..491ce1270cb5 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 Mon Mar 15 16:56:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 400520 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3591553jai; Mon, 15 Mar 2021 09:57:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJSKn9M7yymzMJ9AAnNfarnr7wN19fGltzeq+QuhaCQ1V+xn+uZZ5iszBMm6aF9PIbE9Fj X-Received: by 2002:a05:6402:168c:: with SMTP id a12mr31503977edv.344.1615827461127; Mon, 15 Mar 2021 09:57:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615827461; cv=none; d=google.com; s=arc-20160816; b=d+9xGlWlBtyfuJP95z9hRQlae+RZvhpOEI65VwooEs+h/hc3Bmb/tTCRWsuqMGF7bk T84XPq195SLDDmQswmshdTPPtgaiuqUdQUyVyrFQMx/HzSoh8+zjKtf3/uQ38c0+ZQ2F 8HfxyjScJcLfxPj2naIs7YNi0rIoeys/x0DzJzcfb/9lGeQG0E/SZUCEPN7OPUbIAQxk jGvWxbjS6LhpU91EJJuuEd/yx1da481mh2f1+v1CuUQXrZM1aFcLT+aYVlBclj57zmh6 RKNP6fKD2Q09r6eAxh6Yb+GpMr61e+um4QDCMtu5Z/VlM8Y0cPJtr66f7PXkgF4WtSLE 6eUQ== 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=gA35ua4Yb5kX/gYxKzQIpMpiocNgTXC/pKSapK7rZJo=; b=j5BEA/xHHNwyj8ROx5GgrG+f/iOqmyOiTuNz25Hh/ME5K/RrdNC6awo1G7hwN0VKyj Qihy3JL1KFGfVkMs53tfKVRofrTD/4r+NXL9WqezzpnJmbIO+mLyfoug5h4iKYTcLaCk lwbmL6GOafqXjflxdP/6HC4wYi8EVdkTMa1Ye5gnY5L8QNvSlB8+4YVEXE+MfEtraLmf gM9H7e+AWLIODYoUSW/qD1OJUXJEcSX5u0xW/JfyaE2bLS8rK/ZwKqDSkcdRroQQi0UT TJWN3SLeFfOEb34NGDuIdAsqcPF4ymFJzRGqs1s13PfzWDx8I3j3ISBcWyVmTBqQ9tcW R2rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D+RkpBUZ; 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 p8si11752848edm.44.2021.03.15.09.57.40; Mon, 15 Mar 2021 09:57:41 -0700 (PDT) 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=D+RkpBUZ; 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 S234348AbhCOQ5M (ORCPT + 6 others); Mon, 15 Mar 2021 12:57:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234361AbhCOQ5A (ORCPT ); Mon, 15 Mar 2021 12:57:00 -0400 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 24BF0C06174A for ; Mon, 15 Mar 2021 09:57:00 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id v15so9066804wrx.4 for ; Mon, 15 Mar 2021 09:57:00 -0700 (PDT) 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=gA35ua4Yb5kX/gYxKzQIpMpiocNgTXC/pKSapK7rZJo=; b=D+RkpBUZvmx2ksCWz/nuPCkQks6oZo5RNsym556b8uzRQERFm2Km0gQB96/n5mO/nL XvAih+bknAm8O2nbaQvc8g5BYvk+hE2TDeKhlhf9rZH3n77WHWFzF4mUBttPZu34s2aK tdmjEVI13eH4SWbH4rtQy2IWpZ0XuumM5VH5tBpylqgtMS9iCl4F5b4C9Va0taLfDLVa YcmGNnOHLJS6kr2YGxgHQlMtUFfH6pZ61nXmZWzlmaZuu2TGex0eEd1q9m/Rh1/Iy4Yl SsFURVQHig3gX4JF/WhaSrIcxU3V6gkN8qc54qCtUVomZd29YKHv2+ytE9onqvjT35hr nCJQ== 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=gA35ua4Yb5kX/gYxKzQIpMpiocNgTXC/pKSapK7rZJo=; b=g9ORSOVhRkGjSabI44BXiOUxc/sDHf4M9erWmIGpUASzNaSXPRJXxuCXJSaqytTE2i DpdS4Cwp+r6SOiQSS4V5ErstUetz6O0Vii/Tfqhh3V9o9nP0/ODLsJiLEQLkkpa9OkK2 +2dpbeB3X+KSt757xlY4uQmnC7ipZRoRmZiBQG9XFn8T81H7nRLQFYqJ8CwLLK2FFchm I/wwwYoh5bX1OLN9DC+fWeVbXYTslr17Dzk33NZhEORfyvxa4lZMXeMncNc8Hcz7ZPXg qdS7AyZu0JSzrYvJpqBXCK6hvr+GiGd9KU9yO7RAzOfW3zoJn148dbDEDZGekv27KYfI Q75g== X-Gm-Message-State: AOAM531me4AFaXx9zVr/E8kqFddyunykYHVh2/0gcNF8A8RzCYPXk/vI W6umrzrcL6AEOJ3xdxM0XYnn6w== X-Received: by 2002:a05:6000:114e:: with SMTP id d14mr611460wrx.236.1615827418929; Mon, 15 Mar 2021 09:56:58 -0700 (PDT) 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 o2sm227656wmc.23.2021.03.15.09.56.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 09:56:58 -0700 (PDT) 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 v4 5/5] ASoC: codecs: wsa881x: add static port map support Date: Mon, 15 Mar 2021 16:56:50 +0000 Message-Id: <20210315165650.13392-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210315165650.13392-1-srinivas.kandagatla@linaro.org> References: <20210315165650.13392-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 | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.21.0 diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c index db87e07b11c9..b3568aec0cd0 100644 --- a/sound/soc/codecs/wsa881x.c +++ b/sound/soc/codecs/wsa881x.c @@ -1093,6 +1093,7 @@ static int wsa881x_probe(struct sdw_slave *pdev, const struct sdw_device_id *id) { struct wsa881x_priv *wsa881x; + struct device *dev = &pdev->dev; wsa881x = devm_kzalloc(&pdev->dev, sizeof(*wsa881x), GFP_KERNEL); if (!wsa881x) @@ -1105,6 +1106,12 @@ static int wsa881x_probe(struct sdw_slave *pdev, return PTR_ERR(wsa881x->sd_n); } + /* valid port numbers on this codec starts from 1, so skip 0th index */ + if (of_property_read_u32_array(dev->of_node, "qcom,port-mapping", + &pdev->m_port_map[1], + 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;