From patchwork Fri Mar 12 12:22:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 398605 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1149348jai; Fri, 12 Mar 2021 04:24:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwx3TL/xGC+NDacJ9wGxgkO6GEpu4eKIIlA6zxgpsqTYnllidfaEiPMDj+1owKhuWgK8ycl X-Received: by 2002:a17:906:58c9:: with SMTP id e9mr7958181ejs.26.1615551842740; Fri, 12 Mar 2021 04:24:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615551842; cv=none; d=google.com; s=arc-20160816; b=q+oDlOH8nlzXe2MAPJPNnTCJEZKcGE1NcCvPLKKOqX5cViUKEHAPUPc4k98lunEkir gAYC49gSzOJCqjFsEf+oHBsvXJnTqkHX/rsFqYn0VdB9yYg8tCXjUlIOpBDgSUxHYg8w Uhl0RF4GWL7bj+tjVnzNW/KbnbKUs1x2d+tRKH9qFEorAMapQ1inPNFH8abkch3V5vJn VOn5hO1yczzcKXoAvUqGG2EGNZFChIq2yBZPcfw8iMWMlX/aoijvk4/PGIifISMwJDsw MpnZV2AOMBFXmdYGJlorOxjiiQ9veZunuruPVySTaDJRdUZiVO3IRE4NN/zFd2+YgCLq ymyQ== 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=5ru3G/xiV/FesvnfCiQRQW9G+LeLCgjQacdkoFKvPOI=; b=LM+BuGhLS0KhrptwQxytn+DJNsrmA+jYysCk20GhKFDK/M/medbubo4RwiJNtdbDxM oknQZVU0+HfH2+CSg23+FP7CWzh9TljwchV89oEu7QBiC6zo0U/VplIUXmlXZoQXv/Eq BQq6si4RjhOyAKdrwS7ZdPgZaMQ/mNq5MLGpXrSWc84gC94LHvkJhWLUqMN+vN/+RhcH 916Oi5g7AewCf/iFUFlO+f+o1rveqLVkFa8Ev/211ABeMi9qhjtP5CQDhqjgpf68nnan uOyxRM6W9vlqAEiPM7zkOxeUH1KfQmiPaqXKnsCqki/PeaHAqoGbuUFf4Qc0mPXLyw1V PdKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rEb1ZAVk; 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 qu25si4092931ejb.665.2021.03.12.04.24.02; Fri, 12 Mar 2021 04:24:02 -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=rEb1ZAVk; 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 S229728AbhCLMX0 (ORCPT + 6 others); Fri, 12 Mar 2021 07:23:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231233AbhCLMXA (ORCPT ); Fri, 12 Mar 2021 07:23:00 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73E68C061761 for ; Fri, 12 Mar 2021 04:23:00 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id 124-20020a1c00820000b029010b871409cfso15673394wma.4 for ; Fri, 12 Mar 2021 04:23:00 -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=5ru3G/xiV/FesvnfCiQRQW9G+LeLCgjQacdkoFKvPOI=; b=rEb1ZAVk7u4jNmffOk7mLfzINp31HOQMZUlWVBN1F2s9P8pN+JhAhtVmrutZZRCR2E VvboNivvgKapQp0hLjn1Et0fvwqvFPT3/jQxXbInUp2Zziw0ChMUtR4ReW9vkDNaOa47 WqpOAvxl6jLyNluRd9IkqSzz/L906chETyQVZxEKp1v58HpOH2+8tX9dS06GJhxI/5d6 MsR7N/o3fMB+RnAWcbyfGqYYV72Ir5ufpOGUNPlaSI9hyRPzRHF45GWaKhrGTD3dCgI6 2T8gH/Kjhva1MCuF/zRknPrKHnoZ7aLrdtFx3Gjsij9XrcOgbDF+FbqG2yzct9VzuKeg a+Zw== 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=5ru3G/xiV/FesvnfCiQRQW9G+LeLCgjQacdkoFKvPOI=; b=QNQGeqobauD5VEjNSgLNCZzTeLm04t5eBREXaZS1CxgCKA7vbiqHXT547KZLthFsmx PNFGUh+1tvGSwpj8RUDdPV/rh9rMA9OMpcdEAo7ZETs2TidNyhOWm7jXP3mjGDbcfnQi sNdxmp6mgPfa/LkHyyh5tIbLWnNwQJhLKqu3rvlGOaVsTfumCmrd2TxtoYffhrh3fbf2 7oShdlQRJItsbGNH89BjHUXv2zgHLyGh8wQAX4ZDigs97vveAqqK4FP6QA2Z6Zbr+BNN 91lUmiZog15uO091RUKe3hYaJNs7YkpVLBLmpfIFkwtFbExl5Kli+ZLBgDPBkzKYuN9S SCXg== X-Gm-Message-State: AOAM530RsTd66uUmV4DzIVW72RKtjrzfxYvOO+Jt9nwKj4w2rHatDGWD gmpvteCxS+Gr2sWbx4QPbmEMAQ== X-Received: by 2002:a7b:cd04:: with SMTP id f4mr12894536wmj.76.1615551779161; Fri, 12 Mar 2021 04:22:59 -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 3sm8804329wry.72.2021.03.12.04.22.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 04:22:58 -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: [RESEND PATCH v3 1/5] soundwire: add static port mapping support Date: Fri, 12 Mar 2021 12:22:51 +0000 Message-Id: <20210312122255.3143-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210312122255.3143-1-srinivas.kandagatla@linaro.org> References: <20210312122255.3143-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..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 12:22:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 398604 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1149335jai; Fri, 12 Mar 2021 04:24:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzcrGPDOwwA2ebmC8YB1fRdQ4RyUTZBcBWmia+0lZMNt4Pm/rCp/vp/sNKzT0NzmZOoQwRF X-Received: by 2002:a17:906:2818:: with SMTP id r24mr8302456ejc.472.1615551842316; Fri, 12 Mar 2021 04:24:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615551842; cv=none; d=google.com; s=arc-20160816; b=mAtN0+9iDNY9cFsZ8z7PQw1v2z/keOoR8udta1HcwyYswhILayy+yNZitFQfDG0RSx ukJy/pu8QJYwYlIoyDIQK8OEe5hHc0tURfoUGf+52FxPTupqg2oGNtlf7LD5bWl9BVfv kkgwKH0wfBuCXCQ6wRWLECaBlhcCUTqctC69G+xrcW3Os0MykNnr8vPTMatF2zeFvfGz 6LQEB/QTWQKy3pl3cW+wcR+Z9jK7ZJB1Ks4fNyoUKrMZV2YME+R7LhDl4KkSYkTEaCcn NBY0WT8MuCIiH+JNMwHwuGHX4si//SVkJbndiwIi1AZ0mfRkwN5Djo/Ey95n6vvOu58m 2IOg== 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=VVrrT49hCh8QSMeYRaF6jC+6kuSNOd+smZiBEFnxgnez8SdHS8doX3c7Cda3/vdbBB zkTZpTi2Xr0y8IiUBmh5yaHslkJNUwDaZYyCc8fCUNGwO6iQPFD5ncVuf+mmorFUKRUj NpJ0zW1H8zXsk+RPVDSlAwwAGEIYcKlnZU/MCCR/cfVUQSkZOw1ga8Zfv4tX60Tg1pX4 1YtgLoO4cjZKAi0oTW9WBozcakM/fDCJL/4gwvGmxSlRQnFB58Yyqp9Z2MJj09MSy/zC +1Al0l5v76J+L40UZX4o757BzsoWOx3lZRV0YSVad5VvBjAw5jAPC95GguDLs9RpMMl3 ZsGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ylWoX9xU; 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 qu25si4092931ejb.665.2021.03.12.04.24.02; Fri, 12 Mar 2021 04:24:02 -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=ylWoX9xU; 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 S229501AbhCLMX0 (ORCPT + 6 others); Fri, 12 Mar 2021 07:23:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231252AbhCLMXB (ORCPT ); Fri, 12 Mar 2021 07:23:01 -0500 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60587C061761 for ; Fri, 12 Mar 2021 04:23:01 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id 7so4709474wrz.0 for ; Fri, 12 Mar 2021 04:23:01 -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=ylWoX9xUNZ8xM+1HGI2ImLh8mOmk1MiOPYZg1P7v+ETDVLVHX9F80XJcdSoCzTBImJ tCl38ELjaOK5iwx6nSQQPT7VslSzPgOOrQFPioqLi3t0PxDz7up1bLTv8Q7cVjv8rx+d JQ9DXuka8FoHix/r977MhlIq90uFd70y1D5s3DPL2mw3VpHaN5NuI62SauLnwGXb9u8h h/JyFg6TGGNyNLMXhkBHKISbJ2s6Hgy9YXEpeqXjFqZep2C8mb4H+IiC+GjWptsjhf0i qEHU6URAL24+N9BqJbAOt+9m7QBP7hgOZUvQKGJ1+cTHPsYZkT2Wo+nLouh0OufzcAKw CvEA== 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=AzM7rJRoW+G2xuMW/HJeaXhk3UgpVcyKQDW2Fd6kD99LORf4V//usclevhhgXQp84d ZPtq/ZO0nEzPAxrcNbaK+mWuOprxilvnb/3TN6oEXv3ogim7HFWe3QWaoonRP6sdiJzE 4FQopG6GpNh1R82rxD5Se2NO8+fkTA8FH/2dCeeTbDjQsxMU2ic14+/gr6j95LGga2vp SQoVIgVvTWffiElzPT6UmOxpue6OX9e6Y2XFUuQtNNdNZRHReRDGrZxlrYauWzU7QhLT 5qdLw9TI6li+U79rd5c4nXI6iRPsLXelzjgTWGUZT2qVyQuXOAFCVkB/x4H81gRBIdsH rELA== X-Gm-Message-State: AOAM530cvEiGq3Dcl6Q6oGC9WbpjNw1PvJXVpm5q9Fz/TarTdsF1NL0M xOVqVBXMeEnjs1E1nhBG/lYbAw== X-Received: by 2002:adf:e603:: with SMTP id p3mr13900719wrm.360.1615551780146; Fri, 12 Mar 2021 04:23:00 -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 3sm8804329wry.72.2021.03.12.04.22.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 04:22:59 -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: [RESEND PATCH v3 2/5] soundwire: qcom: update port map allocation bit mask Date: Fri, 12 Mar 2021 12:22:52 +0000 Message-Id: <20210312122255.3143-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210312122255.3143-1-srinivas.kandagatla@linaro.org> References: <20210312122255.3143-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 12:22:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 398606 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1149359jai; Fri, 12 Mar 2021 04:24:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxs/Hmh0qfSr1XNpjE/bzy98fxYBmRpy2zOf4tIt2xNfonMOHXxkPLzAkntiMapgRqrKcyI X-Received: by 2002:a17:906:f12:: with SMTP id z18mr8255104eji.132.1615551843198; Fri, 12 Mar 2021 04:24:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615551843; cv=none; d=google.com; s=arc-20160816; b=EvgcWgpUv3zwQfgLYb61G5CImVk5PSAbG7zwJLnrNUgtkIlV1A263HHHKokqulghrW D/cT7w6HhSxKc3CChoU8cLFirydmPreNOAQQ6VPjHBZqeVSpK4JpgCo2QjycmVtZ/AmL FS9JH6fSUIQLUHwolNYXRaGbdkzXDoDNI5LpjZa67F5d0wm/Tqdgv8Nd+RjCBhBbk10U DQWfEmfaPhhbaoFHXboW1WHgfZyRk34wMndJwzE7YN3mmSpWzsT1AcPLa7FSuS8DK2+f gP+3xi7K3wIZuJSngSeyAcfXrp1trtnDFaimoYPvq+DJvFB4whCiwHX6WTjhSNLl9jjv t5pQ== 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=elxIAI0zY8aXu5mmDKvmE71368PnpWF1vB1iaNcqGqMSKTsQynQvpNRpWkO+K1wN3g +FLCl6bDENEYwivp9Hxy105dbqrrSbYej7UWiqOTo51A4MjaSNAcgvtZ837iWQNEZN4i TFQ3xJ+dtohpeC39fJc3DVMg2J/d/jANZUSsrBIrEVAmBmwLiB2sld6fzn92Y2fo0tef WCv66nB1KX1br+fFoGer5Gyv2BPQypoC/cc2bEsO5wkHFxvxH+sNhir+b4eG3kxsdwjl eG2DA3XQpfZfxzEE7NNfMHAVumwQdpiAKd7hYU76MSDbxButypUDfvKvxo6LCeh3WKP6 8G3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YRawz45L; 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 qu25si4092931ejb.665.2021.03.12.04.24.02; Fri, 12 Mar 2021 04:24:03 -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=YRawz45L; 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 S229900AbhCLMX2 (ORCPT + 6 others); Fri, 12 Mar 2021 07:23:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231277AbhCLMXC (ORCPT ); Fri, 12 Mar 2021 07:23:02 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6057FC061574 for ; Fri, 12 Mar 2021 04:23:02 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id j2so4685938wrx.9 for ; Fri, 12 Mar 2021 04:23:02 -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=YRawz45LNtttk3HenoCONJFDTNNca+FzdessU2tg+yt1grzPilMT9kL/9Wh3yC/Ofe wpOC52qJcJSsHIbRBC4+CK/MUpraS78G8Ow2jtKaV6LjUWo7gzq535HIjhIhACv0A1z0 U1VOs3A7KyrcGJdKpckT/As/AEtmgme9cg3AZ0NP6p2RJyjfT8YhtxLLne7UPuHC0cpC 4MTVhMV+u6t7vPSVkCsHnjmVnsLMrgJIZUwsC5lXoVBQ0o/vjJu8dH3AGjtq2b0f9acM OiB4MkB2fPA6b/pl8NlLc2CNvMqZ/Cwi+ObLOWxvt3zwPL0+CWqRUCzBkDLYtqqQxXz7 uyHA== 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=DiD47yWfU9OCk+0qmD63NrxQODVUKm0U7VTSF2MOIp5lOmN4XtvM6nRivhei7NTaPU gLQ7kYmI+D1m6FzU+VwCHElIC22c2yYshHhGSLaMOwviAB4v4wRXU3xF9XVNfk36arQA YsSoDd1vdIaRNFVYjxIIWpK40JOoFqrwIEuIZy7sQQPOM8tBRXvv6moM1ZaPP2ui3yi5 k+xmu+Ssr3KnQKamyMNzw9F1rQoA6TUqbL0CO0t3VUM2r2L8ULzsI0CLKJXHfY4DO7eX ZBjSsR69elL8m3bEv42XorOlKLS951EqTc1Okneewbf3ODIY6PW5PHVwjuFvkfp3PsMR g5zA== X-Gm-Message-State: AOAM533CVM7epyyXkJ+NPHOmjdf22FuDEp/euDbyPlCx9x/VEQEbTC8w IrhB4IulvM7M398ACVPYCuSDmg== X-Received: by 2002:a05:6000:2aa:: with SMTP id l10mr13737171wry.368.1615551781175; Fri, 12 Mar 2021 04:23:01 -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 3sm8804329wry.72.2021.03.12.04.23.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 04:23:00 -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: [RESEND PATCH v3 3/5] soundwire: qcom: add static port map support Date: Fri, 12 Mar 2021 12:22:53 +0000 Message-Id: <20210312122255.3143-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210312122255.3143-1-srinivas.kandagatla@linaro.org> References: <20210312122255.3143-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 12:22:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 398607 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1149375jai; Fri, 12 Mar 2021 04:24:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJwY1J4L8HoyaPr/xtqf8K5Ua7XZ9dgZLBBaNYNKVHGoEoz/iHYPkrKSlREvdUPDLkM70Tfs X-Received: by 2002:aa7:c983:: with SMTP id c3mr13823456edt.185.1615551844436; Fri, 12 Mar 2021 04:24:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615551844; cv=none; d=google.com; s=arc-20160816; b=SjmxZqoz1PpskJ2eXUwjt6e5KaK2u9wScLEbDdqXEWydX+8MpCTDxjAse12lPzp2Gr 5LenYhfbXYQT9jMHeoXHhtS25QaYoO+Q8jd38/AvcB/8LQJG6S8X17U4xLpHBZMSBVFr IWeysqoUON3shUPaEcOEu3P8XkXA+s5myqhKmoajUUzal5PLVdRnxkxXHXyXJetum9j/ 1QIZrbOUeDPac1DW0oeai2I6EP/8XBYugrEieOETdd/Fj3U/KmA3tdoX6lA/7KyqXwW+ 4Sv+WoQY4c1M9mfXLKCs6BiT8yBS4sTsJKYJ4YBIy8eX1+HUUl7fvYNFq6YBr0e3+0T/ CpIg== 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=0Spvd/NWaM6Y2nXGO70hOxiupwaH2y3vaInffZK1sX4UY0ovmECT6cjNihUVfKXUgN ObKPSy7abj7nyOX6HeZpd+cRjFApomVVhB4V0FBqv8BK+jxQ4PqYAFmCGf+K1QOPCOr3 gphMUjnaXpalc5//V7ZV6TLsMyn5WZ2ii/jQsg013cnV1jEaOrMQaqTnERgXO1w5uhtB w0iZv2QKMs3KbR73lQkYRJ0ZwkVZKOPxvxi2jGQ9xYPzMFsKhGzub8Tx48KhSvJMEwrU A6l13AIwSFoh6EwIeRQoAVESA8sB/bD7JyX938vUhJuzihuCjTmUCHsITBz2pNmXqY1u tAbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MnZg8Bck; 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 qu25si4092931ejb.665.2021.03.12.04.24.04; Fri, 12 Mar 2021 04:24:04 -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=MnZg8Bck; 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 S230072AbhCLMX3 (ORCPT + 6 others); Fri, 12 Mar 2021 07:23:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231337AbhCLMXD (ORCPT ); Fri, 12 Mar 2021 07:23:03 -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 6DBF8C061761 for ; Fri, 12 Mar 2021 04:23:03 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id e9so1665753wrw.10 for ; Fri, 12 Mar 2021 04:23:03 -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=MnZg8BckWCKVKqWXv2LXDVn0bGKFv/UO5w0PAdja6Vo5FYRJNZnEt42SJoQzgoS/BL MMcs/kCElXSsbDwrcstRTWQfBR+SnPt7TA1xtCcKcJp3p/MmRp5t6KeG4SD9v7QV15qC JgvuBbdJ9v7nGrfE6GqM7dNbPiGwKnX2ivGC5XPlpljxamylHW6DIhwxU8MiM/E+F343 TPLo/yzzUh31BRxcjodGt90M6el50sVwyGlHgLOC2wKdDpk/B7X0mUsLnNFj9LhnK5Vt h0Ssv6yTUgHqFalRhDJeK1fUaQAvFEtyEu/dj6tSzdePaY5xz83zK800LrfwsYEKiOpO ukhg== 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=IggNy7AH5hYw4HgyPH+KcdkyvJFtNqIYidRYcenwiQmhQWYNd0H32BpM+2WQeMAK+v DhB/EUTcqR6H8ICHIg3kwOmh3dm5Smg5KC2LH63gKy337PTYZZdDm/ADzhYmmzaPZOtL QHsNlNFo6+QAsGyCkYoyBcWHhPb0RDOWADNpqwYd9YSY0JDO8Kl+dbDb4fg4rmv7InUd JL0UzZ6tpRs/a4IP4GQVlivV5yBo+8vcAt+0rXlTqRU3QvF1PHjNX2DvJHeJslF612Jt JsVws11fR++JY1mG/f679Y94N7LPF48opxL83K/Cdk6rPl1UVYtLXiBGcSDs6p/TaVg7 RQ6w== X-Gm-Message-State: AOAM530kE/CBSl0N3GI63G1xnDGUCw4JgLVeBE4/SD1dS8gkaPI8lRfu C9/jhSSlgqW5PDWZynFvexUzpw== X-Received: by 2002:adf:a2d3:: with SMTP id t19mr13660099wra.299.1615551782223; Fri, 12 Mar 2021 04:23:02 -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 3sm8804329wry.72.2021.03.12.04.23.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 04:23:01 -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: [RESEND PATCH v3 4/5] ASoC: dt-bindings: wsa881x: add bindings for port mapping Date: Fri, 12 Mar 2021 12:22:54 +0000 Message-Id: <20210312122255.3143-5-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210312122255.3143-1-srinivas.kandagatla@linaro.org> References: <20210312122255.3143-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 12:22:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 398608 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1149383jai; Fri, 12 Mar 2021 04:24:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJztlBffvcxu7Nl1GKf+8+Fs4AMA//0mcK7K299Z1cJ+IhhietjLV1TKIvgg66NML0DSICOc X-Received: by 2002:a17:906:1453:: with SMTP id q19mr8387692ejc.76.1615551844876; Fri, 12 Mar 2021 04:24:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615551844; cv=none; d=google.com; s=arc-20160816; b=aQa05lM/JBoJQHwDy9MAxITFIe397WeUL98fCU8Wl6AnfJoYTyNsfl7fGegeurTk8K a8dZztesdA/3Pt3GB8ccbg8vxyYXfSb8hHcZNHKukWZSaEGMZjbhlNdYmw89J6qbBaIN x0lmzp3BuWaTWtarqj9h1b75rvKhK4Oewv5S4ibvnjZfTxjND7usWuP3opivY/4/ew49 GXF3T77sCHLtw1KAUJyfJVy27UCEyhDpHgKimvwkNNs6dOggeeILLAOFnHMdDJ5PQCwU RnM+lWeNNAJEB8eRs4bleuuWVUnHWRZDgpIonmWzmx+SX4ldFh8x0adYVUSev9IWDE/r 1vbA== 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=rJ/e61d61B87LqY4e2g8ervhaovoSSkzjlRalTOGyxqxvg944HxfDdbDOFqyB5lDyp bnRu5KuSU+d5K49XISDij+16t4sRTgal7li7DcATywb9Fle4+yRZHnWtTWF/lt2Uo6oL Qr2Mco7VnCDESFMzlrwDiQE+TpIeuVX23nw9MFKRyfCTuRpuoiIW4qXYhs+8Grh0ouIB NJ9KiDviGmS4RZJTvn/hoxZpOJWmY1rvNEkRf/Z509rM6ExGJ1+9m+o96fIhuS+pnoOg bMEy5usyD5mIDA9PhSHmfr9imBG7PQP4zs6HL3q/e3Jrk/d0eT5vOu8Kf70uH8LIHX9q 7YNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rFfAknAn; 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 qu25si4092931ejb.665.2021.03.12.04.24.04; Fri, 12 Mar 2021 04:24:04 -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=rFfAknAn; 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 S229909AbhCLMX3 (ORCPT + 6 others); Fri, 12 Mar 2021 07:23:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231352AbhCLMXE (ORCPT ); Fri, 12 Mar 2021 07:23:04 -0500 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67924C061761 for ; Fri, 12 Mar 2021 04:23:04 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id o16so1666126wrn.0 for ; Fri, 12 Mar 2021 04:23:04 -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=rFfAknAn5CJnRejX4QyXzIFMwYrLIm4HeDtYghHnkwcBjzWm4mw9uVi+8lsyFKmg6Q Ur+iwXV2EnLl4daPvmsRLkD64G/qP0II7UX7EwwNBOV5zcwEhKxrRsYHRg4FxaTiZNDH rOBUOk9yVSoXYcqSklkyDf5aTB14iYxsZvLz7qmkqI478nBi+Mx9+aUAeOuAaXPNwB1L RDcWpIotREa04xviaPO5/0AJKENpkeYGESffgMNcxOyspnwLGj0+nxGkorXSZbc32mFZ R1U0rKrd7I0Jyqgg8+iPsoZokxoniKhdZTn0SrfTnGl/wrcKW5JADRN5d33zmip5s9R/ Dn8g== 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=SOHvU8loX4sIijftSOjQ7hvXvmnaqbOKVrxBDVtPNB8u9OfcJ+SlHH+5O8BHLwGRFM B5+IfdTczinoY7DWLOCO44da8Gm3M2FK/xLtkX9649jSN55MeTLWIYPX5sbrT1UNk8MK ZeZNMBDLzmtirjUZXIXIf9XtMTHB/0AJuaqZrPJYinvgcWqmKx5ZRl5y5grkt6gxQQ59 7xGpwuxq4cxkkAahtPilCNKT/D1i73aP3THi8SGpJi0q72682eHC4Pu+6ElzEouVQdL5 IuYgk/K1dRiCdI7JEpHZoyHVTiS/suXXta///n75drAWqBLD070m0cjMsDq5a5CEkbgF KapQ== X-Gm-Message-State: AOAM531vKAYH+AR2IF7prtuSXZGoowmYgYwJKf3oi1PYeU5NrBD0W+Fa fOxMgrMvXv+sWOSbIwPGN6mJYA== X-Received: by 2002:adf:9f54:: with SMTP id f20mr13793513wrg.362.1615551783189; Fri, 12 Mar 2021 04:23:03 -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 3sm8804329wry.72.2021.03.12.04.23.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 04:23:02 -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: [RESEND PATCH v3 5/5] ASoC: codecs: wsa881x: add static port map support Date: Fri, 12 Mar 2021 12:22:55 +0000 Message-Id: <20210312122255.3143-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210312122255.3143-1-srinivas.kandagatla@linaro.org> References: <20210312122255.3143-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;