Skip to content

Commit

Permalink
drm/tegra: Add DSI support
Browse files Browse the repository at this point in the history
This commit adds support for both DSI outputs found on Tegra. Only very
minimal functionality is implemented, so advanced features like ganged
mode won't work.

Due to the lack of other test hardware, some sections of the driver are
hardcoded to work with Dalmore.

Signed-off-by: Thierry Reding <treding@nvidia.com>
  • Loading branch information
Thierry Reding committed Dec 20, 2013
1 parent b519002 commit dec7273
Show file tree
Hide file tree
Showing 11 changed files with 1,330 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,21 @@ of the following host1x client modules:
- clock-names: Must include the following entries:
- dsi
This MUST be the first entry.
- lp
- parent
- resets: Must contain an entry for each entry in reset-names.
See ../reset/reset.txt for details.
- reset-names: Must include the following entries:
- dsi
- nvidia,mipi-calibrate: Should contain a phandle and a specifier specifying
which pads are used by this DSI output and need to be calibrated. See also
../mipi/nvidia,tegra114-mipi.txt.

Optional properties:
- nvidia,ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing
- nvidia,hpd-gpio: specifies a GPIO used for hotplug detection
- nvidia,edid: supplies a binary EDID blob
- nvidia,panel: phandle of a display panel

Example:

Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/tegra/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ config DRM_TEGRA
select TEGRA_HOST1X
select DRM_KMS_HELPER
select DRM_KMS_FB_HELPER
select DRM_MIPI_DSI
select DRM_PANEL
select FB_SYS_FILLRECT
select FB_SYS_COPYAREA
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/tegra/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ tegra-drm-y := \
output.o \
rgb.o \
hdmi.o \
mipi-phy.o \
dsi.o \
gr2d.o \
gr3d.o

Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/tegra/dc.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#define DISP_CTRL_MODE_STOP (0 << 5)
#define DISP_CTRL_MODE_C_DISPLAY (1 << 5)
#define DISP_CTRL_MODE_NC_DISPLAY (2 << 5)
#define DISP_CTRL_MODE_MASK (3 << 5)
#define DC_CMD_SIGNAL_RAISE 0x033
#define DC_CMD_DISPLAY_POWER_CONTROL 0x036
#define PW0_ENABLE (1 << 0)
Expand Down Expand Up @@ -116,6 +117,7 @@

#define DC_DISP_DISP_WIN_OPTIONS 0x402
#define HDMI_ENABLE (1 << 30)
#define DSI_ENABLE (1 << 29)

#define DC_DISP_DISP_MEM_HIGH_PRIORITY 0x403
#define CURSOR_THRESHOLD(x) (((x) & 0x03) << 24)
Expand Down
10 changes: 9 additions & 1 deletion drivers/gpu/drm/tegra/drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ static const struct of_device_id host1x_drm_subdevs[] = {
{ .compatible = "nvidia,tegra30-hdmi", },
{ .compatible = "nvidia,tegra30-gr2d", },
{ .compatible = "nvidia,tegra30-gr3d", },
{ .compatible = "nvidia,tegra114-dsi", },
{ .compatible = "nvidia,tegra114-hdmi", },
{ .compatible = "nvidia,tegra114-gr3d", },
{ /* sentinel */ }
Expand All @@ -677,10 +678,14 @@ static int __init host1x_drm_init(void)
if (err < 0)
goto unregister_host1x;

err = platform_driver_register(&tegra_hdmi_driver);
err = platform_driver_register(&tegra_dsi_driver);
if (err < 0)
goto unregister_dc;

err = platform_driver_register(&tegra_hdmi_driver);
if (err < 0)
goto unregister_dsi;

err = platform_driver_register(&tegra_gr2d_driver);
if (err < 0)
goto unregister_hdmi;
Expand All @@ -695,6 +700,8 @@ static int __init host1x_drm_init(void)
platform_driver_unregister(&tegra_gr2d_driver);
unregister_hdmi:
platform_driver_unregister(&tegra_hdmi_driver);
unregister_dsi:
platform_driver_unregister(&tegra_dsi_driver);
unregister_dc:
platform_driver_unregister(&tegra_dc_driver);
unregister_host1x:
Expand All @@ -708,6 +715,7 @@ static void __exit host1x_drm_exit(void)
platform_driver_unregister(&tegra_gr3d_driver);
platform_driver_unregister(&tegra_gr2d_driver);
platform_driver_unregister(&tegra_hdmi_driver);
platform_driver_unregister(&tegra_dsi_driver);
platform_driver_unregister(&tegra_dc_driver);
host1x_driver_unregister(&host1x_drm_driver);
}
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/tegra/drm.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ struct tegra_output_ops {
enum tegra_output_type {
TEGRA_OUTPUT_RGB,
TEGRA_OUTPUT_HDMI,
TEGRA_OUTPUT_DSI,
};

struct tegra_output {
Expand Down Expand Up @@ -267,6 +268,7 @@ extern void tegra_drm_fb_exit(struct drm_device *drm);
extern void tegra_fbdev_restore_mode(struct tegra_fbdev *fbdev);

extern struct platform_driver tegra_dc_driver;
extern struct platform_driver tegra_dsi_driver;
extern struct platform_driver tegra_hdmi_driver;
extern struct platform_driver tegra_gr2d_driver;
extern struct platform_driver tegra_gr3d_driver;
Expand Down
Loading

0 comments on commit dec7273

Please sign in to comment.