public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] OMAPDSS: Do not require a VDDS_DSI regulator on am35xx
@ 2012-08-15 19:16 Raphael Assenat
  2012-08-21 10:39 ` Tomi Valkeinen
  0 siblings, 1 reply; 5+ messages in thread
From: Raphael Assenat @ 2012-08-15 19:16 UTC (permalink / raw)
  To: linux-omap; +Cc: tomi.valkeinen

On our AM3505 based board, dpi.c complains that there is no VDSS_DSI regulator
and the framebuffer cannot be enabled. However, this check does not seem to
apply to AM3505/17 chips.

Taking into account comments received after my first patch[1], I have added
entries to dss_features.c to support the am35xx soc. Then in dpi.c, instead
of using cpu_is_omap34xx() and soc_is_am35xx(), a call to dss_has_feature()
is used.

[1] http://marc.info/?l=linux-fbdev&m=134272967203409&w=2

Signed-off-by: Raphaël Assénat <raph@8d.com>

diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index 3266be2..0e83054 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -31,9 +31,9 @@
 #include <linux/regulator/consumer.h>
 
 #include <video/omapdss.h>
-#include <plat/cpu.h>
 
 #include "dss.h"
+#include "dss_features.h"
 
 static struct {
 	struct regulator *vdds_dsi_reg;
@@ -169,11 +169,6 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
 {
 	int r;
 
-	if (cpu_is_omap34xx() && !dpi.vdds_dsi_reg) {
-		DSSERR("no VDSS_DSI regulator\n");
-		return -ENODEV;
-	}
-
 	if (dssdev->manager == NULL) {
 		DSSERR("failed to enable display: no manager\n");
 		return -ENODEV;
@@ -185,7 +180,7 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
 		goto err_start_dev;
 	}
 
-	if (cpu_is_omap34xx()) {
+	if (dpi.vdds_dsi_reg) {
 		r = regulator_enable(dpi.vdds_dsi_reg);
 		if (r)
 			goto err_reg_enable;
@@ -229,7 +224,7 @@ err_dsi_pll_init:
 err_get_dsi:
 	dispc_runtime_put();
 err_get_dispc:
-	if (cpu_is_omap34xx())
+	if (dpi.vdds_dsi_reg)
 		regulator_disable(dpi.vdds_dsi_reg);
 err_reg_enable:
 	omap_dss_stop_device(dssdev);
@@ -250,7 +245,7 @@ void omapdss_dpi_display_disable(struct omap_dss_device *dssdev)
 
 	dispc_runtime_put();
 
-	if (cpu_is_omap34xx())
+	if (dpi.vdds_dsi_reg)
 		regulator_disable(dpi.vdds_dsi_reg);
 
 	omap_dss_stop_device(dssdev);
@@ -329,7 +324,7 @@ static int __init dpi_init_display(struct omap_dss_device *dssdev)
 {
 	DSSDBG("init_display\n");
 
-	if (cpu_is_omap34xx() && dpi.vdds_dsi_reg == NULL) {
+	if (dss_has_feature(FEAT_VDDS_DSI) && dpi.vdds_dsi_reg == NULL) {
 		struct regulator *vdds_dsi;
 
 		vdds_dsi = dss_get_vdds_dsi();
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 9387097..6d4b6c5 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -373,6 +373,26 @@ static const enum dss_feat_id omap3430_dss_feat_list[] = {
 	FEAT_ALPHA_FIXED_ZORDER,
 	FEAT_FIFO_MERGE,
 	FEAT_OMAP3_DSI_FIFO_BUG,
+	FEAT_VDDS_DSI,
+};
+
+static const enum dss_feat_id am35xx_dss_feat_list[] = {
+	FEAT_LCDENABLEPOL,
+	FEAT_LCDENABLESIGNAL,
+	FEAT_PCKFREEENABLE,
+	FEAT_FUNCGATED,
+	FEAT_LINEBUFFERSPLIT,
+	FEAT_ROWREPEATENABLE,
+	FEAT_RESIZECONF,
+	FEAT_DSI_PLL_FREQSEL,
+	FEAT_DSI_REVERSE_TXCLKESC,
+	FEAT_VENC_REQUIRES_TV_DAC_CLK,
+	FEAT_CPR,
+	FEAT_PRELOAD,
+	FEAT_FIR_COEF_V,
+	FEAT_ALPHA_FIXED_ZORDER,
+	FEAT_FIFO_MERGE,
+	FEAT_OMAP3_DSI_FIFO_BUG,
 };
 
 static const enum dss_feat_id omap3630_dss_feat_list[] = {
@@ -487,6 +507,27 @@ static const struct omap_dss_features omap3430_dss_features = {
 	.burst_size_unit = 8,
 };
 
+/* AM35xx DSS Features. This is basically OMAP3 DSS Features without
+   the vdds_dsi regulator. */
+static const struct omap_dss_features am35xx_dss_features = {
+	.reg_fields = omap3_dss_reg_fields,
+	.num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
+
+	.features = am35xx_dss_feat_list,
+	.num_features = ARRAY_SIZE(am35xx_dss_feat_list),
+
+	.num_mgrs = 2,
+	.num_ovls = 3,
+	.supported_displays = omap3430_dss_supported_displays,
+	.supported_color_modes = omap3_dss_supported_color_modes,
+	.overlay_caps = omap3430_dss_overlay_caps,
+	.clksrc_names = omap3_dss_clk_source_names,
+	.dss_params = omap3_dss_param_range,
+	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_VRFB,
+	.buffer_size_unit = 1,
+	.burst_size_unit = 8,
+};
+
 static const struct omap_dss_features omap3630_dss_features = {
 	.reg_fields = omap3_dss_reg_fields,
 	.num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
@@ -694,8 +735,12 @@ void dss_features_init(void)
 		omap_current_dss_features = &omap2_dss_features;
 	else if (cpu_is_omap3630())
 		omap_current_dss_features = &omap3630_dss_features;
-	else if (cpu_is_omap34xx())
-		omap_current_dss_features = &omap3430_dss_features;
+	else if (cpu_is_omap34xx()) {
+		if (soc_is_am35xx())
+			omap_current_dss_features = &am35xx_dss_features;
+		else
+			omap_current_dss_features = &omap3430_dss_features;
+	}
 	else if (omap_rev() == OMAP4430_REV_ES1_0)
 		omap_current_dss_features = &omap4430_es1_0_dss_features;
 	else if (omap_rev() == OMAP4430_REV_ES2_0 ||
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index 996ffcb..8a68ebf 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -64,6 +64,7 @@ enum dss_feat_id {
 	/* An unknown HW bug causing the normal FIFO thresholds not to work */
 	FEAT_OMAP3_DSI_FIFO_BUG,
 	FEAT_BURST_2D,
+	FEAT_VDDS_DSI,
 };
 
 /* DSS register field id */
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] OMAPDSS: Do not require a VDDS_DSI regulator on am35xx
  2012-08-15 19:16 [PATCH v2] OMAPDSS: Do not require a VDDS_DSI regulator on am35xx Raphael Assenat
@ 2012-08-21 10:39 ` Tomi Valkeinen
  2012-09-19  7:49   ` Tomi Valkeinen
  2012-09-19 19:53   ` Raphaël Assénat
  0 siblings, 2 replies; 5+ messages in thread
