linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] OMAP: DSS: do not fail if dpll4_m4_ck is missing
@ 2012-11-21 19:48 Aaro Koskinen
  2012-11-21 19:48 ` [PATCH 2/2] OMAP: DSS: panel-n8x0: register the DSS driver after SPI probe Aaro Koskinen
  0 siblings, 1 reply; 6+ messages in thread
From: Aaro Koskinen @ 2012-11-21 19:48 UTC (permalink / raw)
  To: Tomi Valkeinen, linux-omap, linux-fbdev; +Cc: Aaro Koskinen

Do not fail if dpll4_m4_ck is missing. The clock is not there on omap24xx,
so this should not be a hard error.

The patch retains the functionality before the commit 185bae10 (OMAPDSS:
DSS: Cleanup cpu_is_xxxx checks).

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 drivers/video/omap2/dss/dss.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 2ab1c3e..55f2ea9 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -697,11 +697,15 @@ static int dss_get_clocks(void)
 
 	dss.dss_clk = clk;
 
-	clk = clk_get(NULL, dss.feat->clk_name);
-	if (IS_ERR(clk)) {
-		DSSERR("Failed to get %s\n", dss.feat->clk_name);
-		r = PTR_ERR(clk);
-		goto err;
+	if (dss.feat->clk_name) {
+		clk = clk_get(NULL, dss.feat->clk_name);
+		if (IS_ERR(clk)) {
+			DSSERR("Failed to get %s\n", dss.feat->clk_name);
+			r = PTR_ERR(clk);
+			goto err;
+		}
+	} else {
+		clk = NULL;
 	}
 
 	dss.dpll4_m4_ck = clk;
-- 
1.7.10.4


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

* [PATCH 2/2] OMAP: DSS: panel-n8x0: register the DSS driver after SPI probe
  2012-11-21 19:48 [PATCH 1/2] OMAP: DSS: do not fail if dpll4_m4_ck is missing Aaro Koskinen
@ 2012-11-21 19:48 ` Aaro Koskinen
  2012-11-22 12:18   ` Tomi Valkeinen
  0 siblings, 1 reply; 6+ messages in thread
From: Aaro Koskinen @ 2012-11-21 19:48 UTC (permalink / raw)
  To: Tomi Valkeinen, linux-omap, linux-fbdev; +Cc: Aaro Koskinen

Register the DSS driver after SPI probe. This simplifies the
initialization. This is similar to what is being done e.g.
in panel-acx565akm.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 drivers/video/omap2/displays/panel-n8x0.c |   39 +++++++----------------------
 1 file changed, 9 insertions(+), 30 deletions(-)

diff --git a/drivers/video/omap2/displays/panel-n8x0.c b/drivers/video/omap2/displays/panel-n8x0.c
index 3fc5ad0..6cafdd4 100644
--- a/drivers/video/omap2/displays/panel-n8x0.c
+++ b/drivers/video/omap2/displays/panel-n8x0.c
@@ -702,18 +702,25 @@ static struct omap_dss_driver n8x0_panel_driver = {
 
 static int mipid_spi_probe(struct spi_device *spi)
 {
+	int r;
+
 	dev_dbg(&spi->dev, "mipid_spi_probe\n");
 
 	spi->mode = SPI_MODE_0;
 
 	s_drv_data.spidev = spi;
 
-	return 0;
+	r = omap_dss_register_driver(&n8x0_panel_driver);
+	if (r)
+		pr_err("n8x0_panel: dss driver registration failed\n");
+
+	return r;
 }
 
 static int mipid_spi_remove(struct spi_device *spi)
 {
 	dev_dbg(&spi->dev, "mipid_spi_remove\n");
+	omap_dss_unregister_driver(&n8x0_panel_driver);
 	return 0;
 }
 
@@ -725,34 +732,6 @@ static struct spi_driver mipid_spi_driver = {
 	.probe	= mipid_spi_probe,
 	.remove	= __devexit_p(mipid_spi_remove),
 };
+module_spi_driver(mipid_spi_driver);
 
-static int __init n8x0_panel_drv_init(void)
-{
-	int r;
-
-	r = spi_register_driver(&mipid_spi_driver);
-	if (r) {
-		pr_err("n8x0_panel: spi driver registration failed\n");
-		return r;
-	}
-
-	r = omap_dss_register_driver(&n8x0_panel_driver);
-	if (r) {
-		pr_err("n8x0_panel: dss driver registration failed\n");
-		spi_unregister_driver(&mipid_spi_driver);
-		return r;
-	}
-
-	return 0;
-}
-
-static void __exit n8x0_panel_drv_exit(void)
-{
-	spi_unregister_driver(&mipid_spi_driver);
-
-	omap_dss_unregister_driver(&n8x0_panel_driver);
-}
-
-module_init(n8x0_panel_drv_init);
-module_exit(n8x0_panel_drv_exit);
 MODULE_LICENSE("GPL");
-- 
1.7.10.4


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

* Re: [PATCH 2/2] OMAP: DSS: panel-n8x0: register the DSS driver after SPI probe
  2012-11-21 19:48 ` [PATCH 2/2] OMAP: DSS: panel-n8x0: register the DSS driver after SPI probe Aaro Koskinen
@ 2012-11-22 12:18   ` Tomi Valkeinen
  2012-11-22 15:17     ` Aaro Koskinen
  0 siblings, 1 reply; 6+ messages in thread
From: Tomi Valkeinen @ 2012-11-22 12:18 UTC (permalink / raw)
  To: Aaro Koskinen; +Cc: linux-omap, linux-fbdev

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

