summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e96df27)
raw | patch | inline | side by side (parent: e96df27)
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Tue, 12 May 2015 11:07:33 +0000 (14:07 +0300) | ||
committer | Jyri Sarha <jsarha@ti.com> | |
Wed, 13 May 2015 11:36:13 +0000 (14:36 +0300) |
Split sii9022_read_edid function into two, where the _sii9022_read_edid
handles the actual EDID read functionality. There are no functional
changes.
This makes it easier to implement retrying for EDID reads.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
handles the actual EDID read functionality. There are no functional
changes.
This makes it easier to implement retrying for EDID reads.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
drivers/video/fbdev/omap2/displays-new/encoder-sii9022-video.c | patch | blob | history |
diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-sii9022-video.c b/drivers/video/fbdev/omap2/displays-new/encoder-sii9022-video.c
index f4cc25e29a83b2120b9caf387ecf09266b3aa8f2..a31b0475df4716e441d7434375c4ddfce978e1ea 100644 (file)
return in->ops.dpi->check_timings(in, timings);
}
-static int sii9022_read_edid(struct omap_dss_device *dssdev,
+static int _sii9022_read_edid(struct panel_drv_data *ddata,
u8 *edid, int len)
{
- struct panel_drv_data *ddata = to_panel_data(dssdev);
struct i2c_client *client = ddata->i2c_client;
unsigned ctrl_reg;
int r, l, bytes_read;
- mutex_lock(&ddata->lock);
-
- if (ddata->use_polling)
- sii9022_handle_hpd(ddata);
-
- if (ddata->htplg_state == false) {
- r = -ENODEV;
- goto err_hpd;
- }
-
r = sii9022_request_ddc_access(ddata, &ctrl_reg);
if (r)
- goto err_ddc_request;
+ return r;
l = min(len, EDID_LENGTH);
if (r)
goto err_ddc_read;
+ return bytes_read;
+
+err_ddc_read:
+ sii9022_release_ddc_access(ddata, ctrl_reg);
+
+ return r;
+}
+
+static int sii9022_read_edid(struct omap_dss_device *dssdev,
+ u8 *edid, int len)
+{
+ struct panel_drv_data *ddata = to_panel_data(dssdev);
+ int r;
+
+ mutex_lock(&ddata->lock);
+
+ if (ddata->use_polling)
+ sii9022_handle_hpd(ddata);
+
+ if (ddata->htplg_state == false) {
+ r = -ENODEV;
+ goto err_hpd;
+ }
+
+ r = _sii9022_read_edid(ddata, edid, len);
+ if (r < 0)
+ goto err_ddc_read;
+
print_hex_dump_debug("EDID: ", DUMP_PREFIX_NONE, 16, 1, edid,
- bytes_read, false);
+ r, false);
mutex_unlock(&ddata->lock);
- return bytes_read;
+ return r;
err_ddc_read:
- sii9022_release_ddc_access(ddata, ctrl_reg);
-err_ddc_request:
err_hpd:
mutex_unlock(&ddata->lock);