All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] soundwire: amd: introduce hw_ops dispatch and consolidate probe setup
@ 2026-09-17  9:02 Vijendar Mukunda
  2026-09-17  9:02 ` [PATCH 1/9] soundwire: amd: rename AMD_SDW_MAX_MANAGER_COUNT macro Vijendar Mukunda
                   ` (8 more replies)
  0 siblings, 9 replies; 14+ messages in thread
From: Vijendar Mukunda @ 2026-09-17  9:02 UTC (permalink / raw)
  To: vkoul
  Cc: broonie, alsa-devel, yung-chuan.liao, pierre-louis.bossart,
	Basavaraj.Hiregoudar, Sunil-kumar.Dommati, venkataprasad.potturu,
	Syed.SabaKareem, Mario.Limonciello, Richard.Gong, linux-sound,
	linux-kernel, Vijendar Mukunda

This series refactors the AMD SoundWire manager driver to replace
direct calls to ACP6.3-specific hardware functions with a
function-pointer dispatch table (struct amd_sdw_hw_ops). The goal is
to make adding support for new ACP revisions a matter of registering a
revision-specific ops table rather than scattering switch/case
statements across the driver.

The series also consolidates probe-time revision-specific assignments
into explicit switch blocks, replaces fixed-size arrays in
sdw_amd_ctx with dynamically-allocated ones sized from the ACP
revision, and cleans up a few stale symbols and redundant
initialisations.

Background:

The AMD SoundWire IP block was introduced on ACP6.3 and is shared
by ACP7.0, ACP7.1 and ACP7.2 with minor register-level differences.
The driver previously used a flat, hardcoded naming scheme
(amd_sdw_*) with no mechanism to swap hardware implementations per
revision. The amd_acp63_* prefix and the hw_ops dispatch table
introduced here make the per-revision nature explicit and provide a
clean extension point for future platforms.

Series overview:

Patches 1-3 are preparatory: rename the manager-count macro to carry
the ACP6.3 scope, convert the pdevinfo/sdw_pdata and pdev arrays in
sdw_amd_probe_controller() from fixed-size stack/inline arrays to
heap allocations sized by the ACP revision, ensuring the probe path
is ready for revisions with a different manager count.

Patch 4 renames the revision-specific hardware-access functions,
static op-table instances, and the manager register-offset constant
to the amd_acp63_* / ACP63_* prefix. Patch 5 removes an unused
define left over from an earlier refactor.

Patches 6-8 introduce and wire up the hw_ops dispatch framework:
patch 6 defines struct amd_sdw_hw_ops and the inline acp_*() dispatch
helpers; patch 7 converts the irq/work handlers to take
struct amd_sdw_manager * so they fit the hw_ops callback signature;
patch 8 extracts the PM callbacks into hw_ops slots, populates a
static const amd_acp63_hw_ops table covering all 19 callbacks, and
converts every remaining direct amd_acp63_*() call site to use the
corresponding acp_*() wrapper.

Patch 9 consolidates the remaining revision-specific probe assignments
(mmio offset, bus ops, port ops, compute_params, port_offset_map) into
a single acp_rev switch, and removes the redundant early
initialisation of cols_index and rows_index since
acp_sdw_clk_init_ctrl() always sets them before set_frameshape() is
called.

Dependencies:

This series applies on top of the AMD SoundWire fix series posted at:
https://lore.kernel.org/alsa-devel/20260917083732.3803526-1-Vijendar.Mukunda@amd.com/T/#t

Vijendar Mukunda (9):
  soundwire: amd: rename AMD_SDW_MAX_MANAGER_COUNT macro
  soundwire: amd: allocate pdevinfo and sdw_pdata by ACP revision in
    probe
  soundwire: amd: allocate sdw_amd_ctx pdev array dynamically
  soundwire: amd: rename hardware backend functions to amd_acp63_*()
    prefix
  soundwire: amd: remove unused AMD_SDW_MAX_FREQ_NUM define
  soundwire: amd: introduce struct amd_sdw_hw_ops dispatch framework
  soundwire: amd: convert irq/work handlers to hw_ops callbacks
  soundwire: amd: wire amd_acp63_*() call sites through acp_*() helpers
  soundwire: amd: consolidate revision-specific probe setup

 drivers/soundwire/amd_init.c      |  49 +++-
 drivers/soundwire/amd_manager.c   | 471 ++++++++++++++++++------------
 drivers/soundwire/amd_manager.h   | 203 ++++++++++++-
 include/linux/soundwire/sdw_amd.h |   9 +-
 4 files changed, 533 insertions(+), 199 deletions(-)

-- 
2.48.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-10-05  6:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-17  9:02 [PATCH 0/9] soundwire: amd: introduce hw_ops dispatch and consolidate probe setup Vijendar Mukunda
2026-09-17  9:02 ` [PATCH 1/9] soundwire: amd: rename AMD_SDW_MAX_MANAGER_COUNT macro Vijendar Mukunda
2026-09-17  9:02 ` [PATCH 2/9] soundwire: amd: allocate pdevinfo and sdw_pdata by ACP revision in probe Vijendar Mukunda
2026-09-17  9:02 ` [PATCH 3/9] soundwire: amd: allocate sdw_amd_ctx pdev array dynamically Vijendar Mukunda
2026-10-03  7:52   ` Vinod Koul
2026-10-05  6:38     ` Mukunda,Vijendar
2026-09-17  9:02 ` [PATCH 4/9] soundwire: amd: rename hardware backend functions to amd_acp63_*() prefix Vijendar Mukunda
2026-09-17  9:02 ` [PATCH 5/9] soundwire: amd: remove unused AMD_SDW_MAX_FREQ_NUM define Vijendar Mukunda
2026-09-17  9:02 ` [PATCH 6/9] soundwire: amd: introduce struct amd_sdw_hw_ops dispatch framework Vijendar Mukunda
2026-10-03  7:56   ` Vinod Koul
2026-10-05  6:43     ` Mukunda,Vijendar
2026-09-17  9:02 ` [PATCH 7/9] soundwire: amd: convert irq/work handlers to hw_ops callbacks Vijendar Mukunda
2026-09-17  9:02 ` [PATCH 8/9] soundwire: amd: wire amd_acp63_*() call sites through acp_*() helpers Vijendar Mukunda
2026-09-17  9:02 ` [PATCH 9/9] soundwire: amd: consolidate revision-specific probe setup Vijendar Mukunda

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.