hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/gpu/drm/bridge/adv7511/adv7511.h
....@@ -1,9 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Analog Devices ADV7511 HDMI transmitter driver
34 *
45 * Copyright 2012 Analog Devices Inc.
5
- *
6
- * Licensed under the GPL-2.
76 */
87
98 #ifndef __DRM_I2C_ADV7511_H__
....@@ -14,8 +13,10 @@
1413 #include <linux/regmap.h>
1514 #include <linux/regulator/consumer.h>
1615
17
-#include <drm/drm_crtc_helper.h>
16
+#include <drm/drm_bridge.h>
17
+#include <drm/drm_connector.h>
1818 #include <drm/drm_mipi_dsi.h>
19
+#include <drm/drm_modes.h>
1920
2021 #define ADV7511_REG_CHIP_REVISION 0x00
2122 #define ADV7511_REG_N0 0x01
....@@ -168,6 +169,7 @@
168169 #define ADV7511_PACKET_ENABLE_SPARE2 BIT(1)
169170 #define ADV7511_PACKET_ENABLE_SPARE1 BIT(0)
170171
172
+#define ADV7535_REG_POWER2_HPD_OVERRIDE BIT(6)
171173 #define ADV7511_REG_POWER2_HPD_SRC_MASK 0xc0
172174 #define ADV7511_REG_POWER2_HPD_SRC_BOTH 0x00
173175 #define ADV7511_REG_POWER2_HPD_SRC_HPD 0x40
....@@ -319,6 +321,7 @@
319321 enum adv7511_type {
320322 ADV7511,
321323 ADV7533,
324
+ ADV7535,
322325 };
323326
324327 #define ADV7511_MAX_ADDRS 3
....@@ -383,62 +386,20 @@
383386 #else
384387 static inline int adv7511_cec_init(struct device *dev, struct adv7511 *adv7511)
385388 {
386
- unsigned int offset = adv7511->type == ADV7533 ?
387
- ADV7533_REG_CEC_OFFSET : 0;
388
-
389
- regmap_write(adv7511->regmap, ADV7511_REG_CEC_CTRL + offset,
389
+ regmap_write(adv7511->regmap, ADV7511_REG_CEC_CTRL,
390390 ADV7511_CEC_CTRL_POWER_DOWN);
391391 return 0;
392392 }
393393 #endif
394394
395
-#ifdef CONFIG_DRM_I2C_ADV7533
396395 void adv7533_dsi_power_on(struct adv7511 *adv);
397396 void adv7533_dsi_power_off(struct adv7511 *adv);
398
-void adv7533_mode_set(struct adv7511 *adv, struct drm_display_mode *mode);
397
+void adv7533_mode_set(struct adv7511 *adv, const struct drm_display_mode *mode);
399398 int adv7533_patch_registers(struct adv7511 *adv);
400399 int adv7533_patch_cec_registers(struct adv7511 *adv);
401400 int adv7533_attach_dsi(struct adv7511 *adv);
402401 void adv7533_detach_dsi(struct adv7511 *adv);
403402 int adv7533_parse_dt(struct device_node *np, struct adv7511 *adv);
404
-#else
405
-static inline void adv7533_dsi_power_on(struct adv7511 *adv)
406
-{
407
-}
408
-
409
-static inline void adv7533_dsi_power_off(struct adv7511 *adv)
410
-{
411
-}
412
-
413
-static inline void adv7533_mode_set(struct adv7511 *adv,
414
- struct drm_display_mode *mode)
415
-{
416
-}
417
-
418
-static inline int adv7533_patch_registers(struct adv7511 *adv)
419
-{
420
- return -ENODEV;
421
-}
422
-
423
-static inline int adv7533_patch_cec_registers(struct adv7511 *adv)
424
-{
425
- return -ENODEV;
426
-}
427
-
428
-static inline int adv7533_attach_dsi(struct adv7511 *adv)
429
-{
430
- return -ENODEV;
431
-}
432
-
433
-static inline void adv7533_detach_dsi(struct adv7511 *adv)
434
-{
435
-}
436
-
437
-static inline int adv7533_parse_dt(struct device_node *np, struct adv7511 *adv)
438
-{
439
- return -ENODEV;
440
-}
441
-#endif
442403
443404 #ifdef CONFIG_DRM_I2C_ADV7511_AUDIO
444405 int adv7511_audio_init(struct device *dev, struct adv7511 *adv7511);