.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Analog Devices ADV7511 HDMI transmitter driver |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright 2012 Analog Devices Inc. |
---|
5 | | - * |
---|
6 | | - * Licensed under the GPL-2. |
---|
7 | 6 | */ |
---|
8 | 7 | |
---|
9 | 8 | #ifndef __DRM_I2C_ADV7511_H__ |
---|
.. | .. |
---|
14 | 13 | #include <linux/regmap.h> |
---|
15 | 14 | #include <linux/regulator/consumer.h> |
---|
16 | 15 | |
---|
17 | | -#include <drm/drm_crtc_helper.h> |
---|
| 16 | +#include <drm/drm_bridge.h> |
---|
| 17 | +#include <drm/drm_connector.h> |
---|
18 | 18 | #include <drm/drm_mipi_dsi.h> |
---|
| 19 | +#include <drm/drm_modes.h> |
---|
19 | 20 | |
---|
20 | 21 | #define ADV7511_REG_CHIP_REVISION 0x00 |
---|
21 | 22 | #define ADV7511_REG_N0 0x01 |
---|
.. | .. |
---|
168 | 169 | #define ADV7511_PACKET_ENABLE_SPARE2 BIT(1) |
---|
169 | 170 | #define ADV7511_PACKET_ENABLE_SPARE1 BIT(0) |
---|
170 | 171 | |
---|
| 172 | +#define ADV7535_REG_POWER2_HPD_OVERRIDE BIT(6) |
---|
171 | 173 | #define ADV7511_REG_POWER2_HPD_SRC_MASK 0xc0 |
---|
172 | 174 | #define ADV7511_REG_POWER2_HPD_SRC_BOTH 0x00 |
---|
173 | 175 | #define ADV7511_REG_POWER2_HPD_SRC_HPD 0x40 |
---|
.. | .. |
---|
319 | 321 | enum adv7511_type { |
---|
320 | 322 | ADV7511, |
---|
321 | 323 | ADV7533, |
---|
| 324 | + ADV7535, |
---|
322 | 325 | }; |
---|
323 | 326 | |
---|
324 | 327 | #define ADV7511_MAX_ADDRS 3 |
---|
.. | .. |
---|
383 | 386 | #else |
---|
384 | 387 | static inline int adv7511_cec_init(struct device *dev, struct adv7511 *adv7511) |
---|
385 | 388 | { |
---|
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, |
---|
390 | 390 | ADV7511_CEC_CTRL_POWER_DOWN); |
---|
391 | 391 | return 0; |
---|
392 | 392 | } |
---|
393 | 393 | #endif |
---|
394 | 394 | |
---|
395 | | -#ifdef CONFIG_DRM_I2C_ADV7533 |
---|
396 | 395 | void adv7533_dsi_power_on(struct adv7511 *adv); |
---|
397 | 396 | 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); |
---|
399 | 398 | int adv7533_patch_registers(struct adv7511 *adv); |
---|
400 | 399 | int adv7533_patch_cec_registers(struct adv7511 *adv); |
---|
401 | 400 | int adv7533_attach_dsi(struct adv7511 *adv); |
---|
402 | 401 | void adv7533_detach_dsi(struct adv7511 *adv); |
---|
403 | 402 | 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 |
---|
442 | 403 | |
---|
443 | 404 | #ifdef CONFIG_DRM_I2C_ADV7511_AUDIO |
---|
444 | 405 | int adv7511_audio_init(struct device *dev, struct adv7511 *adv7511); |
---|