From: Tomi Valkeinen @ 2012-08-21 10:39 UTC (permalink / raw)
  To: Raphael Assenat; +Cc: linux-omap

[-- Attachment #1: Type: text/plain, Size: 932 bytes --]

Hi,

On Wed, 2012-08-15 at 15:16 -0400, Raphael Assenat wrote:
> On our AM3505 based board, dpi.c complains that there is no VDSS_DSI regulator
> and the framebuffer cannot be enabled. However, this check does not seem to
> apply to AM3505/17 chips.
> 
> Taking into account comments received after my first patch[1], I have added
> entries to dss_features.c to support the am35xx soc. Then in dpi.c, instead
> of using cpu_is_omap34xx() and soc_is_am35xx(), a call to dss_has_feature()
> is used.
> 
> [1] http://marc.info/?l=linux-fbdev&m=134272967203409&w=2
> 
> Signed-off-by: Raphaël Assénat <raph@8d.com>

Chandrabhanu has posted a series that removes a bunch of cpu_is checks
from omapdss. On of them is the use of VDDS_DSI in dpi.c.

Can you wait until I've merged those patches to omapdss master branch
(probably a few days), and then create a new patch that adds AM35xx to
dss_features?

 Tomi


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] OMAPDSS: Do not require a VDDS_DSI regulator on am35xx
  2012-08-21 10:39 ` Tomi Valkeinen
@ 2012-09-19  7:49   ` Tomi Valkeinen
  2012-09-19 19:53   ` Raphaël Assénat
  1 sibling, 0 replies; 5+ messages in thread
From: Tomi Valkeinen @ 2012-09-19  7:49 UTC (permalink / raw)
  To: Raphael Assenat; +Cc: linux-omap

[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]

On Tue, 2012-08-21 at 13:39 +0300, Tomi Valkeinen wrote:
> Hi,
> 
> On Wed, 2012-08-15 at 15:16 -0400, Raphael Assenat wrote:
> > On our AM3505 based board, dpi.c complains that there is no VDSS_DSI regulator
> > and the framebuffer cannot be enabled. However, this check does not seem to
> > apply to AM3505/17 chips.
> > 
> > Taking into account comments received after my first patch[1], I have added
> > entries to dss_features.c to support the am35xx soc. Then in dpi.c, instead
> > of using cpu_is_omap34xx() and soc_is_am35xx(), a call to dss_has_feature()
> > is used.
> > 
> > [1] http://marc.info/?l=linux-fbdev&m=134272967203409&w=2
> > 
> > Signed-off-by: Raphaël Assénat <raph@8d.com>
> 
> Chandrabhanu has posted a series that removes a bunch of cpu_is checks
> from omapdss. On of them is the use of VDDS_DSI in dpi.c.
> 
> Can you wait until I've merged those patches to omapdss master branch
> (probably a few days), and then create a new patch that adds AM35xx to
> dss_features?

If you have time, can you revisit this? The current omapdss master
branch has some cleanups for the cpu check:

git://gitorious.org/linux-omap-dss2/linux.git master

 Tomi


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] OMAPDSS: Do not require a VDDS_DSI regulator on am35xx
  2012-08-21 10:39 ` Tomi Valkeinen
  2012-09-19  7:49   ` Tomi Valkeinen
@ 2012-09-19 19:53   ` Raphaël Assénat
  2012-09-20  8:22     ` Tomi Valkeinen
  1 sibling, 1 reply; 5+ messages in thread
From: Raphaël Assénat @ 2012-09-19 19:53 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap

Hello Tomi,

On 21/08/12 06:39 AM, Tomi Valkeinen wrote:
> Hi,
> 
> On Wed, 2012-08-15 at 15:16 -0400, Raphael Assenat wrote:
>> On our AM3505 based board, dpi.c complains that there is no VDSS_DSI regulator
>> and the framebuffer cannot be enabled. However, this check does not seem to
>> apply to AM3505/17 chips.
>>
>> Taking into account comments received after my first patch[1], I have added
>> entries to dss_features.c to support the am35xx soc. Then in dpi.c, instead
>> of using cpu_is_omap34xx() and soc_is_am35xx(), a call to dss_has_feature()
>> is used.
>>
>> [1] http://marc.info/?l=linux-fbdev&m=134272967203409&w=2
>>
>> Signed-off-by: Raphaël Assénat <raph@8d.com>
> 
> Chandrabhanu has posted a series that removes a bunch of cpu_is checks
> from omapdss. On of them is the use of VDDS_DSI in dpi.c.
> 
> Can you wait until I've merged those patches to omapdss master branch
> (probably a few days), and then create a new patch that adds AM35xx to
> dss_features?

Please find a new version of the patch below. Due to the above mentioned changes, 
the patch now only touches dss_features.c. 

Tested on am3505 only.

Diff based on git://gitorious.org/linux-omap-dss2/linux.git master.

--

On our AM3505 based board, dpi.c complains that there is no VDSS_DSI regulator
and the framebuffer cannot be enabled. However, this check does not seem to
apply to AM3505/17 chips.

Taking into account comments received after my first patch[1], I have added
entries to dss_features.c to support the am35xx soc.

[1] http://marc.info/?l=linux-fbdev&m=134272967203409&w=2

Signed-off-by: Raphael Assenat <raph@8d.com>

diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index c26fc1f..90e2011 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -378,6 +378,25 @@ static const enum dss_feat_id omap3430_dss_feat_list[] = {
 	FEAT_DPI_USES_VDDS_DSI,
 };
 
+static const enum dss_feat_id am35xx_dss_feat_list[] = {
+	FEAT_LCDENABLEPOL,
+	FEAT_LCDENABLESIGNAL,
+	FEAT_PCKFREEENABLE,
+	FEAT_FUNCGATED,
+	FEAT_LINEBUFFERSPLIT,
+	FEAT_ROWREPEATENABLE,
+	FEAT_RESIZECONF,
+	FEAT_DSI_PLL_FREQSEL,
+	FEAT_DSI_REVERSE_TXCLKESC,
+	FEAT_VENC_REQUIRES_TV_DAC_CLK,
+	FEAT_CPR,
+	FEAT_PRELOAD,
+	FEAT_FIR_COEF_V,
+	FEAT_ALPHA_FIXED_ZORDER,
+	FEAT_FIFO_MERGE,
+	FEAT_OMAP3_DSI_FIFO_BUG,
+};
+
 static const enum dss_feat_id omap3630_dss_feat_list[] = {
 	FEAT_LCDENABLEPOL,
 	FEAT_LCDENABLESIGNAL,
@@ -490,6 +509,27 @@ static const struct omap_dss_features omap3430_dss_features = {
 	.burst_size_unit = 8,
 };
 
+/* AM35xx DSS Features. This is basically OMAP3 DSS Features without 
+   the vdds_dsi regulator. */
+static const struct omap_dss_features am35xx_dss_features = {
+	.reg_fields = omap3_dss_reg_fields,
+	.num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
+
+	.features = am35xx_dss_feat_list,
+	.num_features = ARRAY_SIZE(am35xx_dss_feat_list),
+
+	.num_mgrs = 2,
+	.num_ovls = 3,
+	.supported_displays = omap3430_dss_supported_displays,
+	.supported_color_modes = omap3_dss_supported_color_modes,
+	.overlay_caps = omap3430_dss_overlay_caps,
+	.clksrc_names = omap3_dss_clk_source_names,
+	.dss_params = omap3_dss_param_range,
+	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_VRFB,
+	.buffer_size_unit = 1,
+	.burst_size_unit = 8,
+};
+
 static const struct omap_dss_features omap3630_dss_features = {
 	.reg_fields = omap3_dss_reg_fields,
 	.num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
@@ -697,8 +737,13 @@ void dss_features_init(void)
 		omap_current_dss_features = &omap2_dss_features;
 	else if (cpu_is_omap3630())
 		omap_current_dss_features = &omap3630_dss_features;
-	else if (cpu_is_omap34xx())
-		omap_current_dss_features = &omap3430_dss_features;
+	else if (cpu_is_omap34xx()) {
+		if (soc_is_am35xx()) {
+			omap_current_dss_features = &am35xx_dss_features;
+		} else {
+			omap_current_dss_features = &omap3430_dss_features;
+		}
+	}
 	else if (omap_rev() == OMAP4430_REV_ES1_0)
 		omap_current_dss_features = &omap4430_es1_0_dss_features;
 	else if (omap_rev() == OMAP4430_REV_ES2_0 ||
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] OMAPDSS: Do not require a VDDS_DSI regulator on am35xx
  2012-09-19 19:53   ` Raphaël Assénat
