forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/gpu/drm/i2c/tda9950.c
....@@ -1,9 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * TDA9950 Consumer Electronics Control driver
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
74 *
85 * The NXP TDA9950 implements the HDMI Consumer Electronics Control
96 * interface. The host interface is similar to a mailbox: the data
....@@ -423,7 +420,8 @@
423420 priv->hdmi = glue->parent;
424421
425422 priv->adap = cec_allocate_adapter(&tda9950_cec_ops, priv, "tda9950",
426
- CEC_CAP_DEFAULTS,
423
+ CEC_CAP_DEFAULTS |
424
+ CEC_CAP_CONNECTOR_INFO,
427425 CEC_MAX_LOG_ADDRS);
428426 if (IS_ERR(priv->adap))
429427 return PTR_ERR(priv->adap);
....@@ -460,13 +458,14 @@
460458 if (ret < 0)
461459 return ret;
462460
463
- priv->notify = cec_notifier_get(priv->hdmi);
461
+ priv->notify = cec_notifier_cec_adap_register(priv->hdmi, NULL,
462
+ priv->adap);
464463 if (!priv->notify)
465464 return -ENOMEM;
466465
467466 ret = cec_register_adapter(priv->adap, priv->hdmi);
468467 if (ret < 0) {
469
- cec_notifier_put(priv->notify);
468
+ cec_notifier_cec_adap_unregister(priv->notify, priv->adap);
470469 return ret;
471470 }
472471
....@@ -476,8 +475,6 @@
476475 */
477476 devm_remove_action(dev, tda9950_cec_del, priv);
478477
479
- cec_register_cec_notifier(priv->adap, priv->notify);
480
-
481478 return 0;
482479 }
483480
....@@ -485,8 +482,8 @@
485482 {
486483 struct tda9950_priv *priv = i2c_get_clientdata(client);
487484
485
+ cec_notifier_cec_adap_unregister(priv->notify, priv->adap);
488486 cec_unregister_adapter(priv->adap);
489
- cec_notifier_put(priv->notify);
490487
491488 return 0;
492489 }