Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361887
b: refs/heads/master
c: a2f9b2a
h: refs/heads/master
i:
  361885: b255d16
  361883: 64416fc
  361879: 346a167
  361871: 6f0fd9c
  361855: e1ed650
v: v3
  • Loading branch information
Grazvydas Ignotas authored and Tomi Valkeinen committed Mar 22, 2013
1 parent 7534c1a commit e4c8160
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d31c3a81893e3416ea519d1b1383f319c046641f
refs/heads/master: a2f9b2a5607e494e6b98b0101aaa731b42454ad0
13 changes: 11 additions & 2 deletions trunk/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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;

Expand All @@ -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);

Expand All @@ -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;
}
Expand Down

0 comments on commit e4c8160

Please sign in to comment.