Hi,

On 2012-11-21 21:48, Aaro Koskinen wrote:
> Register the DSS driver after SPI probe. This simplifies the
> initialization. This is similar to what is being done e.g.
> in panel-acx565akm.

Is this a fix? The description sounds like it's just a cleanup. The
first patch in the series needs to be sent for the next -rc, right?

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

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

* Re: [PATCH 2/2] OMAP: DSS: panel-n8x0: register the DSS driver after SPI probe
  2012-11-22 12:18   ` Tomi Valkeinen
@ 2012-11-22 15:17     ` Aaro Koskinen
  2012-11-22 15:21       ` Tomi Valkeinen
  0 siblings, 1 reply; 6+ messages in thread
From: Aaro Koskinen @ 2012-11-22 15:17 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap, linux-fbdev

On Thu, Nov 22, 2012 at 02:18:57PM +0200, Tomi Valkeinen wrote:
> Hi,
> 
> On 2012-11-21 21:48, Aaro Koskinen wrote:
> > Register the DSS driver after SPI probe. This simplifies the
> > initialization. This is similar to what is being done e.g.
> > in panel-acx565akm.
> 
> Is this a fix? The description sounds like it's just a cleanup.

Yes, it's a cleanup. I should have sent it separately, sorry.

> The first patch in the series needs to be sent for the next -rc, right?

Yes, it's fixing regression. There are OMAP2 boards with display
configured (e.g. board-apollon) and those will see probe failing.

A.

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

* Re: [PATCH 2/2] OMAP: DSS: panel-n8x0: register the DSS driver after SPI probe
  2012-11-22 15:17     ` Aaro Koskinen
@ 2012-11-22 15:21       ` Tomi Valkeinen
  2012-11-22 15:56         ` Aaro Koskinen
  0 siblings, 1 reply; 6+ messages in thread
From: Tomi Valkeinen @ 2012-11-22 15:21 UTC (permalink / raw)
  To: Aaro Koskinen; +Cc: linux-omap, linux-fbdev

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

On 2012-11-22 17:17, Aaro Koskinen wrote:
> On Thu, Nov 22, 2012 at 02:18:57PM +0200, Tomi Valkeinen wrote:
>> Hi,
>>
>> On 2012-11-21 21:48, Aaro Koskinen wrote:
>>> Register the DSS driver after SPI probe. This simplifies the
>>> initialization. This is similar to what is being done e.g.
>>> in panel-acx565akm.
>>
>> Is this a fix? The description sounds like it's just a cleanup.
> 
> Yes, it's a cleanup. I should have sent it separately, sorry.

Ok. Did you actually manage to test it? I haven't tested N800 for ages,
as I don't have a serial console for my N800, and last times I've tried
I didn't manage to get it to boot.

>> The first patch in the series needs to be sent for the next -rc, right?
> 
> Yes, it's fixing regression. There are OMAP2 boards with display
> configured (e.g. board-apollon) and those will see probe failing.

Ok, I'll queue it for next -rc.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

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

* Re: [PATCH 2/2] OMAP: DSS: panel-n8x0: register the DSS driver after SPI probe
  2012-11-22 15:21       ` Tomi Valkeinen
@ 2012-11-22 15:56         ` Aaro Koskinen
  0 siblings, 0 replies; 6+ messages in thread
From: Aaro Koskinen @ 2012-11-22 15:56 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap, linux-fbdev

On Thu, Nov 22, 2012 at 05:21:42PM +0200, Tomi Valkeinen wrote:
> On 2012-11-22 17:17, Aaro Koskinen wrote:
> > On Thu, Nov 22, 2012 at 02:18:57PM +0200, Tomi Valkeinen wrote:
> >> On 2012-11-21 21:48, Aaro Koskinen wrote:
> >>> Register the DSS driver after SPI probe. This simplifies the
> >>> initialization. This is similar to what is being done e.g.
> >>> in panel-acx565akm.
> >>
> >> Is this a fix? The description sounds like it's just a cleanup.
> > 
> > Yes, it's a cleanup. I should have sent it separately, sorry.
> 
> Ok. Did you actually manage to test it?

Yes, the patch works but there are still issues and I can't get the
display yet alive:

[    4.081390] n8x0_panel display0: invalid s1d1374x revision 00
[    4.087738] omapfb omapfb: Failed to enable display 'lcd'
[    4.093475] omapfb omapfb: failed to initialize default display

For some reason all the blizzard_read_reg()s return just zeroes. I have
set up the panel_reset and ctrl_pwrdown GPIOs (30, 15) according to the
Maemo kernel, but maybe there's still more initializations I need to do
from the board file...

> I haven't tested N800 for ages, as I don't have a serial console for
> my N800, and last times I've tried I didn't manage to get it to boot.

It works. I use busybox/dropbear/USB networking to get a "console".

A.

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

end of thread, other threads:[~2012-11-22 15:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-21 19:48 [PATCH 1/2] OMAP: DSS: do not fail if dpll4_m4_ck is missing Aaro Koskinen
2012-11-21 19:48 ` [PATCH 2/2] OMAP: DSS: panel-n8x0: register the DSS driver after SPI probe Aaro Koskinen
2012-11-22 12:18   ` Tomi Valkeinen
2012-11-22 15:17     ` Aaro Koskinen
2012-11-22 15:21       ` Tomi Valkeinen
2012-11-22 15:56         ` Aaro Koskinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).