From patchwork Fri Mar 12 11:39:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 398568 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1121149jai; Fri, 12 Mar 2021 03:40:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJzoEVcPNhVMHaPYDYWEulRFerdVhAtGYsodI9KPZy3xD2WdRJ35MfOPFMBIGomUrgNl1/rw X-Received: by 2002:a17:906:5453:: with SMTP id d19mr7906157ejp.150.1615549224362; Fri, 12 Mar 2021 03:40:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615549224; cv=none; d=google.com; s=arc-20160816; b=Wp+k9StsmGCL64EmvsN3IMxAMkWwR4V7Z1WoPovDcOOLv5IaAnHVeJ+hW1DqS1r5Yr 0VjGNKimJh4MbL7Rz+LmzdZJmSafR8qtDlnCDsPVhRh55xh1McJ4ERc4ce/SEnANjR35 lFgzDXoTpezE3Xp5y6456n4FY37OFZpgYMhAC1dhqU324NWkqIB3aMHALE/HBScHegNi lKdXB+g/txJ6/ixhccNWxcPn/KVHz42pP6OIGk0DEzFxn7LY1KLFBimDOvIjaeHVxp09 zocpL8Vq8qFDvhnxYFiPvmLodeH31mTCcuKCG/heSxfWiZ835J5BbxEAG28xpPmMwzgH bw0g== 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=mGFYaFoZGjo5NxDZ1LQpVesb6DQQaa5iPWIxyqLl8X8=; b=A0GHiO7O+W7lAP1WXCXHI0LI3ZT9byKzHTdDKmBgcJa7fGlu1uYv7kHv7BFVRJql/w /8m9fEZ9IVI/pz2XBkOE/rLpIlCURgzBSJpQFiHact4gbHAhDxVown3vPc6/W7A2kpwR 7EgG563fETYpB20b8TqHHzTKU8G9pmlYUU5rRn5l8wjy/e25+esSj7a55x55UwfsOOtl Jc6G8MRRcQER8JC+6lDv/VIxHXDNmbSwtogbWi3jlZUxXo7O44IhCx5hANvOdkgPAtbR ALnVXwZYta+nxXGIlXvBAUx97X5vmLOs7N3ryoAYSIMkKi8FLsRic0w2fjj/fMg4V0GO 8ZNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yYyuZSid; 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 b10si3831085edz.577.2021.03.12.03.40.24; Fri, 12 Mar 2021 03:40:24 -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=yYyuZSid; 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 S230508AbhCLLjw (ORCPT + 6 others); Fri, 12 Mar 2021 06:39:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229909AbhCLLjg (ORCPT ); Fri, 12 Mar 2021 06:39:36 -0500 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 490BFC061761 for ; Fri, 12 Mar 2021 03:39:36 -0800 (PST) Received: by mail-wm1-x333.google.com with SMTP id g8so3615692wmd.4 for ; Fri, 12 Mar 2021 03:39: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=mGFYaFoZGjo5NxDZ1LQpVesb6DQQaa5iPWIxyqLl8X8=; b=yYyuZSidKe3KaG+8fbP8QW5dSsKPv2q6xMm2NmDKR2Vc7bYpblOu6Don5G8cjIi/va sZ7ghr2Ej0Z8wnYfXl4ZRK4xO5My77x+hOTL4c2s7QY/dOpjnQ8k4vOUOFVbPkEeeW8Y xZz/YlZXiMRQ+Q2UGdo1HPWWqAG0rphv4XS2bt6Pr7VN8o6HXbBniS+/dI16KjNUPuWE 36TM6WnI3evkGuJOkTEilGYRz5DLg+fowkKRvxFAD0q/DEiM5dlz4QFVpn33FxApXZ2r xM5UdG0nZeFXZZV8JcjulbriafVa3ueh2d7OP42qgYNzrHtraqqSm1GnU4tOuwtV2p4j mZ0Q== 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=mGFYaFoZGjo5NxDZ1LQpVesb6DQQaa5iPWIxyqLl8X8=; b=CHOhnO+1qUerszQRpkdci3hAk9xnIQPq2FYVT3i4xvPzxsayMQpD9M8HEzISoVxMdi MjH1O3cYbuE13ZVmgGcjHyH9KszgcuVF3wrUAcYIIBESUYPc1490UC8IwQszihGbi3oK Ml5xK7GquLBSlq0sY8G03Q/d+TnytRrKteaGwMDfRgHbHovOt7DiTZH4HwUJRbD3PM55 fBHZsiCX+OWM49gXKEKhkPs591JlWrL+2ziKXIL7M822AOyYLPeDVLLXpYJdbsaPyWyk /t1ad2G8M3e1djc/6Niz0Fqc1etgoh6mexRHldpD706EpZp5I3Ya6iVF98SeaRvHnrDp eOhw== X-Gm-Message-State: AOAM533TvFxKi/S7a+dCKqcPzo8VlpaLJFuvFwZvOfv+4rlrPond+D6J DNyHNv93dUIF+yhyAHDDxl71pA== X-Received: by 2002:a1c:dd43:: with SMTP id u64mr12622483wmg.160.1615549174918; Fri, 12 Mar 2021 03:39: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 z1sm7412458wru.95.2021.03.12.03.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 03:39: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, Srinivas Kandagatla Subject: [PATCH v3 1/5] soundwire: add static port mapping support Date: Fri, 12 Mar 2021 11:39:25 +0000 Message-Id: <20210312113929.17512-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210312113929.17512-1-srinivas.kandagatla@linaro.org> References: <20210312113929.17512-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..b032d6ac0b39 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 port0 to port14 * @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 Fri Mar 12 11:39:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 398571 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1121188jai; Fri, 12 Mar 2021 03:40:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJzgmNJ16/8wDBWjUNjR8fUdAeBkjYXJvY9gRQChGAyZZT41msksb/kPvxLayqAXr3pHLfsf X-Received: by 2002:a05:6402:17af:: with SMTP id j15mr13644426edy.50.1615549226410; Fri, 12 Mar 2021 03:40:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615549226; cv=none; d=google.com; s=arc-20160816; b=xBHpKGhzF183YhczBUEVwnF4mSmN2cfsE9p8/3YoEPaA1x6gicVGhFhW9nVsQQmGbI mEsszgWNEn5o7SQ2Uc3opxKORIzc0/Ri1Q8JtVK6i7rRZNZs3FEOTtto6j0u/bZ149TM fsx5bZIdgd21imYmkh4MLptfUCgWGQLJmhA6dOlw7XF5c6sjQv1VXlCSMY/9c9lgDc1Y ntLLPgnsr+7XHqAAZvcZAPSkGiKuF8ZjIsudOUxkgrBA3r2FcHuVZepNcPDu2Lk69EtV ciphjgWwlqUMRkFz+cX4CRfjH3CAupkIoPQ9yLty56+Wv0wA02HnC6noiOIr8y3Oh6ik VnFw== 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=d07bFl9RGO2YIdQjYa8tlnI5xy9IwHNZh1RYhhRoByB3wUjk4S9ZskdlMf6zqeTGVh /8nQPP9ztvzx5b0nUe+VYYFnAai/QT4X32GqI+u45GAvoWJoTdkumhFXQgvXm5GTX7Se ErDV5qjVUUfG7QHElxA6I00b/H6HnjL/4ewJ2mw5On2wtI6C61ySEXJolPWz0f2qpq4j d4yYjbfiyTjgHWqe8nYa8bZpSjqdVkYB55RuH8PV1/1Rl3BESAW2c+poGHUCvGCsd0Uv V7+SZVdR/DZORCkt/lqDW5BcdrjPPC1DJUBOqsEdB9amc+NFF8kbFBWdAWgj5Y9Sv1Kl d1Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CaEpGLRO; 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 b10si3831085edz.577.2021.03.12.03.40.26; Fri, 12 Mar 2021 03:40:26 -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=CaEpGLRO; 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 S229900AbhCLLjx (ORCPT + 6 others); Fri, 12 Mar 2021 06:39:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230118AbhCLLjh (ORCPT ); Fri, 12 Mar 2021 06:39:37 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19212C061574 for ; Fri, 12 Mar 2021 03:39:37 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id k8so1592119wrc.3 for ; Fri, 12 Mar 2021 03:39: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=ZdZJGNP62lIlEnEmG/cCC95BLhByXorN62IvToLdpl4=; b=CaEpGLROapFSyEsbpQ8h7ChCWbrVvjZu89qEwLT1qmPRGh3aFAt30AWwNPA12bdEA9 3vmmAVbyF0ACcemSISR5fII2jLwnaYLUhLOhikeTRSQHuxTUV+zKCTRR5GvR6bMuLtqr mrS33KiXKmS0k873wvx1630n2bAyAIJwWnqhau07dPKibKzbPHU7yFGwcfGDzkrV/Vwb n7C+XxbkiYcMBg7KXoF0cNUPKMpS6VZPzx45z52B5AFKvDCyQwGWeBbJedxGlP9ED0U6 hOFIzWWXh5miOpQw4Y2yJ3ReMN6NRid5HsUi8L9YnrF6+SL/1HD7iseiyzAvlUOdQQIQ LN4Q== 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=bAuLWOBHmq0clbjX63JbYhjRn5DPFq4G5JBg0onKQlJ2e1T69uv6y7nMn7M7ijV2vh CRew3IsZVdIFnSAeac0+EC3iCWOLjVaurvf4xE4YpJjDSwQQenftSR9VGMVVOLC48yp3 shl+R4snYrxIDZJAPsHifKnUKodoTwsZxfvUPdq0L9cF8Gq2VCp4tyZgLJnAjz1ewLSP 0Q5yUdOg5j6UQg/w27/+WUIX1weKXf/pBd2Y3NkQX06lb+7FxbAGg65k0hwbXtuhVP8N GXavnPVzAzNrM56a+I7r9wok6zq/N2ZQwSL/m+39Ng2M3TywZFmIXxmlsuiltZ7HMMdg 1Tng== X-Gm-Message-State: AOAM533GVDIkYOekqiVJt3G+HPJqMxFY+P3omoTzibeJ9z+zdLBLMZz4 YDLZZpZPs2u2t2gvgm9F3Xrqaw== X-Received: by 2002:a5d:4c84:: with SMTP id z4mr13452958wrs.158.1615549175874; Fri, 12 Mar 2021 03:39: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 z1sm7412458wru.95.2021.03.12.03.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 03:39: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, Srinivas Kandagatla Subject: [PATCH v3 2/5] soundwire: qcom: update port map allocation bit mask Date: Fri, 12 Mar 2021 11:39:26 +0000 Message-Id: <20210312113929.17512-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210312113929.17512-1-srinivas.kandagatla@linaro.org> References: <20210312113929.17512-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 Fri Mar 12 11:39:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 398570 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1121162jai; Fri, 12 Mar 2021 03:40:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJwA4KZuEul+2aHiDPMOSTQMJ5vt6Dq1GtShG9T3HtTJ32bIAazcEAOzitgCEU/Lxzle7LD6 X-Received: by 2002:a17:907:3e9e:: with SMTP id hs30mr8221912ejc.66.1615549225129; Fri, 12 Mar 2021 03:40:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615549225; cv=none; d=google.com; s=arc-20160816; b=MZ0KRei8nl1Sc3XGAoRTXDdiIzlkftW/uWa9mGd10xg3syeTAnoYPBATF7eG/amaVP vbcLKICmKKn6fdBhUG0ZDWTxZAujAuyb9weHzst3yGuPlRsCqfJbK6UUNsa7EY/F7cVq sPDnmE4Xqsv/Iz5pF32n0scJF2w7Q7GBofS6If2REciPprbkxOAGSvUaCdPsFzxq3LWJ HjHPNQkt39Edx/40OvPzzmfWoJFFby2JKkyq+u0eve89ZAgY7pdf0ekwe/2YLvAcVez1 8ZxJBl3aaK3JB1NfmAyXoi88yugN2/vlnJcRw21d71+sBDgcknH4RFFb9Y3v62tfXaOf 3x1g== 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=FrXOLhaCU3RbWUyUErO95eO80i4+vK6YzLlpPu1h31ZWWhdXQCjujfhX3jbcjXi+ad 35VXYAMX5cnEYkfHY+Mgeh/n4slDxHMB8ZD2dauU4pK4jGde++lXVpWfWjb9NA8XMbjH ZkTrNzb9BR4JloKR+/HUfaKMMgWhDgP2jxrUjZx/VSxa0GwhrWDKoe+YlAiSt5rM1dD6 7HuiRxfKIfMzh6chnRHJ7qr3z4coSvNLlYRdSG8zjcsTnpAq8EADoVo6h/AUr8x3Ms5c M3pSixu8/LWwP88bunVEslYbphK5DHKxvafBB57lhXioYgvM2xkNUPnwqNqo8TAhkjQc 7FHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=un9b6szD; 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 b10si3831085edz.577.2021.03.12.03.40.24; Fri, 12 Mar 2021 03:40:25 -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=un9b6szD; 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 S230118AbhCLLjx (ORCPT + 6 others); Fri, 12 Mar 2021 06:39:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230302AbhCLLji (ORCPT ); Fri, 12 Mar 2021 06:39:38 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A559C061574 for ; Fri, 12 Mar 2021 03:39:38 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id d139-20020a1c1d910000b029010b895cb6f2so14987072wmd.5 for ; Fri, 12 Mar 2021 03:39: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=6S4oc3H/pGD3ohc32wC+7IuRuvb/2oR7Yf16M/iJXA4=; b=un9b6szDn8WtZw3vwLqnQuMB4nFKl5WiH8RPl6NXlTV5rMBuoEd+uvRZareK9f9nUl H1OM3HdQZwto8kDdYFqT5YZeEnsmQzK0QpJ5B3GEaB6kmmyw81iKMDL/AqITE6XOYdQT j8VgBR7YRBWOECbXyqvy5XkJVDEHM5vi7gwEoKeoy95gEU9AwVZSqV1IE1U2nq0L8yHT 24si0axqGkv6z1IAQzkRAg/eEE9tHI+IqAdSFMeUoIUIzboH1McQC4hLS2QKboD0rCii 8yda9dFBsW8hj4ED3PISLMUZJelAclSXRZN1ytTxQFTLrG7F9WmA1sgwa+1kkw4MSTIp 1kUQ== 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=eOhDLrqK6VPIf/LOzGZPifMeBdwCIsTUlMraGCOrJoNKAv0gHnZ/zfie63Wbv8PlCk Z2zwMFKxqcN4H3dhVgL69g5WCFounhGzqO7dwqrJS0yGgHMhxPESLonMJ4gSW9ePXC56 pDt4bW2KHa7vWXwqqzTXlKYHSAn6Wc37EtIrEBQgbirFyik2mnV3R746NTinhD3K2UcY +oHYKnAxxZnuAmKhD6vD61zQdNiDvDJYfpHaDHDDbINn2kZY+XqCdCI/1VSVBSBfXOK0 XEQEW5XhxTfFFaUoorTPVpB7Cao+YhF9DyJQMHWOnefVnBDk5wXHcUohXWkpZAIBGTK3 kutg== X-Gm-Message-State: AOAM532HV1vwpgyi2BNy1PJzVIcouUXA+qQi571AvniMhio/TvkR9+8Z Kx04TU9Xg7xdTexNc9X3gEepdw== X-Received: by 2002:a1c:2390:: with SMTP id j138mr12513940wmj.72.1615549176799; Fri, 12 Mar 2021 03:39: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 z1sm7412458wru.95.2021.03.12.03.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 03:39: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, Srinivas Kandagatla Subject: [PATCH v3 3/5] soundwire: qcom: add static port map support Date: Fri, 12 Mar 2021 11:39:27 +0000 Message-Id: <20210312113929.17512-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210312113929.17512-1-srinivas.kandagatla@linaro.org> References: <20210312113929.17512-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 Fri Mar 12 11:39:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 398569 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1121154jai; Fri, 12 Mar 2021 03:40:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUesw0v10R4rOVsW9YvbalGqF3fa4RjMPB4VqMCA6noNYcU6Y67L0/H7qFcfbDVTDE9bO/ X-Received: by 2002:a17:906:400b:: with SMTP id v11mr8022700ejj.194.1615549224756; Fri, 12 Mar 2021 03:40:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615549224; cv=none; d=google.com; s=arc-20160816; b=clkgcXg3sIt6/xvYwUxBUW+ZDYACEvO8tFd97XR3TkOicZsLp2WskT/aRGEFTy1aZr IH3YZkDI2PE0wboA0dqs+QvNfFLR+9sfj6lUPZbRB52nS0cnuwQAybkMlHJkqRCLHJwP tXr37vW0kUxnzQfcdKy6U6y1qW3ESdPayLJK+1k7BICwBc9cWU9CaspWjdnoX97s97HZ MqolvbQv/+5YVbAUkrMtvbJYhmJxBww8Hl6h0gbcWIEl86e5bfogaoqzMBvDTJdYkqZW FYXB6Y1zuwkxfPQgucQCg7CeoeiJ0KKods55SJb/PiWxCGDbPv0vielPEv+j+ObKvGC0 QWlg== 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=yyT5yudWNLjt38jSLaNQFxrsjM/rrXGHp1eCivRs/A+9wsiHJM+sxPoV4OJtVx3ihm 0k2AIwsz++HJ2IEs3PYlj73XM7Q35p+AyoXTsZn7MwxqE5tph1UGyFWIvX27rfl8KDYt 4s0gObHMb/qRzVi4kYP+tYuv5lfDAY3KKVaEJ9JYinSOG0yFZH23/SxSXtdoGitwnD5X wNRqqC+HxSoJL2BXXVPs1YSWEYt4MA/i2Fe9iKbpXWWJREZtunw1/KryJpF2FW31rHyr QHdBHcJLTpLL3/KXdOj1spdqWldt0tJ6CrEkbozhCB1No4+vFAVqdoe5Y8h6BoF+GXmc bHcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="JO/SQnNA"; 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 b10si3831085edz.577.2021.03.12.03.40.24; Fri, 12 Mar 2021 03:40:24 -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="JO/SQnNA"; 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 S230302AbhCLLjy (ORCPT + 6 others); Fri, 12 Mar 2021 06:39:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230388AbhCLLjj (ORCPT ); Fri, 12 Mar 2021 06:39:39 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06F8CC061574 for ; Fri, 12 Mar 2021 03:39:39 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id g25so3605681wmh.0 for ; Fri, 12 Mar 2021 03:39: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=Dw9cMYL3jtOlJaAZjl852OdyP+MrjSkhGMQF/GJ7398=; b=JO/SQnNAgL9e4Z+uuEOW9BgtfgUkesqGXsKQKZNiJhNp5d8P7mjIxUzYGSA0yGeLLT twuuywut+oNvZBEizrkkcNbeapEkpRs9C9W7naMzL0dQFHabuL3mKucVmVeWk1tYGHRl i6u6KjqFrER9VHlvx582HE5VLOeY2N5n0e7wdK+BOhecBIB+AgykWzUq9HiNMFkbhe4n EsDNe7tPZWCCkquzG/d0lapo2v1e5Dp2yQO5ZECx7He7u4GdWtKiTCEIZL0t3ewt4GFw ObvGJMp/Xuxy1aubyfcwM4obb1Y4LvCqdiq68AitA3oXULty0UXMy5+eys0qipqDfDLf 6dMA== 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=Daf3WLBcMH5uBUrLCnzvEZsiJNvemAOA76h7uc8aYMVsgKtFgDcpbb9/8CC41j4IQA 42cCpNvjkrC0hLrihtlCBB1gF+5zgofLU2mcSm0zSkIRWfUDAO4jKs4LPnUYZOwQ1mkX QkHFXvguKV6/DsY96e31m+RGhKip5oPF2NpFORXD6nqV3PNmM1vtqPYUGrzYUaFg8X2Q q1bCPeB2h8pQPSQfpi9EX/4Wf2Mr4n75pDbzIJO7H788tcBaHt6oL8GA43qLNt3kX/XP SLTRLYoz0/4bRkN8IcU8+kQPm7UoeWhp7UCXVB1F3rGtomfbvjZE4CNfiSMThtZZV2Ep Jf/Q== X-Gm-Message-State: AOAM5330qoGdV/49E/MsvZ6by7oPsPgVur92v0Cdx814ZgAZ+9TCxhvN kMfzgL+JT3PvQIzYuHhMRoRKXw== X-Received: by 2002:a1c:7714:: with SMTP id t20mr12411840wmi.107.1615549177792; Fri, 12 Mar 2021 03:39: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 z1sm7412458wru.95.2021.03.12.03.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 03:39: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, Srinivas Kandagatla Subject: [PATCH v3 4/5] ASoC: dt-bindings: wsa881x: add bindings for port mapping Date: Fri, 12 Mar 2021 11:39:28 +0000 Message-Id: <20210312113929.17512-5-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210312113929.17512-1-srinivas.kandagatla@linaro.org> References: <20210312113929.17512-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..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 Fri Mar 12 11:39:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 398572 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1121202jai; Fri, 12 Mar 2021 03:40:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwbt90tBnn2JDLgq4E3GMqYmIWkZxj7ELpQ3pbNX2ueUqtJNywN0FjbQbHy451aGDVF4KxG X-Received: by 2002:a17:907:162b:: with SMTP id hb43mr8271133ejc.41.1615549227564; Fri, 12 Mar 2021 03:40:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615549227; cv=none; d=google.com; s=arc-20160816; b=s+5DPPRaS20N3QrDqPliFelLrK8/6ZKn0be5CB/rzqQFL4KmVGDD6e6TPNtVVubV74 xKyWpwZEXUJYF3HK2ML8sn2BBjO9WcYb5od+jZwKlYyP+MeO0zhYUsukBsXGPqnQqSyR N/vODhCNGRlHR0d6PboZTvDWXE0ES2WbsG5bwSFoUA3JVJhEtYkCkXIW5FtfWjR4kgD4 NImD3zXSTP34RvzvKXQvvoKslrWeffueddypP1QIOr1gnEJxufN+/th5gFMbUPXNW6ZX 6JT04lhAt8lO5yIMrjjcIq5R17pVoXESbexUxxTi70562wm4ylNHLPhwyEmZkmDRhgGL kOAQ== 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=b8IqBVQY+ayId8teZtGuUYHyhZEDP6eQMmzDmENV2Wd9Y2uBt3Wm9pj6tF8hBV1BGn 75KLrzFotI/5Jprs3nPsZU6FGlCkR70gmkpqJO6dzrbzrESsLoSMX4Jd+jnHvaqz/08g 5L3Zz2hjP4psTasLEaonGzQ2cBssPVzHGX9tFQqj7MgxtAcxcJa1fN6cRlSv43W50IVV CGLrB5bRPiV0t+B5i73nxLMf3Z1s20yNfLoO4SCXZ+IOahB//pm1Nz+f8+MpGisz4XxL grFyX8DtQtcWhCwgYeCU0rl92jw9w+AMTCLaeocxgPV+dXw1kqxh6kT+7mAgR084QIjJ 60lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F79ymKCm; 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 b10si3831085edz.577.2021.03.12.03.40.27; Fri, 12 Mar 2021 03:40:27 -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=F79ymKCm; 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 S230388AbhCLLjy (ORCPT + 6 others); Fri, 12 Mar 2021 06:39:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230428AbhCLLjk (ORCPT ); Fri, 12 Mar 2021 06:39:40 -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 085BCC061761 for ; Fri, 12 Mar 2021 03:39:40 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id d15so4623327wrv.5 for ; Fri, 12 Mar 2021 03:39:39 -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=gA35ua4Yb5kX/gYxKzQIpMpiocNgTXC/pKSapK7rZJo=; b=F79ymKCmc4cJYBdR3Ukg8NzVcPFXFDRgFsQBhgRAYZUeF3FvVHR6qFVZKQW2xuEXcT VLVmQImorUxowGUytzLRsxgfpsy5iHzqnVZY7NrrGcxAA2dD4hZn02GK2q+/kiVZZrHV G/lEZo6M/qr8nHRKomRlT9eBDVpooW5Jc4xBd5pumfLGm2IsDLQLmyz8DbX34GA7AJa0 wOfuSnEVam8TM2suOCUiVI61yea1EP88HaFYUoFPSSWuIJ02feqQie8qV9gTo+BOPA+2 kZDUb6Hqs+QICX6kLFq+1UqkUwCoPc+ZGSjWHcoIyjB30+b2ZuBykL0IdwGjrgY2d3DM 5R0w== 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=CXDy03UFsoLaeuxmNOe0uwXU8lh5C31xB/U0j4JNlE0O1njaAMvoTMDsBGSjcLc3/G rbdBIda1E1AD/GmzueSxDJZDx9Nqo86GXxvXIJlxDJx+MjeUYp7v9o2f4Vad5cjQMhXy 2XfFKjR1GkI0uUDPYmpTTFxHRlQyNgnFsA0Ul8eq8QyzA0rG3dThhXqVJaM9yqy1hlNz X/zzr7fd79fLNOZ5BcMGs8wZokAOVp+6sRcLO4d9fUebvga5AuibXx6G9LSE3opNZIBl xsfpTWLtmqiWqlqIemO8xTnkusy/tS+/HoxCLeqYSiqxkczGTqFpzV/LZlIHiWKDzyrx iS6g== X-Gm-Message-State: AOAM5314nHt6uS5Ob7Mug0CqDtIX4CVJBFdUd2nreybO6lF8WJ2DlkkI 7iuxIMxcF7Lm99x2RkcB8oIzW9CIGXZKOg== X-Received: by 2002:a05:6000:1210:: with SMTP id e16mr13700270wrx.19.1615549178812; Fri, 12 Mar 2021 03:39:38 -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 z1sm7412458wru.95.2021.03.12.03.39.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 03:39:38 -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, Srinivas Kandagatla Subject: [PATCH v3 5/5] ASoC: codecs: wsa881x: add static port map support Date: Fri, 12 Mar 2021 11:39:29 +0000 Message-Id: <20210312113929.17512-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210312113929.17512-1-srinivas.kandagatla@linaro.org> References: <20210312113929.17512-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;