[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260130055508.3462700-1-shengjiu.wang@nxp.com>
Date: Fri, 30 Jan 2026 13:55:08 +0800
From: Shengjiu Wang <shengjiu.wang@....com>
To: victor.liu@....com,
andrzej.hajda@...el.com,
neil.armstrong@...aro.org,
rfoss@...nel.org,
Laurent.pinchart@...asonboard.com,
jonas@...boo.se,
jernej.skrabec@...il.com,
maarten.lankhorst@...ux.intel.com,
mripard@...nel.org,
tzimmermann@...e.de,
airlied@...il.com,
simona@...ll.ch,
shawnguo@...nel.org,
s.hauer@...gutronix.de,
kernel@...gutronix.de,
festevam@...il.com,
dri-devel@...ts.freedesktop.org,
imx@...ts.linux.dev,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] drm/bridge: imx: imx8mp-hdmi-pai: enable pm runtime
There is an audio channel shift issue with multi channel case, first run
the channel order is correct, but second run the channel order is shifted.
The recovery method is to reset the pai interface.
The reset can be handled by pm runtime, so add the pm runtime function.
Signed-off-by: Shengjiu Wang <shengjiu.wang@....com>
---
drivers/gpu/drm/bridge/imx/imx8mp-hdmi-pai.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-pai.c b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-pai.c
index 8d13a35b206a..1afc729da9b9 100644
--- a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-pai.c
+++ b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-pai.c
@@ -8,6 +8,7 @@
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <drm/bridge/dw_hdmi.h>
#include <sound/asoundef.h>
@@ -33,6 +34,7 @@
struct imx8mp_hdmi_pai {
struct regmap *regmap;
+ struct device *dev;
};
static void imx8mp_hdmi_pai_enable(struct dw_hdmi *dw_hdmi, int channel,
@@ -43,6 +45,9 @@ static void imx8mp_hdmi_pai_enable(struct dw_hdmi *dw_hdmi, int channel,
struct imx8mp_hdmi_pai *hdmi_pai = pdata->priv_audio;
int val;
+ if (pm_runtime_get_sync(hdmi_pai->dev) < 0)
+ return;
+
/* PAI set control extended */
val = WTMK_HIGH(3) | WTMK_LOW(3);
val |= NUM_CH(channel);
@@ -85,6 +90,8 @@ static void imx8mp_hdmi_pai_disable(struct dw_hdmi *dw_hdmi)
/* Stop PAI */
regmap_write(hdmi_pai->regmap, HTX_PAI_CTRL, 0);
+
+ pm_runtime_put_sync(hdmi_pai->dev);
}
static const struct regmap_config imx8mp_hdmi_pai_regmap_config = {
@@ -101,6 +108,7 @@ static int imx8mp_hdmi_pai_bind(struct device *dev, struct device *master, void
struct imx8mp_hdmi_pai *hdmi_pai;
struct resource *res;
void __iomem *base;
+ int ret;
hdmi_pai = devm_kzalloc(dev, sizeof(*hdmi_pai), GFP_KERNEL);
if (!hdmi_pai)
@@ -121,6 +129,13 @@ static int imx8mp_hdmi_pai_bind(struct device *dev, struct device *master, void
plat_data->disable_audio = imx8mp_hdmi_pai_disable;
plat_data->priv_audio = hdmi_pai;
+ hdmi_pai->dev = dev;
+ ret = devm_pm_runtime_enable(dev);
+ if (ret < 0) {
+ dev_err(dev, "failed to enable pm runtime: %d\n", ret);
+ return ret;
+ }
+
return 0;
}
--
2.34.1
Powered by blists - more mailing lists