| .. | .. |
|---|
| 11 | 11 | #include <linux/regmap.h> |
|---|
| 12 | 12 | #include <linux/mfd/rk618.h> |
|---|
| 13 | 13 | |
|---|
| 14 | | -#include <drm/drmP.h> |
|---|
| 14 | +#include <drm/drm_drv.h> |
|---|
| 15 | 15 | #include <drm/drm_of.h> |
|---|
| 16 | 16 | #include <drm/drm_atomic.h> |
|---|
| 17 | 17 | #include <drm/drm_crtc_helper.h> |
|---|
| 18 | 18 | #include <drm/drm_atomic_helper.h> |
|---|
| 19 | 19 | #include <drm/drm_mipi_dsi.h> |
|---|
| 20 | 20 | #include <drm/drm_panel.h> |
|---|
| 21 | +#include <drm/drm_probe_helper.h> |
|---|
| 21 | 22 | |
|---|
| 22 | 23 | #include <video/of_display_timing.h> |
|---|
| 23 | 24 | #include <video/mipi_display.h> |
|---|
| .. | .. |
|---|
| 736 | 737 | { |
|---|
| 737 | 738 | struct rk618_dsi *dsi = connector_to_dsi(connector); |
|---|
| 738 | 739 | |
|---|
| 739 | | - return drm_panel_get_modes(dsi->panel); |
|---|
| 740 | + return drm_panel_get_modes(dsi->panel, connector); |
|---|
| 740 | 741 | } |
|---|
| 741 | 742 | |
|---|
| 742 | 743 | static const struct drm_connector_helper_funcs |
|---|
| .. | .. |
|---|
| 753 | 754 | |
|---|
| 754 | 755 | static void rk618_dsi_connector_destroy(struct drm_connector *connector) |
|---|
| 755 | 756 | { |
|---|
| 756 | | - struct rk618_dsi *dsi = connector_to_dsi(connector); |
|---|
| 757 | | - |
|---|
| 758 | | - drm_panel_detach(dsi->panel); |
|---|
| 759 | 757 | drm_connector_cleanup(connector); |
|---|
| 760 | 758 | } |
|---|
| 761 | 759 | |
|---|
| .. | .. |
|---|
| 793 | 791 | } |
|---|
| 794 | 792 | |
|---|
| 795 | 793 | static void rk618_dsi_bridge_mode_set(struct drm_bridge *bridge, |
|---|
| 796 | | - struct drm_display_mode *mode, |
|---|
| 797 | | - struct drm_display_mode *adj) |
|---|
| 794 | + const struct drm_display_mode *mode, |
|---|
| 795 | + const struct drm_display_mode *adj) |
|---|
| 798 | 796 | { |
|---|
| 799 | 797 | struct rk618_dsi *dsi = bridge_to_dsi(bridge); |
|---|
| 800 | 798 | |
|---|
| .. | .. |
|---|
| 804 | 802 | drm_mode_copy(&dsi->mode, adj); |
|---|
| 805 | 803 | } |
|---|
| 806 | 804 | |
|---|
| 807 | | -static int rk618_dsi_bridge_attach(struct drm_bridge *bridge) |
|---|
| 805 | +static int rk618_dsi_bridge_attach(struct drm_bridge *bridge, |
|---|
| 806 | + enum drm_bridge_attach_flags flags) |
|---|
| 808 | 807 | { |
|---|
| 809 | 808 | struct rk618_dsi *dsi = bridge_to_dsi(bridge); |
|---|
| 810 | 809 | struct drm_connector *connector = &dsi->connector; |
|---|
| .. | .. |
|---|
| 821 | 820 | drm_connector_helper_add(connector, &rk618_dsi_connector_helper_funcs); |
|---|
| 822 | 821 | drm_connector_attach_encoder(connector, bridge->encoder); |
|---|
| 823 | 822 | |
|---|
| 824 | | - ret = drm_panel_attach(dsi->panel, connector); |
|---|
| 825 | | - if (ret) { |
|---|
| 826 | | - dev_err(dsi->dev, "Failed to attach panel\n"); |
|---|
| 827 | | - return ret; |
|---|
| 828 | | - } |
|---|
| 829 | 823 | dsi->sub_dev.connector = &dsi->connector; |
|---|
| 830 | 824 | dsi->sub_dev.of_node = dsi->dev->of_node; |
|---|
| 831 | 825 | rockchip_drm_register_sub_dev(&dsi->sub_dev); |
|---|