get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2221024/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2221024,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2221024/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-tegra/patch/20260408170818.70322-3-piyushpatle228@gmail.com/",
    "project": {
        "id": 21,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/21/?format=api",
        "name": "Linux Tegra Development",
        "link_name": "linux-tegra",
        "list_id": "linux-tegra.vger.kernel.org",
        "list_email": "linux-tegra@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null
    },
    "msgid": "<20260408170818.70322-3-piyushpatle228@gmail.com>",
    "date": "2026-04-08T17:08:18",
    "name": "[v2,2/2] ASoC: tegra210_amx: simplify byte map get/put logic",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "e2f6809a2513aa86c9528cefd95a56e80b2e2d1f",
    "submitter": {
        "id": 92665,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/92665/?format=api",
        "name": "Piyush Patle",
        "email": "piyushpatle228@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-tegra/patch/20260408170818.70322-3-piyushpatle228@gmail.com/mbox/",
    "series": [
        {
            "id": 499165,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/499165/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-tegra/list/?series=499165",
            "date": "2026-04-08T17:08:16",
            "name": "ASoC: tegra210: simplify byte map handling in ADX and AMX",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/499165/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2221024/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2221024/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <linux-tegra+bounces-13616-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-tegra@vger.kernel.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=TSNtX1w2;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-tegra+bounces-13616-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"TSNtX1w2\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.210.176",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com"
        ],
        "Received": [
            "from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4frV0L4nFSz1xv0\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 03:09:06 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 0EC66303E128\n\tfor <incoming@patchwork.ozlabs.org>; Wed,  8 Apr 2026 17:08:45 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id D20D7344D82;\n\tWed,  8 Apr 2026 17:08:44 +0000 (UTC)",
            "from mail-pf1-f176.google.com (mail-pf1-f176.google.com\n [209.85.210.176])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 1FC313D411A\n\tfor <linux-tegra@vger.kernel.org>; Wed,  8 Apr 2026 17:08:42 +0000 (UTC)",
            "by mail-pf1-f176.google.com with SMTP id\n d2e1a72fcca58-82748257f5fso761605b3a.1\n        for <linux-tegra@vger.kernel.org>;\n Wed, 08 Apr 2026 10:08:42 -0700 (PDT)",
            "from\n lorddaniel-VivoBook-ASUSLaptop-K3502ZA-S3502ZA.www.tendawifi.com\n ([14.139.108.62])\n        by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-82cf9b2694csm21775091b3a.2.2026.04.08.10.08.38\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Wed, 08 Apr 2026 10:08:41 -0700 (PDT)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775668124; cv=none;\n b=Lq2wHwulppEUPvLktE6tEXL64OYZLRbEE/8Kv9KivsUR5avFG2H1p1eGk7eH5lxJLYXTgfEeYuRv85pjr8bueT7KEv8eEOAfBBdxvFu8l+dnhW/U1PPB68klcIN7WVRAW619xEbBNwmD/dW8JfJEF97XqHw4mJdWNN3hxyg+a6Y=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775668124; c=relaxed/simple;\n\tbh=rcpwryuEThlZF4upS3cCoE0WjIeBtxUV+f2V6hrTY+o=;\n\th=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:\n\t MIME-Version;\n b=oUQQidCPbAg1hVgsrHwUoBbMWSRn0PjnMm36nPNLAETTKXEBTM0vxOdLQKiDbhMfB+U9RzVVeOFatv74XgXJTmvAxUzRUbBX7VAVOsJSAobMJKhOHA8lASjk+8A6G+nlA6oH6VKwjlKku83jFihh0pydhC9vj4NEDkWtkOqXJVM=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=TSNtX1w2; arc=none smtp.client-ip=209.85.210.176",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1775668122; x=1776272922;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=EKkzFs5JDjxn2dtILtgHOZXS7Y3HfRJU6U7EopQqpaY=;\n        b=TSNtX1w214BSPl2VezCLMReh0SPW51z2diyAm29o8Ep9aiW+L/845QVwAXWdCIJ4wY\n         c0ixJQh075X3z6Kv17aZ9i/f4/TN3SKHbCmJcHF3LcmmOuq5CoWgne3kOA4LZN/Yi/i4\n         9mF8Al5LfLw+3ssk7x5+nzUvMkHqcJl/YLKMAfyMxnbhKDDveuV35LgirEjfYo5Rqagl\n         rI8z4DfHUGtOzn9CO+tyTmY5WrVTjdjj+tZkpWC3O/9Wk32SIgTjZoB83egpmQa4TpGD\n         003bZZPJ646t6NGFRPd0HKlf4ZrV9B1Xv4jVjI1GSZNmuMGnasH1qE4PFa9MW5oaU5j7\n         u3fg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1775668122; x=1776272922;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n         :to:cc:subject:date:message-id:reply-to;\n        bh=EKkzFs5JDjxn2dtILtgHOZXS7Y3HfRJU6U7EopQqpaY=;\n        b=IVmtGGN6C8piFzWbruXUfkKbOXX8o/LDCESd9EFdGvGmvdWAaJmEYLj5ZafZlGn7ZK\n         BuqEJtQUCxil0wlh9MgM/jnTiAadfYuTGKVcrIoEvouL5df27CfAG50JOD8W1C+6MaUd\n         ZWGG//fn/deE+C4BjF9nDIu8MLDIIZ/0B0K8SwN7eT5VqPRJvUSV0+PYWBFBFpkuotQH\n         tOFxb20Evj/YT5ylsh5Et46O3JL9OiqeS4Jgi8UMloC4AL0QiyFemYHDirYCSBe34xAV\n         mtCbt5nGMq4ewR88IKqoYuSw1JxZimIeDXHYNEVNXUJJqtSXEtjko6C8Z76uHWO+aDPS\n         l1ZQ==",
        "X-Forwarded-Encrypted": "i=1;\n AJvYcCXWaBK0T1BLBSCWE3LslUcn0x2Crn/ibirhGFJdesU5MFQmrtdUvueVvt9fayMSPcmBrHmp+z9uUI1mUg==@vger.kernel.org",
        "X-Gm-Message-State": "AOJu0YzYawXnMRo/q2IDO0iDVmPOlR3zPb/RtFoahVdCpsAq6FKnZIwm\n\tpcYOaPVqFOBt0mrdI+4it+D4VKqoenOFWsxk3zJgbWRG6EEoPvgfF3kH",
        "X-Gm-Gg": "AeBDiesIIlOf4FSf07FJZbUSR2H4AYIpPF+GPI7EiB6S0tpmOHBT9chf2wwAdG9rozH\n\tXDNOFD/bIFnXcmBd878RJziAPItOAi4GmUZy98vIfnAHObnhNf9eBV+3EAUh6YO2mXPEkM0bGpG\n\tc0uFAaNLA7jFSE8Ve12Is1BUfQuwPdVRHBP+bxmJ2pSZ+sxWCiyCa0+PmBUQ8mL3DDwoeuMD2C5\n\t0iG++X8LDzLye4TwovZd/vk5rNwnLcgcPSyhakVgVdHEQibNtjP6lr0mCqO+wpMjCn1XCdfTEFN\n\ti1D8wcnnB/4MPeu+R8kbxW1xn1yGOJSKM29lUOJcjF2WXt0QNSSoMS/Yjb+3Hf3hPI/PXdmQ3dS\n\ttXr+ys7NRSv/ceJqYQnHee0Almn8MLPEeQa/IHgbZnewp49ClGQiXwfYh4pe9j1Al7KAgXYHieI\n\tguxfQSp/VBiiJiMuQi9hea3wM8VLTTqPR3/WAV+KXTujd7SB2+SkTwTDSWVfvQmGFDQa/n8XPfR\n\t4vo+0SPQLKDf+q9ymUJiQvtO1SMXIGjDnt126A0MVrORgFcWojlnR290A==",
        "X-Received": "by 2002:a05:6a20:918b:b0:398:71f2:59dd with SMTP id\n adf61e73a8af0-39fc936e551mr285412637.9.1775668122444;\n        Wed, 08 Apr 2026 10:08:42 -0700 (PDT)",
        "From": "Piyush Patle <piyushpatle228@gmail.com>",
        "To": "Mark Brown <broonie@kernel.org>",
        "Cc": "Sheetal <sheetal@nvidia.com>,\n\tJonathan Hunter <jonathanh@nvidia.com>,\n\tThierry Reding <thierry.reding@gmail.com>,\n\tLiam Girdwood <lgirdwood@gmail.com>,\n\tJaroslav Kysela <perex@perex.cz>,\n\tTakashi Iwai <tiwai@suse.com>,\n\tKuninori Morimoto <kuninori.morimoto.gx@renesas.com>,\n\tlinux-sound@vger.kernel.org,\n\tlinux-tegra@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org",
        "Subject": "[PATCH v2 2/2] ASoC: tegra210_amx: simplify byte map get/put logic",
        "Date": "Wed,  8 Apr 2026 22:38:18 +0530",
        "Message-Id": "<20260408170818.70322-3-piyushpatle228@gmail.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20260408170818.70322-1-piyushpatle228@gmail.com>",
        "References": "<20260407170308.100238-3-piyushpatle228@gmail.com>\n <20260408170818.70322-1-piyushpatle228@gmail.com>",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-tegra@vger.kernel.org",
        "List-Id": "<linux-tegra.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-tegra+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-tegra+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit"
    },
    "content": "The byte-map controls (\"Byte Map N\") already expose a value range of\n[0, 256] to userspace via SOC_SINGLE_EXT(), where 256 is the\n\"disabled\" sentinel. The driver stored this state as a byte-packed\nu32 map[] array plus a separate byte_mask[] bitmap tracking which\nslots were enabled, because 256 does not fit in a byte. As a result\nget_byte_map() had to consult byte_mask[] to decide whether to\nreport the stored byte or 256, and put_byte_map() had to keep the\ntwo arrays in sync on every write.\n\nStore each slot as a u16 holding the control value directly\n(0..255 enabled, 256 disabled). This is the native representation\nfor what userspace already sees, so get_byte_map() becomes a direct\nreturn and put_byte_map() becomes a compare-and-store. The\nhardware-facing packed RAM word and the OUT_BYTE_EN mask are now\nderived on the fly inside tegra210_amx_write_map_ram() from the\nslot array, which is the only place that needs to know about the\nhardware layout.\n\nThe byte_mask scratch buffer is allocated dynamically using\nkcalloc() based on soc_data->byte_mask_size, removing dependency\non SoC-specific constants. The byte_mask field is dropped from\nstruct tegra210_amx.\n\nA new TEGRA_AMX_SLOTS_PER_WORD constant replaces the literal '4'\nused for byte slots per RAM word, and BITS_PER_BYTE /\nBITS_PER_TYPE() from <linux/bits.h> replace the literal '8' and\n'32' shifts.\n\nSlots are initialised to 256 in probe() so the default reported\nvalue stays \"disabled\", matching previous behaviour. Values written\nfrom userspace that fall outside [0, 255] are clamped to 256\n(\"disabled\") exactly as before -- no userspace-visible change.\n\nAs a side effect this also fixes a latent bug in the previous\nput_byte_map(): because it compared the enable mask rather than the\nstored byte, changing a slot from one enabled value to another\nenabled value (e.g. 42 -> 99) would early-return without persisting\nthe new value, and the next CFG_RAM flush would still program the\nold byte. The new implementation compares the stored value itself,\nso this case is now handled correctly.\n\nAddresses TODO left in tegra210_amx_get_byte_map().\n\nSigned-off-by: Piyush Patle <piyushpatle228@gmail.com>\n---\nChanges since v1:\n - Allocate byte_mask[] dynamically using kcalloc()\n - Propagate -ENOMEM from write_map_ram()\n - Replace magic numbers with TEGRA_AMX_SLOTS_PER_WORD\n - Use BITS_PER_BYTE and BITS_PER_TYPE()\n - Add <linux/bits.h> and <linux/slab.h>\n\n sound/soc/tegra/tegra210_amx.c | 96 ++++++++++++++++++----------------\n sound/soc/tegra/tegra210_amx.h |  6 ++-\n 2 files changed, 54 insertions(+), 48 deletions(-)",
    "diff": "diff --git a/sound/soc/tegra/tegra210_amx.c b/sound/soc/tegra/tegra210_amx.c\nindex bfda82505298..bc808fabe171 100644\n--- a/sound/soc/tegra/tegra210_amx.c\n+++ b/sound/soc/tegra/tegra210_amx.c\n@@ -4,6 +4,7 @@\n //\n // tegra210_amx.c - Tegra210 AMX driver\n \n+#include <linux/bits.h>\n #include <linux/clk.h>\n #include <linux/device.h>\n #include <linux/io.h>\n@@ -12,6 +13,7 @@\n #include <linux/platform_device.h>\n #include <linux/pm_runtime.h>\n #include <linux/regmap.h>\n+#include <linux/slab.h>\n #include <sound/core.h>\n #include <sound/pcm.h>\n #include <sound/pcm_params.h>\n@@ -58,23 +60,48 @@ static const struct reg_default tegra264_amx_reg_defaults[] = {\n \t{ TEGRA264_AMX_CFG_RAM_CTRL, 0x00004000},\n };\n \n-static void tegra210_amx_write_map_ram(struct tegra210_amx *amx)\n+static int tegra210_amx_write_map_ram(struct tegra210_amx *amx)\n {\n+\tconst unsigned int bits_per_mask = BITS_PER_TYPE(*amx->map) * BITS_PER_BYTE;\n+\tunsigned int *byte_mask;\n \tint i;\n \n+\tbyte_mask = kcalloc(amx->soc_data->byte_mask_size, sizeof(*byte_mask),\n+\t\t\t    GFP_KERNEL);\n+\tif (!byte_mask)\n+\t\treturn -ENOMEM;\n+\n \tregmap_write(amx->regmap, TEGRA210_AMX_CFG_RAM_CTRL + amx->soc_data->reg_offset,\n \t\t     TEGRA210_AMX_CFG_RAM_CTRL_SEQ_ACCESS_EN |\n \t\t     TEGRA210_AMX_CFG_RAM_CTRL_ADDR_INIT_EN |\n \t\t     TEGRA210_AMX_CFG_RAM_CTRL_RW_WRITE);\n \n-\tfor (i = 0; i < amx->soc_data->ram_depth; i++)\n+\tfor (i = 0; i < amx->soc_data->ram_depth; i++) {\n+\t\tu32 word = 0;\n+\t\tint b;\n+\n+\t\tfor (b = 0; b < TEGRA_AMX_SLOTS_PER_WORD; b++) {\n+\t\t\tunsigned int slot = i * TEGRA_AMX_SLOTS_PER_WORD + b;\n+\t\t\tu16 val = amx->map[slot];\n+\n+\t\t\tif (val >= 256)\n+\t\t\t\tcontinue;\n+\n+\t\t\tword |= (u32)val << (b * BITS_PER_BYTE);\n+\t\t\tbyte_mask[slot / bits_per_mask] |= 1U << (slot % bits_per_mask);\n+\t\t}\n \t\tregmap_write(amx->regmap, TEGRA210_AMX_CFG_RAM_DATA + amx->soc_data->reg_offset,\n-\t\t\t     amx->map[i]);\n+\t\t\t     word);\n+\t}\n \n \tfor (i = 0; i < amx->soc_data->byte_mask_size; i++)\n \t\tregmap_write(amx->regmap,\n \t\t\t     TEGRA210_AMX_OUT_BYTE_EN0 + (i * TEGRA210_AMX_AUDIOCIF_CH_STRIDE),\n-\t\t\t     amx->byte_mask[i]);\n+\t\t\t     byte_mask[i]);\n+\n+\tkfree(byte_mask);\n+\n+\treturn 0;\n }\n \n static int tegra210_amx_startup(struct snd_pcm_substream *substream,\n@@ -134,9 +161,7 @@ static int tegra210_amx_runtime_resume(struct device *dev)\n \t\tTEGRA210_AMX_CTRL_RX_DEP_MASK,\n \t\tTEGRA210_AMX_WAIT_ON_ANY << TEGRA210_AMX_CTRL_RX_DEP_SHIFT);\n \n-\ttegra210_amx_write_map_ram(amx);\n-\n-\treturn 0;\n+\treturn tegra210_amx_write_map_ram(amx);\n }\n \n static int tegra210_amx_set_audio_cif(struct snd_soc_dai *dai,\n@@ -212,26 +237,8 @@ static int tegra210_amx_get_byte_map(struct snd_kcontrol *kcontrol,\n \tstruct soc_mixer_control *mc =\n \t\t(struct soc_mixer_control *)kcontrol->private_value;\n \tstruct tegra210_amx *amx = snd_soc_component_get_drvdata(cmpnt);\n-\tunsigned char *bytes_map = (unsigned char *)amx->map;\n-\tint reg = mc->reg;\n-\tint enabled;\n-\n-\tenabled = amx->byte_mask[reg / 32] & (1 << (reg % 32));\n \n-\t/*\n-\t * TODO: Simplify this logic to just return from bytes_map[]\n-\t *\n-\t * Presently below is required since bytes_map[] is\n-\t * tightly packed and cannot store the control value of 256.\n-\t * Byte mask state is used to know if 256 needs to be returned.\n-\t * Note that for control value of 256, the put() call stores 0\n-\t * in the bytes_map[] and disables the corresponding bit in\n-\t * byte_mask[].\n-\t */\n-\tif (enabled)\n-\t\tucontrol->value.integer.value[0] = bytes_map[reg];\n-\telse\n-\t\tucontrol->value.integer.value[0] = 256;\n+\tucontrol->value.integer.value[0] = amx->map[mc->reg];\n \n \treturn 0;\n }\n@@ -243,22 +250,20 @@ static int tegra210_amx_put_byte_map(struct snd_kcontrol *kcontrol,\n \t\t(struct soc_mixer_control *)kcontrol->private_value;\n \tstruct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol);\n \tstruct tegra210_amx *amx = snd_soc_component_get_drvdata(cmpnt);\n-\tunsigned char *bytes_map = (unsigned char *)amx->map;\n-\tint reg = mc->reg;\n-\tint value = ucontrol->value.integer.value[0];\n-\tunsigned int mask_val = amx->byte_mask[reg / 32];\n+\tunsigned int value = ucontrol->value.integer.value[0];\n \n-\tif (value >= 0 && value <= 255)\n-\t\tmask_val |= (1 << (reg % 32));\n-\telse\n-\t\tmask_val &= ~(1 << (reg % 32));\n+\t/*\n+\t * Match the previous behaviour: any value outside [0, 255] is\n+\t * treated as the \"disabled\" sentinel (256). Negative values from\n+\t * userspace fold in through the unsigned cast and are caught here.\n+\t */\n+\tif (value > 255)\n+\t\tvalue = 256;\n \n-\tif (mask_val == amx->byte_mask[reg / 32])\n+\tif (amx->map[mc->reg] == value)\n \t\treturn 0;\n \n-\t/* Update byte map and slot */\n-\tbytes_map[reg] = value % 256;\n-\tamx->byte_mask[reg / 32] = mask_val;\n+\tamx->map[mc->reg] = value;\n \n \treturn 1;\n }\n@@ -727,7 +732,7 @@ static int tegra210_amx_platform_probe(struct platform_device *pdev)\n \tstruct device *dev = &pdev->dev;\n \tstruct tegra210_amx *amx;\n \tvoid __iomem *regs;\n-\tint err;\n+\tint err, i;\n \n \tamx = devm_kzalloc(dev, sizeof(*amx), GFP_KERNEL);\n \tif (!amx)\n@@ -750,16 +755,15 @@ static int tegra210_amx_platform_probe(struct platform_device *pdev)\n \n \tregcache_cache_only(amx->regmap, true);\n \n-\tamx->map = devm_kzalloc(dev, amx->soc_data->ram_depth * sizeof(*amx->map),\n-\t\t\t\tGFP_KERNEL);\n+\tamx->map = devm_kcalloc(dev,\n+\t\t\t\tamx->soc_data->ram_depth * TEGRA_AMX_SLOTS_PER_WORD,\n+\t\t\t\tsizeof(*amx->map), GFP_KERNEL);\n \tif (!amx->map)\n \t\treturn -ENOMEM;\n \n-\tamx->byte_mask = devm_kzalloc(dev,\n-\t\t\t\t      amx->soc_data->byte_mask_size * sizeof(*amx->byte_mask),\n-\t\t\t\t      GFP_KERNEL);\n-\tif (!amx->byte_mask)\n-\t\treturn -ENOMEM;\n+\t/* Initialise all byte map slots as disabled (value 256). */\n+\tfor (i = 0; i < amx->soc_data->ram_depth * TEGRA_AMX_SLOTS_PER_WORD; i++)\n+\t\tamx->map[i] = 256;\n \n \ttegra210_amx_dais[TEGRA_AMX_OUT_DAI_ID].capture.channels_max =\n \t\t\tamx->soc_data->max_ch;\ndiff --git a/sound/soc/tegra/tegra210_amx.h b/sound/soc/tegra/tegra210_amx.h\nindex 50a237b197ba..2c125a191a1a 100644\n--- a/sound/soc/tegra/tegra210_amx.h\n+++ b/sound/soc/tegra/tegra210_amx.h\n@@ -8,6 +8,8 @@\n #ifndef __TEGRA210_AMX_H__\n #define __TEGRA210_AMX_H__\n \n+#include <linux/types.h>\n+\n /* Register offsets from TEGRA210_AMX*_BASE */\n #define TEGRA210_AMX_RX_STATUS\t\t\t0x0c\n #define TEGRA210_AMX_RX_INT_STATUS\t\t0x10\n@@ -73,6 +75,7 @@\n #define TEGRA210_AMX_SOFT_RESET_SOFT_RESET_MASK\t\tTEGRA210_AMX_SOFT_RESET_SOFT_EN\n \n #define TEGRA210_AMX_AUDIOCIF_CH_STRIDE\t\t4\n+#define TEGRA_AMX_SLOTS_PER_WORD\t\t4\n #define TEGRA210_AMX_RAM_DEPTH\t\t\t16\n #define TEGRA210_AMX_MAP_STREAM_NUM_SHIFT\t6\n #define TEGRA210_AMX_MAP_WORD_NUM_SHIFT\t\t2\n@@ -105,8 +108,7 @@ struct tegra210_amx_soc_data {\n \n struct tegra210_amx {\n \tconst struct tegra210_amx_soc_data *soc_data;\n-\tunsigned int *map;\n-\tunsigned int *byte_mask;\n+\tu16 *map;\n \tstruct regmap *regmap;\n };\n \n",
    "prefixes": [
        "v2",
        "2/2"
    ]
}