From e4c816065ab7c682790e6951406c09cf42f5dcfe Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Sun, 17 Feb 2013 02:43:12 +0200 Subject: [PATCH] --- yaml --- r: 361887 b: refs/heads/master c: a2f9b2a5607e494e6b98b0101aaa731b42454ad0 h: refs/heads/master i: 361885: b255d164b42233b5e5678a25bea7fd4064948608 361883: 64416fc6a213f58b36e50c8f36449871c435932d 361879: 346a1672573a4d69297f7166559aa3a428d9dbc0 361871: 6f0fd9ca974dcf628da7ec461b9048e939b4038a 361855: e1ed6508e1ed1cf765c4fe9a46fad5284d0d8b31 v: v3 --- [refs] | 2 +- .../video/omap2/displays/panel-tpo-td043mtea1.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index f1e95b5572d0..f490d667140c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d31c3a81893e3416ea519d1b1383f319c046641f +refs/heads/master: a2f9b2a5607e494e6b98b0101aaa731b42454ad0 diff --git a/trunk/drivers/video/omap2/displays/panel-tpo-td043mtea1.c b/trunk/drivers/video/omap2/displays/panel-tpo-td043mtea1.c index 6b6643911d29..048c98381ef6 100644 --- a/trunk/drivers/video/omap2/displays/panel-tpo-td043mtea1.c +++ b/trunk/drivers/video/omap2/displays/panel-tpo-td043mtea1.c @@ -63,6 +63,9 @@ struct tpo_td043_device { u32 power_on_resume:1; }; +/* used to pass spi_device from SPI to DSS portion of the driver */ +static struct tpo_td043_device *g_tpo_td043; + static int tpo_td043_write(struct spi_device *spi, u8 addr, u8 data) { struct spi_message m; @@ -403,7 +406,7 @@ static void tpo_td043_disable(struct omap_dss_device *dssdev) static int tpo_td043_probe(struct omap_dss_device *dssdev) { - struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev); + struct tpo_td043_device *tpo_td043 = g_tpo_td043; int nreset_gpio = dssdev->reset_gpio; int ret = 0; @@ -440,6 +443,8 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev) if (ret) dev_warn(&dssdev->dev, "failed to create sysfs files\n"); + dev_set_drvdata(&dssdev->dev, tpo_td043); + return 0; fail_gpio_req: @@ -505,6 +510,9 @@ static int tpo_td043_spi_probe(struct spi_device *spi) return -ENODEV; } + if (g_tpo_td043 != NULL) + return -EBUSY; + spi->bits_per_word = 16; spi->mode = SPI_MODE_0; @@ -521,7 +529,7 @@ static int tpo_td043_spi_probe(struct spi_device *spi) tpo_td043->spi = spi; tpo_td043->nreset_gpio = dssdev->reset_gpio; dev_set_drvdata(&spi->dev, tpo_td043); - dev_set_drvdata(&dssdev->dev, tpo_td043); + g_tpo_td043 = tpo_td043; omap_dss_register_driver(&tpo_td043_driver); @@ -534,6 +542,7 @@ static int tpo_td043_spi_remove(struct spi_device *spi) omap_dss_unregister_driver(&tpo_td043_driver); kfree(tpo_td043); + g_tpo_td043 = NULL; return 0; }