mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
drm/panel: Add and initialise an orientation field to drm_panel from OF
"rotation" is listed as a standard property of panels in panel-common.yaml, therefore it would be logical to process that from within the core code should a panel driver not implement the get_orientation hook. Call of_drm_get_panel_orientation from drm_connector_set_orientation_from_panel to get that information. This removes the need for any boiler-plate in panel drivers for calling drm_connector_set_orientation_from_panel or drm_connector_set_panel_orientation. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
This commit is contained in:
committed by
Dom Cobley
parent
8f09fd6570
commit
56abeaa3b7
@@ -3073,10 +3073,15 @@ int drm_connector_set_orientation_from_panel(
|
||||
{
|
||||
enum drm_panel_orientation orientation;
|
||||
|
||||
if (panel && panel->funcs && panel->funcs->get_orientation)
|
||||
if (panel && panel->funcs && panel->funcs->get_orientation) {
|
||||
orientation = panel->funcs->get_orientation(panel);
|
||||
else
|
||||
} else {
|
||||
orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
|
||||
if (panel) {
|
||||
of_drm_get_panel_orientation(panel->dev->of_node,
|
||||
&orientation);
|
||||
}
|
||||
}
|
||||
|
||||
return drm_connector_set_panel_orientation(connector, orientation);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user