diff options
author | Archit Taneja <archit@ti.com> | 2014-05-06 07:37:39 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2014-11-12 06:40:10 -0500 |
commit | f7e38fe9e23c6311a96510d00c75c73fcf5d1e42 (patch) | |
tree | 7fafdf98f27fe784160c13d790eec661867887b5 /drivers/video | |
parent | ef691ff48bc838e9fca54b58dccac0a7c36a3130 (diff) |
OMAPDSS: DPI: Add support for multiple instances
Register DPI outputs, and assign the port_num to them as specified by the
'reg' property in the DPI ports in DT.
To support multiple DPI instances, dpi_get_channel needs to take the DPI
instance's port number to get the corresponding channel. Make it take this
argument. We just pass 0 in the non-DT path, since we don't support multiple
instances in the non-DT case.
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fbdev/omap2/dss/dpi.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c index 224d7885eeeb..03376354b360 100644 --- a/drivers/video/fbdev/omap2/dss/dpi.c +++ b/drivers/video/fbdev/omap2/dss/dpi.c | |||
@@ -616,7 +616,7 @@ static void dpi_init_pll(struct dpi_data *dpi) | |||
616 | * the channel in some more dynamic manner, or get the channel as a user | 616 | * the channel in some more dynamic manner, or get the channel as a user |
617 | * parameter. | 617 | * parameter. |
618 | */ | 618 | */ |
619 | static enum omap_channel dpi_get_channel(void) | 619 | static enum omap_channel dpi_get_channel(int port_num) |
620 | { | 620 | { |
621 | switch (omapdss_get_version()) { | 621 | switch (omapdss_get_version()) { |
622 | case OMAPDSS_VER_OMAP24xx: | 622 | case OMAPDSS_VER_OMAP24xx: |
@@ -710,7 +710,7 @@ static void dpi_init_output(struct platform_device *pdev) | |||
710 | out->id = OMAP_DSS_OUTPUT_DPI; | 710 | out->id = OMAP_DSS_OUTPUT_DPI; |
711 | out->output_type = OMAP_DISPLAY_TYPE_DPI; | 711 | out->output_type = OMAP_DISPLAY_TYPE_DPI; |
712 | out->name = "dpi.0"; | 712 | out->name = "dpi.0"; |
713 | out->dispc_channel = dpi_get_channel(); | 713 | out->dispc_channel = dpi_get_channel(0); |
714 | out->ops.dpi = &dpi_ops; | 714 | out->ops.dpi = &dpi_ops; |
715 | out->owner = THIS_MODULE; | 715 | out->owner = THIS_MODULE; |
716 | 716 | ||
@@ -730,11 +730,31 @@ static void dpi_init_output_port(struct platform_device *pdev, | |||
730 | { | 730 | { |
731 | struct dpi_data *dpi = port->data; | 731 | struct dpi_data *dpi = port->data; |
732 | struct omap_dss_device *out = &dpi->output; | 732 | struct omap_dss_device *out = &dpi->output; |
733 | int r; | ||
734 | u32 port_num; | ||
735 | |||
736 | r = of_property_read_u32(port, "reg", &port_num); | ||
737 | if (r) | ||
738 | port_num = 0; | ||
739 | |||
740 | switch (port_num) { | ||
741 | case 2: | ||
742 | out->name = "dpi.2"; | ||
743 | break; | ||
744 | case 1: | ||
745 | out->name = "dpi.1"; | ||
746 | break; | ||
747 | case 0: | ||
748 | default: | ||
749 | out->name = "dpi.0"; | ||
750 | break; | ||
751 | } | ||
733 | 752 | ||
734 | out->dev = &pdev->dev; | 753 | out->dev = &pdev->dev; |
735 | out->id = OMAP_DSS_OUTPUT_DPI; | 754 | out->id = OMAP_DSS_OUTPUT_DPI; |
736 | out->output_type = OMAP_DISPLAY_TYPE_DPI; | 755 | out->output_type = OMAP_DISPLAY_TYPE_DPI; |
737 | out->dispc_channel = dpi_get_channel(); | 756 | out->dispc_channel = dpi_get_channel(port_num); |
757 | out->port_num = port_num; | ||
738 | out->ops.dpi = &dpi_ops; | 758 | out->ops.dpi = &dpi_ops; |
739 | out->owner = THIS_MODULE; | 759 | out->owner = THIS_MODULE; |
740 | 760 | ||