From 1543e317f1da31b75942316931e8f491a8920811 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Thu, 04 Jan 2024 10:08:02 +0000
Subject: [PATCH] disable FB
---
kernel/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c | 29 +++++++++++++++++------------
1 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/kernel/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c b/kernel/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
index 993f525..414d601 100644
--- a/kernel/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
+++ b/kernel/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
@@ -1,11 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-only
/*
* Designware HDMI CEC driver
*
* Copyright (C) 2015-2017 Russell King.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
*/
#include <linux/input.h>
#include <linux/interrupt.h>
@@ -17,6 +14,7 @@
#include <linux/slab.h>
#include <drm/drm_edid.h>
+#include <drm/bridge/dw_hdmi.h>
#include <media/cec.h>
#include <media/cec-notifier.h>
@@ -397,7 +395,7 @@
.owner = THIS_MODULE,
};
-void dw_hdmi_hpd_wake_up(struct platform_device *pdev)
+static void dw_hdmi_cec_hpd_wake_up(struct platform_device *pdev)
{
struct dw_hdmi_cec *cec = platform_get_drvdata(pdev);
@@ -417,7 +415,10 @@
input_sync(cec->devinput);
mutex_unlock(&cec->wake_lock);
}
-EXPORT_SYMBOL_GPL(dw_hdmi_hpd_wake_up);
+
+static const struct dw_hdmi_cec_wake_ops cec_ops = {
+ .hpd_wake_up = dw_hdmi_cec_hpd_wake_up,
+};
static int dw_hdmi_cec_probe(struct platform_device *pdev)
{
@@ -453,11 +454,13 @@
dw_hdmi_write(cec, 0, HDMI_CEC_POLARITY);
cec->adap = cec_allocate_adapter(&dw_hdmi_cec_ops, cec, "dw_hdmi",
- CEC_CAP_LOG_ADDRS | CEC_CAP_TRANSMIT |
- CEC_CAP_RC | CEC_CAP_PASSTHROUGH,
+ CEC_CAP_DEFAULTS |
+ CEC_CAP_CONNECTOR_INFO,
CEC_MAX_LOG_ADDRS);
if (IS_ERR(cec->adap))
return PTR_ERR(cec->adap);
+
+ dw_hdmi_set_cec_adap(cec->hdmi, cec->adap);
/* override the module pointer */
cec->adap->owner = THIS_MODULE;
@@ -491,13 +494,14 @@
enable_irq_wake(cec->wake_irq);
}
- cec->notify = cec_notifier_get(pdev->dev.parent);
+ cec->notify = cec_notifier_cec_adap_register(pdev->dev.parent,
+ NULL, cec->adap);
if (!cec->notify)
return -ENOMEM;
ret = cec_register_adapter(cec->adap, pdev->dev.parent);
if (ret < 0) {
- cec_notifier_put(cec->notify);
+ cec_notifier_cec_adap_unregister(cec->notify, cec->adap);
return ret;
}
@@ -507,7 +511,6 @@
*/
devm_remove_action(&pdev->dev, dw_hdmi_cec_del, cec);
- cec_register_cec_notifier(cec->adap, cec->notify);
rockchip_hdmi_cec_input_init(cec);
cec->misc_dev.name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "rk_cec");
@@ -519,6 +522,8 @@
ret = misc_register(&cec->misc_dev);
+ dw_hdmi_cec_wake_ops_register(cec->hdmi, &cec_ops);
+
return ret;
}
@@ -526,8 +531,8 @@
{
struct dw_hdmi_cec *cec = platform_get_drvdata(pdev);
+ cec_notifier_cec_adap_unregister(cec->notify, cec->adap);
cec_unregister_adapter(cec->adap);
- cec_notifier_put(cec->notify);
misc_deregister(&cec->misc_dev);
return 0;
--
Gitblit v1.6.2