From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4ED0F3CFF64 for ; Tue, 7 Apr 2026 17:03:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775581405; cv=none; b=u+HUMo3U71Ln+OTjNfG7R95404Xl6onWkL7M8sgwVQUr4Fx6LdwEGF9jFrhVzBGXG2D2fO0DJ4AAL6KUoWUt+wEOSgKS7FIJctUC1oUJNtUFE05O4Vb9fwc6ZRGQzftcsG6o8f2IEmrGj7BRATJtaJEjyiB0Z+flrh73n4SAc+M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775581405; c=relaxed/simple; bh=yS7fLPfpixS5ANKUpz+8IbWfPa7J2Jlmh+GVNICRquY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=pR8irovR/uaRRvPI85goBawEU9ugwZAgfQB7h+fWnYNNtQXnhKBhEoGE33eMVmVRlcb1LiQq6QgyD7FG7jKIogduAyTJryMDodFCkVgjey4cI+J4SYU4I1I7QY/08OMTRHJJCCSoCEESHYioa2m3y5MN2ymfGXc+YdTJoRij3JY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bz9AiL+t; arc=none smtp.client-ip=209.85.215.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bz9AiL+t" Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-c76d797b180so2647076a12.2 for ; Tue, 07 Apr 2026 10:03:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775581404; x=1776186204; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=USinWtrK9cNysHqIyf7r5O6B/9/TrlyTmryTw2WVrbs=; b=bz9AiL+twoSLeq+CzPPAgwn4mWno8WWwjt/NBjC0PvxmAPk3tfCLAF5FpfgNQzdGCn 7JBHv/wyjnuE3m6L7Bc1g0vJmZsKEsUTBA+Uj5KknjQBrH8d0o54ncQQohhx6SxNqpbv EpsYeenlfUqc58p85pTdptppS8hk8TQOxqYFkc8+4ON2uQhDM75w4R0eSI4Z+9MFfvyt FdIAXzb7vbkzq07NSr2syksKv4NCNFTz7cbWWSAl9k7C4bOiMmD9Wfg/+M7fwCl27CG1 iEyQeNcLYqIEMqjZ9/0vJ4XctDEA2t16QsrZlO4VyHiGf36lAuyT4aLscnSOxsbVp0CR 2wIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775581404; x=1776186204; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=USinWtrK9cNysHqIyf7r5O6B/9/TrlyTmryTw2WVrbs=; b=EZQDLnUt1nnReoaC3NJvWReZrhQzbHULYYU0Y438+HH7gYo+bhxFyrTHvpKtcRly3z ESWbUNWhvIfwYquuBRS+abU5W5kqmAOrPMZ8xtBOHOflPj72t4ip7DtcY5f7SYnuz+k5 VlnHGzGyjyNsyDaAYw5ffJ0hFrXqM71QA78I2lJ5/w+y7k1nQOLPjQjEX/AHCd1PBI5K 4TByUgp997PXz1qDRMYxFF+RvPMEas34bnK+wh0DcwEnt4E8ex+Jt9GIX778nExnj2SL ylHZ2pCy2nuIP2HK3kh1GGnLhjnaCdjm/F6rxWdvyPU1g8F4jEZ6LDqDkV6In7M6CgCG j2nw== X-Forwarded-Encrypted: i=1; AJvYcCXJtqockq0otmFNDliZahPj2t0BWQmXezt4Cw+zjR3+hXQjFB9h9rbkkHgf/6MeUzxT5EKUEEQKiyka1M0=@vger.kernel.org X-Gm-Message-State: AOJu0YzyyrSEQnR7IDKkKvR0SkVGn1zdrMlkMZzfRrYXlb2hfmqKxhGH AbptedBfQiAsOfnrp+SzTfppHH1uFbIs+C/AyihwhpgHUiTlioqjNaRo X-Gm-Gg: AeBDietjz88G7I2mSozQ+SQcM336NqVuiR0atesYoOpHHMad1JvA54ZCpkXo2dC38P8 1H6RRwDlPDpftJ/0Od5tu2YEsu2lYTX01zBwOkeG9cAaQX990TfcQDiljzLLY5g6XKLZYq04MwE +CGg5VWNSBBllPn3tCHmkTMwBnVIPMGZ62CxrJ+rK9FPMFPVXAHJ062ecbLttrYeaR0XoA0jKH0 X2tOF0+c6nCLC43LA1LyjsOLFsUtT1cyTFzoLOhCUbJp6MrPJk6qsLBMde4ZmNYueIU1jVFF+Nm tHcT881iJ2yX5aWCJASUg1RAHjtukb20Uwjdj0mB0xtuJm+o1qtCiZF24V5NkmWsnKReH48GjUI +PKf+5/81aeIpD+4VnZeP0fIX8HrVVkzFjADy7wtB89EQ3OMZDMYwCtkqKnkl+Nuxu5xtRjozhG ZxZvlHDVZ84a/H+9KpuEqgImzsRZ39/DiI2O7e1NONm9kLla5fVSt/W2jgWD4MQcRZ8msINPuyL /FkoWJTzO+5XcYVe8cjnJPvHaQXJt45bKI3zPZ7kWHc+sZ/FM4P1f7C/A== X-Received: by 2002:a17:903:3c47:b0:2b0:67a7:5c4b with SMTP id d9443c01a7336-2b281802d24mr196869375ad.28.1775581403501; Tue, 07 Apr 2026 10:03:23 -0700 (PDT) Received: from lorddaniel-VivoBook-ASUSLaptop-K3502ZA-S3502ZA.www.tendawifi.com ([14.139.108.62]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b27478cb4fsm196617905ad.29.2026.04.07.10.03.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Apr 2026 10:03:22 -0700 (PDT) From: Piyush Patle To: Mark Brown Cc: Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Thierry Reding , Jonathan Hunter , Sheetal , Kuninori Morimoto , linux-sound@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/2] ASoC: tegra210: simplify byte map handling in ADX and AMX Date: Tue, 7 Apr 2026 22:33:06 +0530 Message-Id: <20260407170308.100238-1-piyushpatle228@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The Tegra210 ADX and AMX drivers both keep their "Byte Map N" ALSA control state as a byte-packed u32 map[] array along with a separate byte_mask[] bitmap. This is because the control range exposed to userspace is [0, 256], where 256 is the "disabled" sentinel and does not fit in a byte, so the two arrays have to be cross-checked on every get()/put(). This series stores each slot as a u16 holding the user-visible value directly, turning get_byte_map() into a direct return and put_byte_map() into a compare-and-store. The hardware-facing packed RAM word and the IN_BYTE_EN / OUT_BYTE_EN enable masks are computed on the fly inside each write_map_ram() callback, which is the only place that needs to know the hardware layout. The byte_mask[] field is dropped from both driver state structs. There is no userspace-visible ABI change. Control declarations, ranges, initial values and handling of out-of-range writes is preserved by treating values outside [0, 255] as disabled (256), matching previous behavior. As a side effect each patch also fixes a latent bug in put_byte_map() where an enabled-to-enabled value change was not persisted. The packed RAM word construction is also updated to ensure the shift operates on a u32 value, avoiding potential undefined behavior due to signed integer promotion. Addresses TODO comments left in tegra210_{adx,amx}_get_byte_map(). Patch 1/2: ASoC: tegra210_adx: simplify byte map get/put logic Patch 2/2: ASoC: tegra210_amx: simplify byte map get/put logic -- 2.34.1