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/analogix/analogix-i2c-dptx.c | 40 ++++++++++++++++++----------------------
1 files changed, 18 insertions(+), 22 deletions(-)
diff --git a/kernel/drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.c b/kernel/drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.c
index 53b0e73..fe40bab 100644
--- a/kernel/drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.c
+++ b/kernel/drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.c
@@ -1,29 +1,27 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0-only */
/*
- * Copyright(c) 2017 Icenowy Zheng <icenowy@aosc.io>
+ * Copyright(c) 2016, Analogix Semiconductor.
*
- * Based on analogix-anx78xx.c, which is:
- * Copyright(c) 2016, Analogix Semiconductor. All rights reserved.
+ * Based on anx7808 driver obtained from chromeos with copyright:
+ * Copyright(c) 2013, Google Inc.
*/
-
-#include <linux/module.h>
#include <linux/regmap.h>
#include <drm/drm.h>
-#include <drm/drmP.h>
#include <drm/drm_dp_helper.h>
+#include <drm/drm_print.h>
#include "analogix-i2c-dptx.h"
#define AUX_WAIT_TIMEOUT_MS 15
#define AUX_CH_BUFFER_SIZE 16
-static int anx_clear_bits(struct regmap *map, u8 reg, u8 mask)
+static int anx_i2c_dp_clear_bits(struct regmap *map, u8 reg, u8 mask)
{
return regmap_update_bits(map, reg, mask, 0);
}
-static bool anx_aux_op_finished(struct regmap *map_dptx)
+static bool anx_dp_aux_op_finished(struct regmap *map_dptx)
{
unsigned int value;
int err;
@@ -35,7 +33,7 @@
return (value & SP_AUX_EN) == 0;
}
-static int anx_aux_wait(struct regmap *map_dptx)
+static int anx_dp_aux_wait(struct regmap *map_dptx)
{
unsigned long timeout;
unsigned int status;
@@ -43,9 +41,9 @@
timeout = jiffies + msecs_to_jiffies(AUX_WAIT_TIMEOUT_MS) + 1;
- while (!anx_aux_op_finished(map_dptx)) {
+ while (!anx_dp_aux_op_finished(map_dptx)) {
if (time_after(jiffies, timeout)) {
- if (!anx_aux_op_finished(map_dptx)) {
+ if (!anx_dp_aux_op_finished(map_dptx)) {
DRM_ERROR("Timed out waiting AUX to finish\n");
return -ETIMEDOUT;
}
@@ -72,7 +70,7 @@
return 0;
}
-static int anx_aux_address(struct regmap *map_dptx, unsigned int addr)
+static int anx_dp_aux_address(struct regmap *map_dptx, unsigned int addr)
{
int err;
@@ -100,7 +98,8 @@
return 0;
}
-ssize_t anx_aux_transfer(struct regmap *map_dptx, struct drm_dp_aux_msg *msg)
+ssize_t anx_dp_aux_transfer(struct regmap *map_dptx,
+ struct drm_dp_aux_msg *msg)
{
u8 ctrl1 = msg->request;
u8 ctrl2 = SP_AUX_EN;
@@ -127,7 +126,7 @@
}
/* Write address and request */
- err = anx_aux_address(map_dptx, msg->address);
+ err = anx_dp_aux_address(map_dptx, msg->address);
if (err)
return err;
@@ -141,7 +140,7 @@
if (err)
return err;
- err = anx_aux_wait(map_dptx);
+ err = anx_dp_aux_wait(map_dptx);
if (err)
return err;
@@ -156,14 +155,11 @@
return err;
}
- err = anx_clear_bits(map_dptx, SP_DP_AUX_CH_CTRL2_REG, SP_ADDR_ONLY);
+ err = anx_i2c_dp_clear_bits(map_dptx, SP_DP_AUX_CH_CTRL2_REG,
+ SP_ADDR_ONLY);
if (err)
return err;
return msg->size;
}
-EXPORT_SYMBOL(anx_aux_transfer);
-
-MODULE_DESCRIPTION("Analogix DisplayPort Transmitter common code");
-MODULE_AUTHOR("Icenowy Zheng <icenowy@aosc.io>");
-MODULE_LICENSE("GPL v2");
+EXPORT_SYMBOL_GPL(anx_dp_aux_transfer);
--
Gitblit v1.6.2