drm/sun4i: tcon: Copy ID from associated backend
authorChen-Yu Tsai <wens@csie.org>
Fri, 21 Apr 2017 08:38:55 +0000 (16:38 +0800)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Sun, 14 May 2017 06:31:57 +0000 (08:31 +0200)
The tcons and backends have a one-to-one relationship. Their IDs,
or indexes in the documentation, are also the same.

Copy the ID from the associated backend and save it in the tcon
structure. This will later be used when we add support for the
output data path muxes.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
drivers/gpu/drm/sun4i/sun4i_tcon.c
drivers/gpu/drm/sun4i/sun4i_tcon.h

index b13a7c2029df9b470117e013c08bcd9e84a8f4ac..5d7866fce78b83a76e268917d505d72a346e79ec 100644 (file)
@@ -471,6 +471,7 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master,
        dev_set_drvdata(dev, tcon);
        tcon->drm = drm;
        tcon->dev = dev;
+       tcon->id = backend->id;
        tcon->quirks = of_device_get_match_data(dev);
 
        tcon->lcd_rst = devm_reset_control_get(dev, "lcd");
index 1bda4d183eeccd91b197e6fafe118cfe8d1c2a3f..d37e1e2ed60ea59670f2f596a4eaf63cd693a07b 100644 (file)
@@ -174,6 +174,8 @@ struct sun4i_tcon {
        /* Associated crtc */
        struct sun4i_crtc               *crtc;
 
+       int                             id;
+
        /* TCON list management */
        struct list_head                list;
 };