Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 371333
b: refs/heads/master
c: 3c45d05
h: refs/heads/master
i:
  371331: e4cf9cc
v: v3
  • Loading branch information
Archit Taneja authored and Tomi Valkeinen committed Apr 3, 2013
1 parent ba47a49 commit 9b64d13
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 16 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: 3db716bca710b5f0f1749c058532728d21b85bfc
refs/heads/master: 3c45d05be382340dc4ccbef5819bd1eca601eb57
48 changes: 33 additions & 15 deletions trunk/drivers/video/omap2/displays/panel-acx565akm.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
#include <linux/sched.h>
#include <linux/backlight.h>
#include <linux/fb.h>
#include <linux/gpio.h>

#include <video/omapdss.h>
#include <video/omap-panel-data.h>

#define MIPID_CMD_READ_DISP_ID 0x04
#define MIPID_CMD_READ_RED 0x06
Expand Down Expand Up @@ -494,21 +496,38 @@ static struct omap_video_timings acx_panel_timings = {
.sync_pclk_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES,
};

static struct panel_acx565akm_data *get_panel_data(struct omap_dss_device *dssdev)
{
return (struct panel_acx565akm_data *) dssdev->data;
}

static int acx_panel_probe(struct omap_dss_device *dssdev)
{
int r;
struct acx565akm_device *md = &acx_dev;
struct panel_acx565akm_data *panel_data = get_panel_data(dssdev);
struct backlight_device *bldev;
int max_brightness, brightness;
struct backlight_properties props;

dev_dbg(&dssdev->dev, "%s\n", __func__);

if (!panel_data)
return -EINVAL;

/* FIXME AC bias ? */
dssdev->panel.timings = acx_panel_timings;

if (dssdev->platform_enable)
dssdev->platform_enable(dssdev);
if (gpio_is_valid(panel_data->reset_gpio)) {
r = devm_gpio_request_one(&dssdev->dev, panel_data->reset_gpio,
GPIOF_OUT_INIT_LOW, "lcd reset");
if (r)
return r;
}

if (gpio_is_valid(panel_data->reset_gpio))
gpio_set_value(panel_data->reset_gpio, 1);

/*
* After reset we have to wait 5 msec before the first
* command can be sent.
Expand All @@ -520,8 +539,9 @@ static int acx_panel_probe(struct omap_dss_device *dssdev)
r = panel_detect(md);
if (r) {
dev_err(&dssdev->dev, "%s panel detect error\n", __func__);
if (!md->enabled && dssdev->platform_disable)
dssdev->platform_disable(dssdev);
if (!md->enabled && gpio_is_valid(panel_data->reset_gpio))
gpio_set_value(panel_data->reset_gpio, 0);

return r;
}

Expand All @@ -530,8 +550,8 @@ static int acx_panel_probe(struct omap_dss_device *dssdev)
mutex_unlock(&acx_dev.mutex);

if (!md->enabled) {
if (dssdev->platform_disable)
dssdev->platform_disable(dssdev);
if (gpio_is_valid(panel_data->reset_gpio))
gpio_set_value(panel_data->reset_gpio, 0);
}

/*------- Backlight control --------*/
Expand Down Expand Up @@ -584,6 +604,7 @@ static void acx_panel_remove(struct omap_dss_device *dssdev)
static int acx_panel_power_on(struct omap_dss_device *dssdev)
{
struct acx565akm_device *md = &acx_dev;
struct panel_acx565akm_data *panel_data = get_panel_data(dssdev);
int r;

dev_dbg(&dssdev->dev, "%s\n", __func__);
Expand All @@ -605,11 +626,8 @@ static int acx_panel_power_on(struct omap_dss_device *dssdev)
/*FIXME tweak me */
msleep(50);

if (dssdev->platform_enable) {
r = dssdev->platform_enable(dssdev);
if (r)
goto fail;
}
if (gpio_is_valid(panel_data->reset_gpio))
gpio_set_value(panel_data->reset_gpio, 1);

if (md->enabled) {
dev_dbg(&md->spi->dev, "panel already enabled\n");
Expand Down Expand Up @@ -638,8 +656,7 @@ static int acx_panel_power_on(struct omap_dss_device *dssdev)
mutex_unlock(&md->mutex);

return acx565akm_bl_update_status(md->bl_dev);
fail:
omapdss_sdi_display_disable(dssdev);

fail_unlock:
mutex_unlock(&md->mutex);
return r;
Expand All @@ -648,6 +665,7 @@ static int acx_panel_power_on(struct omap_dss_device *dssdev)
static void acx_panel_power_off(struct omap_dss_device *dssdev)
{
struct acx565akm_device *md = &acx_dev;
struct panel_acx565akm_data *panel_data = get_panel_data(dssdev);

dev_dbg(&dssdev->dev, "%s\n", __func__);

Expand All @@ -671,8 +689,8 @@ static void acx_panel_power_off(struct omap_dss_device *dssdev)
*/
msleep(50);

if (dssdev->platform_disable)
dssdev->platform_disable(dssdev);
if (gpio_is_valid(panel_data->reset_gpio))
gpio_set_value(panel_data->reset_gpio, 0);

/* FIXME need to tweak this delay */
msleep(100);
Expand Down

0 comments on commit 9b64d13

Please sign in to comment.