public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] remoteproc: imx_proc: Simplify driver by removing the switch-case
@ 2025-09-10  7:11 Peng Fan
  2025-09-10  7:11 ` [PATCH v2 1/6] remoteproc: imx_rproc: Introduce start/stop/detect_mode ops for imx_rproc_dcfg Peng Fan
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Peng Fan @ 2025-09-10  7:11 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Daniel Baluta, Frank Li
  Cc: Hiago De Franco, linux-remoteproc, imx, linux-arm-kernel,
	linux-kernel, Peng Fan, Frank Li

This patchset serves as a preparing patchset for i.MX95 support.

The current code logic is complicated, with mix the usage of switch-case
and if-else.

To simplify the code logic:
 Introduce struct imx_rproc_plat_ops to wrap platform start,stop,detect_mode.
 Each imx_rproc_dcfg data structure is assigned a ops pointer.
 The common imx_rproc_{start,stop}() directly invokes the plat ops, no
 need the switch-case.
 mmio/smc/scu_api ops are included.
 No functional changes.

Thanks to Daniel and Frank for the help.

Test on i.MX8MM for MMIO ops, i.MX8MP for SMC ops, i.MX8QM for SCU-API ops.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
Changes in v2:
- Simplify the if/else in patch 6 per Frank and Mathieu
- Add R-b from Daniel and Frank.
- Link to v1: https://lore.kernel.org/r/20250908-imx-rproc-cleanup-v1-0-e838cb14436c@nxp.com

---
Peng Fan (6):
      remoteproc: imx_rproc: Introduce start/stop/detect_mode ops for imx_rproc_dcfg
      remoteproc: imx_rproc: Move imx_rproc_dcfg closer to imx_rproc_of_match
      remoteproc: imx_rproc: Simplify IMX_RPROC_MMIO switch case
      remoteproc: imx_rproc: Simplify IMX_RPROC_SCU_API switch case
      remoteproc: imx_rproc: Simplify IMX_RPROC_SMC switch case
      remoteproc: imx_rproc: Clean up after ops introduction

 drivers/remoteproc/imx_rproc.c | 449 +++++++++++++++++++++++------------------
 drivers/remoteproc/imx_rproc.h |   7 +
 2 files changed, 265 insertions(+), 191 deletions(-)
---
base-commit: 3e8e5822146bc396d2a7e5fbb7be13271665522a
change-id: 20250908-imx-rproc-cleanup-6f3b546b9fdf

Best regards,
-- 
Peng Fan <peng.fan@nxp.com>



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

end of thread, other threads:[~2025-09-15 16:27 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-10  7:11 [PATCH v2 0/6] remoteproc: imx_proc: Simplify driver by removing the switch-case Peng Fan
2025-09-10  7:11 ` [PATCH v2 1/6] remoteproc: imx_rproc: Introduce start/stop/detect_mode ops for imx_rproc_dcfg Peng Fan
2025-09-10  7:11 ` [PATCH v2 2/6] remoteproc: imx_rproc: Move imx_rproc_dcfg closer to imx_rproc_of_match Peng Fan
2025-09-10  7:11 ` [PATCH v2 3/6] remoteproc: imx_rproc: Simplify IMX_RPROC_MMIO switch case Peng Fan
2025-09-10  7:11 ` [PATCH v2 4/6] remoteproc: imx_rproc: Simplify IMX_RPROC_SCU_API " Peng Fan
2025-09-10  7:11 ` [PATCH v2 5/6] remoteproc: imx_rproc: Simplify IMX_RPROC_SMC " Peng Fan
2025-09-10  7:11 ` [PATCH v2 6/6] remoteproc: imx_rproc: Clean up after ops introduction Peng Fan
2025-09-10 15:53   ` Frank Li
2025-09-11  1:13     ` Peng Fan
2025-09-12  6:11       ` Peng Fan
2025-09-12  8:58         ` Daniel Baluta
2025-09-12 14:14         ` Mathieu Poirier
2025-09-12 14:37         ` Frank Li
2025-09-15 16:27 ` [PATCH v2 0/6] remoteproc: imx_proc: Simplify driver by removing the switch-case Mathieu Poirier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox