diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2011-01-07 06:57:59 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-01-10 22:07:52 -0500 |
commit | eb0778bd3c1d4d29ffb7e13739463855d92965df (patch) | |
tree | 008c10d65e88932a2625d672a476a7d0f8c85cc4 /drivers/video/sh_mobile_hdmi.c | |
parent | c7321d6f88e1f962d605923a93f9c255e4d0b8c9 (diff) |
fbdev: sh_mobile_hdmi: framebuffer notifiers have to be registered
A previous patch added a framebuffer notifier to sh_mobile_hdmi.c,
but did not register it with the framebuffer core. This patch adds
such a registration and moves the notifier block into dynamically
allocated per-device private data.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/video/sh_mobile_hdmi.c')
-rw-r--r-- | drivers/video/sh_mobile_hdmi.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c index 571bd9f74513..46ab355e0a6a 100644 --- a/drivers/video/sh_mobile_hdmi.c +++ b/drivers/video/sh_mobile_hdmi.c | |||
@@ -221,6 +221,7 @@ struct sh_hdmi { | |||
221 | struct delayed_work edid_work; | 221 | struct delayed_work edid_work; |
222 | struct fb_var_screeninfo var; | 222 | struct fb_var_screeninfo var; |
223 | struct fb_monspecs monspec; | 223 | struct fb_monspecs monspec; |
224 | struct notifier_block notifier; | ||
224 | }; | 225 | }; |
225 | 226 | ||
226 | static void hdmi_write(struct sh_hdmi *hdmi, u8 data, u8 reg) | 227 | static void hdmi_write(struct sh_hdmi *hdmi, u8 data, u8 reg) |
@@ -1197,13 +1198,6 @@ out: | |||
1197 | } | 1198 | } |
1198 | 1199 | ||
1199 | static int sh_hdmi_notify(struct notifier_block *nb, | 1200 | static int sh_hdmi_notify(struct notifier_block *nb, |
1200 | unsigned long action, void *data); | ||
1201 | |||
1202 | static struct notifier_block sh_hdmi_notifier = { | ||
1203 | .notifier_call = sh_hdmi_notify, | ||
1204 | }; | ||
1205 | |||
1206 | static int sh_hdmi_notify(struct notifier_block *nb, | ||
1207 | unsigned long action, void *data) | 1201 | unsigned long action, void *data) |
1208 | { | 1202 | { |
1209 | struct fb_event *event = data; | 1203 | struct fb_event *event = data; |
@@ -1212,7 +1206,7 @@ static int sh_hdmi_notify(struct notifier_block *nb, | |||
1212 | struct sh_mobile_lcdc_board_cfg *board_cfg = &ch->cfg.board_cfg; | 1206 | struct sh_mobile_lcdc_board_cfg *board_cfg = &ch->cfg.board_cfg; |
1213 | struct sh_hdmi *hdmi = board_cfg->board_data; | 1207 | struct sh_hdmi *hdmi = board_cfg->board_data; |
1214 | 1208 | ||
1215 | if (nb != &sh_hdmi_notifier || !hdmi || hdmi->info != info) | 1209 | if (!hdmi || nb != &hdmi->notifier || hdmi->info != info) |
1216 | return NOTIFY_DONE; | 1210 | return NOTIFY_DONE; |
1217 | 1211 | ||
1218 | switch(action) { | 1212 | switch(action) { |
@@ -1231,11 +1225,11 @@ static int sh_hdmi_notify(struct notifier_block *nb, | |||
1231 | * temporarily, synchronise with the work queue and re-acquire | 1225 | * temporarily, synchronise with the work queue and re-acquire |
1232 | * the info->lock. | 1226 | * the info->lock. |
1233 | */ | 1227 | */ |
1234 | unlock_fb_info(hdmi->info); | 1228 | unlock_fb_info(info); |
1235 | mutex_lock(&hdmi->mutex); | 1229 | mutex_lock(&hdmi->mutex); |
1236 | hdmi->info = NULL; | 1230 | hdmi->info = NULL; |
1237 | mutex_unlock(&hdmi->mutex); | 1231 | mutex_unlock(&hdmi->mutex); |
1238 | lock_fb_info(hdmi->info); | 1232 | lock_fb_info(info); |
1239 | return NOTIFY_OK; | 1233 | return NOTIFY_OK; |
1240 | } | 1234 | } |
1241 | return NOTIFY_DONE; | 1235 | return NOTIFY_DONE; |
@@ -1333,6 +1327,9 @@ static int __init sh_hdmi_probe(struct platform_device *pdev) | |||
1333 | goto ecodec; | 1327 | goto ecodec; |
1334 | } | 1328 | } |
1335 | 1329 | ||
1330 | hdmi->notifier.notifier_call = sh_hdmi_notify; | ||
1331 | fb_register_client(&hdmi->notifier); | ||
1332 | |||
1336 | return 0; | 1333 | return 0; |
1337 | 1334 | ||
1338 | ecodec: | 1335 | ecodec: |
@@ -1363,6 +1360,8 @@ static int __exit sh_hdmi_remove(struct platform_device *pdev) | |||
1363 | 1360 | ||
1364 | snd_soc_unregister_codec(&pdev->dev); | 1361 | snd_soc_unregister_codec(&pdev->dev); |
1365 | 1362 | ||
1363 | fb_unregister_client(&hdmi->notifier); | ||
1364 | |||
1366 | board_cfg->display_on = NULL; | 1365 | board_cfg->display_on = NULL; |
1367 | board_cfg->display_off = NULL; | 1366 | board_cfg->display_off = NULL; |
1368 | board_cfg->board_data = NULL; | 1367 | board_cfg->board_data = NULL; |