@ 2012-09-20  8:22     ` Tomi Valkeinen
  0 siblings, 0 replies; 5+ messages in thread
From: Tomi Valkeinen @ 2012-09-20  8:22 UTC (permalink / raw)
  To: Raphaël Assénat; +Cc: linux-omap

[-- Attachment #1: Type: text/plain, Size: 1402 bytes --]

On Wed, 2012-09-19 at 15:53 -0400, Raphaël Assénat wrote:
> Hello Tomi,
> 
> On 21/08/12 06:39 AM, Tomi Valkeinen wrote:
> > Hi,
> > 
> > On Wed, 2012-08-15 at 15:16 -0400, Raphael Assenat wrote:
> >> On our AM3505 based board, dpi.c complains that there is no VDSS_DSI regulator
> >> and the framebuffer cannot be enabled. However, this check does not seem to
> >> apply to AM3505/17 chips.
> >>
> >> Taking into account comments received after my first patch[1], I have added
> >> entries to dss_features.c to support the am35xx soc. Then in dpi.c, instead
> >> of using cpu_is_omap34xx() and soc_is_am35xx(), a call to dss_has_feature()
> >> is used.
> >>
> >> [1] http://marc.info/?l=linux-fbdev&m=134272967203409&w=2
> >>
> >> Signed-off-by: Raphaël Assénat <raph@8d.com>
> > 
> > Chandrabhanu has posted a series that removes a bunch of cpu_is checks
> > from omapdss. On of them is the use of VDDS_DSI in dpi.c.
> > 
> > Can you wait until I've merged those patches to omapdss master branch
> > (probably a few days), and then create a new patch that adds AM35xx to
> > dss_features?
> 
> Please find a new version of the patch below. Due to the above mentioned changes, 
> the patch now only touches dss_features.c. 
> 
> Tested on am3505 only.
> 
> Diff based on git://gitorious.org/linux-omap-dss2/linux.git master.

Thanks, I'll apply this.

 Tomi


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-20  8:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-15 19:16 [PATCH v2] OMAPDSS: Do not require a VDDS_DSI regulator on am35xx Raphael Assenat
2012-08-21 10:39 ` Tomi Valkeinen
2012-09-19  7:49   ` Tomi Valkeinen
2012-09-19 19:53   ` Raphaël Assénat
2012-09-20  8:22     ` Tomi Valkeinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox