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;